Bug 1355193 - Stop looking for a parent stacking context in the scroll metadata. r=mchang
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 10 Apr 2017 18:49:12 -0400
changeset 352771 9c83023e46b0f108d068a77590b257db80cc0a1f
parent 352770 f8c97e12c904f86ca47caede00abc6215c307df9
child 352772 21f24184f48311489c873aa65a2ff5aab61d7b34
push id31651
push userkwierso@gmail.com
push dateThu, 13 Apr 2017 17:42:52 +0000
treeherdermozilla-central@8dd662ed3387 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmchang
bugs1355193
milestone55.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 1355193 - Stop looking for a parent stacking context in the scroll metadata. r=mchang MozReview-Commit-ID: A2VjaUohUxh
gfx/layers/wr/WebRenderLayerManager.cpp
gfx/layers/wr/WebRenderLayerManager.h
--- a/gfx/layers/wr/WebRenderLayerManager.cpp
+++ b/gfx/layers/wr/WebRenderLayerManager.cpp
@@ -56,45 +56,40 @@ WebRenderLayer::RelativeToTransformedVis
 {
   IntRect bounds = GetLayer()->GetVisibleRegion().GetBounds().ToUnknownRect();
   Rect transformed = GetLayer()->GetTransform().TransformBounds(IntRectToRect(bounds));
   aRect.MoveBy(-transformed.x, -transformed.y);
   return aRect;
 }
 
 Rect
-WebRenderLayer::ParentStackingContextBounds(size_t aScrollMetadataIndex)
+WebRenderLayer::ParentStackingContextBounds()
 {
   // Walk up to find the parent stacking context. This will be created either
   // by the nearest scrollable metrics, or by the parent layer which must be a
   // ContainerLayer.
   Layer* layer = GetLayer();
-  for (size_t i = aScrollMetadataIndex + 1; i < layer->GetScrollMetadataCount(); i++) {
-    if (layer->GetFrameMetrics(i).IsScrollable()) {
-      return layer->GetFrameMetrics(i).GetCompositionBounds().ToUnknownRect();
-    }
-  }
   if (layer->GetParent()) {
     return IntRectToRect(layer->GetParent()->GetVisibleRegion().GetBounds().ToUnknownRect());
   }
   return Rect();
 }
 
 Rect
 WebRenderLayer::RelativeToParent(Rect aRect)
 {
-  Rect parentBounds = ParentStackingContextBounds(-1);
+  Rect parentBounds = ParentStackingContextBounds();
   aRect.MoveBy(-parentBounds.x, -parentBounds.y);
   return aRect;
 }
 
 Point
 WebRenderLayer::GetOffsetToParent()
 {
-  Rect parentBounds = ParentStackingContextBounds(-1);
+  Rect parentBounds = ParentStackingContextBounds();
   return parentBounds.TopLeft();
 }
 
 Rect
 WebRenderLayer::VisibleBoundsRelativeToParent()
 {
   return RelativeToParent(IntRectToRect(GetLayer()->GetVisibleRegion().GetBounds().ToUnknownRect()));
 }
--- a/gfx/layers/wr/WebRenderLayerManager.h
+++ b/gfx/layers/wr/WebRenderLayerManager.h
@@ -43,17 +43,17 @@ public:
     return static_cast<WebRenderLayer*>(aLayer->ImplData());
   }
 
   WebRenderLayerManager* WrManager();
   WebRenderBridgeChild* WrBridge();
 
   gfx::Rect RelativeToVisible(gfx::Rect aRect);
   gfx::Rect RelativeToTransformedVisible(gfx::Rect aRect);
-  gfx::Rect ParentStackingContextBounds(size_t aScrollMetadataIndex);
+  gfx::Rect ParentStackingContextBounds();
   gfx::Rect RelativeToParent(gfx::Rect aRect);
   gfx::Rect VisibleBoundsRelativeToParent();
   gfx::Point GetOffsetToParent();
   gfx::Rect TransformedVisibleBoundsRelativeToParent();
 protected:
   gfx::Rect GetWrBoundsRect();
   gfx::Rect GetWrRelBounds();
   gfx::Rect GetWrClipRect(gfx::Rect& aRect);