Bug 1452426. Hook up invalidation testing in WebRender. r=mstange
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Thu, 30 Aug 2018 18:29:08 -0400
changeset 482457 3cf0bec611e10d70c41dcd8548559e7f77e2d65c
parent 482456 c5c7d67c2b5b43e08c08e4d592112b4be81af76e
child 482458 77fa433348797871bf307483a5624b07a7b4c9da
push id232
push userfmarier@mozilla.com
push dateWed, 05 Sep 2018 20:45:54 +0000
reviewersmstange
bugs1452426
milestone63.0a1
Bug 1452426. Hook up invalidation testing in WebRender. r=mstange
gfx/layers/wr/WebRenderCommandBuilder.cpp
--- a/gfx/layers/wr/WebRenderCommandBuilder.cpp
+++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp
@@ -762,16 +762,19 @@ struct DIGroup
           DisplayItemClip currentClip = item->GetClip();
 
           if (currentClip.HasClip()) {
             aContext->Save();
             currentClip.ApplyTo(aContext, aGrouper->mAppUnitsPerDevPixel);
           }
           aContext->NewPath();
           GP("painting %s %p-%d\n", item->Name(), item->Frame(), item->GetPerFrameKey());
+          if (aGrouper->mDisplayListBuilder->IsPaintingToWindow()) {
+            item->Frame()->AddStateBits(NS_FRAME_PAINTED_THEBES);
+          }
           item->Paint(aGrouper->mDisplayListBuilder, aContext);
           if (currentClip.HasClip()) {
             aContext->Restore();
           }
         }
         aContext->GetDrawTarget()->FlushItem(bounds);
       }
     }
@@ -1645,16 +1648,19 @@ PaintItemByDrawTarget(nsDisplayItem* aIt
         static_cast<nsDisplayFilter*>(aItem)->PaintAsLayer(aDisplayListBuilder,
                                                            context, aManager);
       });
       break;
     }
 
   default:
     context->SetMatrix(context->CurrentMatrix().PreScale(aScale.width, aScale.height).PreTranslate(-aOffset.x, -aOffset.y));
+    if (aDisplayListBuilder->IsPaintingToWindow()) {
+      aItem->Frame()->AddStateBits(NS_FRAME_PAINTED_THEBES);
+    }
     aItem->Paint(aDisplayListBuilder, context);
     isInvalidated = true;
     break;
   }
 
   if (aItem->GetType() != DisplayItemType::TYPE_MASK) {
     // Apply highlight fills, if the appropriate prefs are set.
     // We don't do this for masks because we'd be filling the A8 mask surface,