Bug 1292545 - Don't skip clearing the canvas because of W(1) failures on Mac.
authorNicolas Silva <nsilva@mozilla.com>
Wed, 10 Aug 2016 17:00:25 +0200
changeset 334684 4927c9be916707e7c6d426b9efaa098f07587df5
parent 334683 cbdee926460d0e402778da74c97937a067ebe94d
child 334685 43f446ee8c82aacf2c696c04929143ab36ddd83b
push id10033
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:50:26 +0000
treeherdermozilla-aurora@5dddbefdf759 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1292545
milestone51.0a1
Bug 1292545 - Don't skip clearing the canvas because of W(1) failures on Mac.
dom/canvas/CanvasRenderingContext2D.cpp
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -1626,21 +1626,17 @@ CanvasRenderingContext2D::EnsureTarget(c
       }
 
       gCanvasAzureMemoryUsed += mWidth * mHeight * 4;
       JSContext* context = nsContentUtils::GetCurrentJSContext();
       if (context) {
         JS_updateMallocCounter(context, mWidth * mHeight * 4);
       }
 
-      // Skia with the BGRX format requires the unused alpha channel (X) to be zero.
-      bool isOpaqueSkia = mOpaque && mTarget->GetBackendType() == BackendType::SKIA;
-      if (!canDiscardContent || isOpaqueSkia) {
-        mTarget->ClearRect(canvasRect);
-      }
+      mTarget->ClearRect(canvasRect);
 
       // Force a full layer transaction since we didn't have a layer before
       // and now we might need one.
       if (mCanvasElement) {
         mCanvasElement->InvalidateCanvas();
       }
       // Calling Redraw() tells our invalidation machinery that the entire
       // canvas is already invalid, which can speed up future drawing.