Bug 1515793 - pop blob image transform clips. r=mattwoodrow
authorLee Salzman <lsalzman@mozilla.com>
Fri, 04 Jan 2019 15:58:10 -0500
changeset 509717 3fd283d8fe546b14c2f6eb49d68527eb3b330898
parent 509716 d1267711aef0a8031752776607483d6ac5e31dde
child 509718 f8a29b8bb211f77df65ca111395da89ba882f68d
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1515793
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1515793 - pop blob image transform clips. r=mattwoodrow
gfx/layers/wr/WebRenderCommandBuilder.cpp
--- a/gfx/layers/wr/WebRenderCommandBuilder.cpp
+++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp
@@ -915,23 +915,23 @@ static BlobItemData* GetBlobItemDataForG
 void Grouper::PaintContainerItem(DIGroup* aGroup, nsDisplayItem* aItem,
                                  const IntRect& aItemBounds,
                                  nsDisplayList* aChildren, gfxContext* aContext,
                                  WebRenderDrawEventRecorder* aRecorder) {
   switch (aItem->GetType()) {
     case DisplayItemType::TYPE_TRANSFORM: {
       DisplayItemClip currentClip = aItem->GetClip();
 
-      gfx::Matrix matrix;
+      gfxContextMatrixAutoSaveRestore saveMatrix;
       if (currentClip.HasClip()) {
         aContext->Save();
         currentClip.ApplyTo(aContext, this->mAppUnitsPerDevPixel);
         aContext->GetDrawTarget()->FlushItem(aItemBounds);
       } else {
-        matrix = aContext->CurrentMatrix();
+        saveMatrix.SetContext(aContext);
       }
 
       auto transformItem = static_cast<nsDisplayTransform*>(aItem);
       Matrix4x4Flagged trans = transformItem->GetTransform();
       Matrix trans2d;
       if (!trans.Is2D(&trans2d)) {
         // We don't currently support doing invalidation inside 3d transforms.
         // For now just paint it as a single item.
@@ -941,23 +941,21 @@ void Grouper::PaintContainerItem(DIGroup
           data->mLayerManager->EndTransaction(
               FrameLayerBuilder::DrawPaintedLayer, mDisplayListBuilder);
           aContext->GetDrawTarget()->FlushItem(aItemBounds);
         }
       } else {
         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);
-        }
+      if (currentClip.HasClip()) {
+        aContext->Restore();
+        aContext->GetDrawTarget()->FlushItem(aItemBounds);
       }
       break;
     }
     case DisplayItemType::TYPE_OPACITY: {
       auto opacityItem = static_cast<nsDisplayOpacity*>(aItem);
       float opacity = opacityItem->GetOpacity();
       if (opacity == 0.0f) {
         return;