Bug 1449641 - Use the correct parameter when computing the clear rect. r?sotaro draft
authorMarkus Stange <mstange@themasta.com>
Wed, 28 Mar 2018 13:11:44 -0400
changeset 773876 c96ecd0bbed8df29cf19a346069e468bda0b4a9a
parent 773875 b8b6784d5126c70bc69ad9bbc75b1362264c248e
child 773877 80a748ea8cf2a11f8f46f43551b76ab117c3bf5a
push id104336
push userbmo:mstange@themasta.com
push dateWed, 28 Mar 2018 17:17:11 +0000
reviewerssotaro
bugs1449641
milestone61.0a1
Bug 1449641 - Use the correct parameter when computing the clear rect. r?sotaro This was incorrectly using the invalid rect, so it was clearing more than necessary and not taking advantage of the opaque region that the caller computes. The idea is that we don't need to clear parts of the invalid region that will be covered by something opaque. MozReview-Commit-ID: LhEkVUMnjC9
gfx/layers/basic/BasicCompositor.cpp
--- a/gfx/layers/basic/BasicCompositor.cpp
+++ b/gfx/layers/basic/BasicCompositor.cpp
@@ -308,17 +308,17 @@ BasicCompositor::CreateRenderTargetForWi
   } else {
     IntRect windowRect = rect;
     // Adjust bounds rect to account for new origin at (0, 0).
     if (windowRect.Size() != mDrawTarget->GetSize()) {
       windowRect.ExpandToEnclose(IntPoint(0, 0));
     }
     rt = new BasicCompositingRenderTarget(mDrawTarget, windowRect);
     if (!aClearRect.IsEmpty()) {
-      IntRect clearRect = aRect.ToUnknownRect();
+      IntRect clearRect = aClearRect.ToUnknownRect();
       mDrawTarget->ClearRect(Rect(clearRect - rt->GetOrigin()));
     }
   }
 
   return rt.forget();
 }
 
 already_AddRefed<DataTextureSource>