Bug 1449641 - Remove extraneous "if (mRenderTarget->mDrawTarget != mDrawTarget)". r?sotaro draft
authorMarkus Stange <mstange@themasta.com>
Wed, 28 Mar 2018 13:13:03 -0400
changeset 773877 80a748ea8cf2a11f8f46f43551b76ab117c3bf5a
parent 773876 c96ecd0bbed8df29cf19a346069e468bda0b4a9a
child 773882 ffe501aeb1c663f857d3e91a6b470a74b4e428d0
push id104336
push userbmo:mstange@themasta.com
push dateWed, 28 Mar 2018 17:17:11 +0000
reviewerssotaro
bugs1449641
milestone61.0a1
Bug 1449641 - Remove extraneous "if (mRenderTarget->mDrawTarget != mDrawTarget)". r?sotaro The same condition is checked just before this if, so it's always true. MozReview-Commit-ID: 9Vscnkz7AoY
gfx/layers/basic/BasicCompositor.cpp
--- a/gfx/layers/basic/BasicCompositor.cpp
+++ b/gfx/layers/basic/BasicCompositor.cpp
@@ -1033,22 +1033,17 @@ BasicCompositor::TryToEndRemoteDrawing(b
                              [self]() { self->TryToEndRemoteDrawing(); });
     MessageLoop::current()->PostDelayedTask(runnable.forget(), retryMs);
     return;
   }
 
   if (mRenderTarget->mDrawTarget != mDrawTarget) {
     // Note: Most platforms require us to buffer drawing to the widget surface.
     // That's why we don't draw to mDrawTarget directly.
-    RefPtr<SourceSurface> source;
-    if (mRenderTarget->mDrawTarget != mDrawTarget) {
-      source = mWidget->EndBackBufferDrawing();
-    } else {
-      source = mRenderTarget->mDrawTarget->Snapshot();
-    }
+    RefPtr<SourceSurface> source = mWidget->EndBackBufferDrawing();
     RefPtr<DrawTarget> dest(mTarget ? mTarget : mDrawTarget);
 
     nsIntPoint offset = mTarget ? mTargetBounds.TopLeft() : nsIntPoint();
 
     // The source DrawTarget is clipped to the invalidation region, so we have
     // to copy the individual rectangles in the region or else we'll draw blank
     // pixels.
     for (auto iter = mInvalidRegion.RectIter(); !iter.Done(); iter.Next()) {