Bug 1469528 - Flush the clip push/pop draw commands so they don't end up in the wrong entry. r?jrmuizel draft
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 12 Jul 2018 14:27:15 -0400
changeset 817513 5e9618350eb750b773cee8753791182cc90af155
parent 817312 fe17acc6e291e54463db3ea82697c714ae5a4b27
push id116083
push userkgupta@mozilla.com
push dateThu, 12 Jul 2018 18:27:54 +0000
reviewersjrmuizel
bugs1469528
milestone63.0a1
Bug 1469528 - Flush the clip push/pop draw commands so they don't end up in the wrong entry. r?jrmuizel MozReview-Commit-ID: 7PVPxaF2RnK
gfx/layers/wr/WebRenderCommandBuilder.cpp
--- a/gfx/layers/wr/WebRenderCommandBuilder.cpp
+++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp
@@ -748,29 +748,31 @@ Grouper::PaintContainerItem(DIGroup* aGr
   switch (aItem->GetType()) {
     case DisplayItemType::TYPE_TRANSFORM: {
       DisplayItemClip currentClip = aItem->GetClip();
 
       gfx::Matrix matrix;
       if (currentClip.HasClip()) {
         aContext->Save();
         currentClip.ApplyTo(aContext, this->mAppUnitsPerDevPixel);
+        aContext->GetDrawTarget()->FlushItem(aItemBounds);
       } else {
         matrix = aContext->CurrentMatrix();
       }
 
       auto transformItem = static_cast<nsDisplayTransform*>(aItem);
       Matrix4x4Flagged trans = transformItem->GetTransform();
       Matrix trans2d;
       MOZ_RELEASE_ASSERT(trans.Is2D(&trans2d));
       aContext->Multiply(ThebesMatrix(trans2d));
       aGroup->PaintItemRange(this, aChildren->GetBottom(), nullptr, aContext, aRecorder);
 
       if (currentClip.HasClip()) {
         aContext->Restore();
+        aContext->GetDrawTarget()->FlushItem(aItemBounds);
       } else {
         aContext->SetMatrix(matrix);
       }
       break;
     }
     case DisplayItemType::TYPE_OPACITY: {
       auto opacityItem = static_cast<nsDisplayOpacity*>(aItem);
       float opacity = opacityItem->GetOpacity();