Bug 1576499 - Make clipRect an untyped IntRect. r=mattwoodrow
authorMarkus Stange <mstange@themasta.com>
Mon, 26 Aug 2019 00:58:44 +0000
changeset 554268 f2ff20d5af92c5148bdf711d95b74ab69eeb5259
parent 554267 32817ced1d522a2d58d1bf05158dd077741d37cc
child 554269 11dda086945d583b6fba3a3eb92fc63451c39c14
push id2165
push userffxbld-merge
push dateMon, 14 Oct 2019 16:30:58 +0000
treeherdermozilla-release@0eae18af659f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1576499
milestone70.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 1576499 - Make clipRect an untyped IntRect. r=mattwoodrow Depends on D43370 Differential Revision: https://phabricator.services.mozilla.com/D43371
gfx/layers/composite/LayerManagerComposite.cpp
--- a/gfx/layers/composite/LayerManagerComposite.cpp
+++ b/gfx/layers/composite/LayerManagerComposite.cpp
@@ -960,19 +960,16 @@ bool LayerManagerComposite::Render(const
   {
     AUTO_PROFILER_LABEL("LayerManagerComposite::Render:Prerender", GRAPHICS);
 
     if (!mCompositor->GetWidget()->PreRender(&widgetContext)) {
       return false;
     }
   }
 
-  ParentLayerIntRect clipRect;
-  IntRect actualBounds;
-
   CompositorBench(mCompositor, mRenderBounds);
 
   MOZ_ASSERT(mRoot->GetOpacity() == 1);
 #if defined(MOZ_WIDGET_ANDROID)
   LayerMetricsWrapper wrapper = GetRootContentLayer();
   if (wrapper) {
     mCompositor->SetClearColor(wrapper.Metadata().GetBackgroundColor());
   } else {
@@ -983,27 +980,28 @@ bool LayerManagerComposite::Render(const
   if (mNativeLayerForEntireWindow) {
     mNativeLayerForEntireWindow->SetRect(mRenderBounds);
 #ifdef XP_MACOSX
     mNativeLayerForEntireWindow->SetOpaqueRegion(
         mCompositor->GetWidget()->GetOpaqueWidgetRegion().ToUnknownRegion());
 #endif
   }
 
+  IntRect actualBounds;
+  IntRect clipRect;
   if (mRoot->GetClipRect()) {
-    clipRect = *mRoot->GetClipRect();
-    IntRect rect(clipRect.X(), clipRect.Y(), clipRect.Width(),
-                 clipRect.Height());
-    mCompositor->BeginFrame(aInvalidRegion, &rect, mRenderBounds, aOpaqueRegion,
-                            mNativeLayerForEntireWindow, &actualBounds);
+    clipRect = mRoot->GetClipRect()->ToUnknownRect();
+    mCompositor->BeginFrame(aInvalidRegion, &clipRect, mRenderBounds,
+                            aOpaqueRegion, mNativeLayerForEntireWindow,
+                            &actualBounds);
   } else {
     mCompositor->BeginFrame(aInvalidRegion, nullptr, mRenderBounds,
                             aOpaqueRegion, mNativeLayerForEntireWindow,
                             &actualBounds);
-    clipRect = ParentLayerIntRect::FromUnknownRect(actualBounds);
+    clipRect = actualBounds;
   }
 #if defined(MOZ_WIDGET_ANDROID)
   ScreenCoord offset = GetContentShiftForToolbar();
   ScopedCompositorRenderOffset scopedOffset(mCompositor->AsCompositorOGL(),
                                             ScreenPoint(0.0f, offset));
 #endif
 
   if (actualBounds.IsEmpty()) {
@@ -1023,43 +1021,42 @@ bool LayerManagerComposite::Render(const
     previousTarget = PushGroupForLayerEffects();
   } else {
     mTwoPassTmpTarget = nullptr;
   }
 
   // Render our layers.
   {
     Diagnostics::Record record(mRenderStartTime);
-    RootLayer()->Prepare(ViewAs<RenderTargetPixel>(
-        clipRect, PixelCastJustification::RenderTargetIsParentLayerForRoot));
+    RootLayer()->Prepare(RenderTargetIntRect::FromUnknownRect(clipRect));
     if (record.Recording()) {
       mDiagnostics->RecordPrepareTime(record.Duration());
     }
   }
   // Execute draw commands.
   {
     Diagnostics::Record record;
-    RootLayer()->RenderLayer(clipRect.ToUnknownRect(), Nothing());
+    RootLayer()->RenderLayer(clipRect, Nothing());
     if (record.Recording()) {
       mDiagnostics->RecordCompositeTime(record.Duration());
     }
   }
   RootLayer()->Cleanup();
 
   if (!mRegionToClear.IsEmpty()) {
     for (auto iter = mRegionToClear.RectIter(); !iter.Done(); iter.Next()) {
       const IntRect& r = iter.Get();
       mCompositor->ClearRect(Rect(r.X(), r.Y(), r.Width(), r.Height()));
     }
   }
 
   if (mTwoPassTmpTarget) {
     MOZ_ASSERT(haveLayerEffects);
-    PopGroupForLayerEffects(previousTarget, clipRect.ToUnknownRect(),
-                            grayscaleVal, invertVal, contrastVal);
+    PopGroupForLayerEffects(previousTarget, clipRect, grayscaleVal, invertVal,
+                            contrastVal);
   }
 
   // Allow widget to render a custom foreground.
   mCompositor->GetWidget()->DrawWindowOverlay(
       &widgetContext, LayoutDeviceIntRect::FromUnknownRect(actualBounds));
 
   mCompositor->NormalDrawingDone();