Backed out changeset bb4879b87c17 (bug 1313884) because bad things happen @mozilla::dom::CanvasRenderingContext2D::DrawImage all the time
authorPhil Ringnalda <philringnalda@gmail.com>
Thu, 10 Nov 2016 23:28:02 -0800
changeset 437680 056085427582d32c24ae55d1c5248c31fd6a5fc1
parent 437679 b2b359340a84abda881e038d535dd90ac2fa58aa
child 437681 7687c3f7a82d59b3a345db60e3fce25551f2649d
push id35485
push userbmo:afarre@mozilla.com
push dateFri, 11 Nov 2016 11:07:43 +0000
bugs1313884
milestone52.0a1
backs outbb4879b87c176f4d644cab920f41e7c430e7c484
Backed out changeset bb4879b87c17 (bug 1313884) because bad things happen @mozilla::dom::CanvasRenderingContext2D::DrawImage all the time CLOSED TREE
dom/canvas/CanvasRenderingContext2D.cpp
gfx/2d/Logging.h
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -4971,22 +4971,18 @@ CanvasRenderingContext2D::DrawImage(cons
     if (element == mCanvasElement) {
       // srcSurf is a snapshot of mTarget. If we draw to mTarget now, we'll
       // trigger a COW copy of the whole canvas into srcSurf. That's a huge
       // waste if sourceRect doesn't cover the whole canvas.
       // We avoid copying the whole canvas by manually copying just the part
       // that we need.
       srcSurf = ExtractSubrect(srcSurf, &sourceRect, mTarget);
     }
-    DrawTarget* adt = AdjustedTarget(this, bounds.IsEmpty() ? nullptr : &bounds);
-    if (!adt) {
-      gfxDevCrash(LogReason::InvalidDrawTarget) << "Invalid adjusted target in Canvas2D " << gfx::hexa(mTarget) << "< " << NeedToDrawShadow() << NeedToApplyFilter();
-      return;
-    }
-    adt->DrawSurface(srcSurf,
+    AdjustedTarget(this, bounds.IsEmpty() ? nullptr : &bounds)->
+      DrawSurface(srcSurf,
                   gfx::Rect(aDx, aDy, aDw, aDh),
                   sourceRect,
                   DrawSurfaceOptions(samplingFilter, SamplingBounds::UNBOUNDED),
                   DrawOptions(CurrentState().globalAlpha, UsedOperation(), antialiasMode));
   } else {
     DrawDirectlyToCanvas(drawInfo, &bounds,
                          gfx::Rect(aDx, aDy, aDw, aDh),
                          gfx::Rect(aSx, aSy, aSw, aSh),
--- a/gfx/2d/Logging.h
+++ b/gfx/2d/Logging.h
@@ -124,17 +124,16 @@ enum class LogReason : int {
   InvalidContext,
   InvalidCommandList,
   AsyncTransactionTimeout, // 30
   TextureCreation,
   InvalidCacheSurface,
   AlphaWithBasicClient,
   UnbalancedClipStack,
   ProcessingError,
-  InvalidDrawTarget,
   // End
   MustBeLessThanThis = 101,
 };
 
 struct BasicLogger
 {
   // For efficiency, this method exists and copies the logic of the
   // OutputMessage below.  If making any changes here, also make it