Bug 1743304 - Semi-reduntantly propagate raster space inheritance in gecko r=gw default tip
authorDoug Thayer <dothayer@mozilla.com>
Sun, 28 Nov 2021 21:47:04 +0000
changeset 600362 41ebfc5cf5f27910237ea07814455993d0576484
parent 600361 3acb77105ffef7d770431e8a36d549520854db6c
push id153780
push userdothayer@mozilla.com
push dateSun, 28 Nov 2021 21:49:27 +0000
treeherderautoland@41ebfc5cf5f2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1743304, 1740262, 1730710
Bug 1743304 - Semi-reduntantly propagate raster space inheritance in gecko r=gw So, it turns out I didn't fully test the patch from bug 1740262 after I made my final changes to it. A change that I had in the patch which I thought was unnecessary, because it didn't fix the problem by itself, turns out to in fact be necessary. It turns out we still need to inherit the parent stacking context's `mRasterizeLocally` value inside gecko, or else we could have scale changes which get dropped on the WebRender side. I do think long term WebRender should handle all of this itself, because I believe there are still potential issues lurking here when we start to think of this across the process boundary, but I don't think I'm the right person right now to untangle everything to cleanly move everything necessary into WebRender, so I think the solution for right now is to have Gecko somewhat but not entirely reduntantly handle raster space inheritance itself, in addition to WebRender handling raster space inheritance in order to partially cover the process boundary case. This is not a pretty solution, but as far as I can tell it fixes the issues that bug 1730710 introduced without regressing the performance back to pre-1730710 levels. Differential Revision: https://phabricator.services.mozilla.com/D132308
--- a/gfx/layers/wr/StackingContextHelper.cpp
+++ b/gfx/layers/wr/StackingContextHelper.cpp
@@ -128,17 +128,18 @@ Size ChooseScale(nsIFrame* aContainerFra
     const StackingContextHelper& aParentSC, const ActiveScrolledRoot* aAsr,
     nsIFrame* aContainerFrame, nsDisplayItem* aContainerItem,
     wr::DisplayListBuilder& aBuilder, const wr::StackingContextParams& aParams,
     const LayoutDeviceRect& aBounds)
     : mBuilder(&aBuilder),
       mScale(1.0f, 1.0f),
-      mRasterizeLocally(aParams.mRasterizeLocally) {
+      mRasterizeLocally(aParams.mRasterizeLocally ||
+                        aParentSC.mRasterizeLocally) {
   MOZ_ASSERT(!aContainerItem || aContainerItem->CreatesStackingContextHelper());
   mOrigin = aParentSC.mOrigin + aBounds.TopLeft();
   // Compute scale for fallback rendering. We don't try to guess a scale for 3d
   // transformed items
   if (aParams.mBoundTransform) {
     gfx::Matrix transform2d;