Bug 1359842 - Rename ParentStackingContextBounds to ParentBounds. r=nical draft
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 26 Apr 2017 16:37:16 -0400
changeset 568972 5b30cbc2c96f4f76afc478551b3d6453c95d0f77
parent 568971 5151e0e158035590f841ee12a48ab93eb2128c9c
child 568973 fca7f45a1451d0bc8bea569642a1e144fbdb04f5
push id56034
push userkgupta@mozilla.com
push dateWed, 26 Apr 2017 20:37:45 +0000
reviewersnical
bugs1359842
milestone55.0a1
Bug 1359842 - Rename ParentStackingContextBounds to ParentBounds. r=nical MozReview-Commit-ID: HmvRnzvgRML
gfx/layers/wr/WebRenderLayer.cpp
gfx/layers/wr/WebRenderLayer.h
gfx/layers/wr/WebRenderTextLayer.cpp
--- a/gfx/layers/wr/WebRenderLayer.cpp
+++ b/gfx/layers/wr/WebRenderLayer.cpp
@@ -42,58 +42,57 @@ WebRenderLayer::GetImageKey()
 
 LayerRect
 WebRenderLayer::RelativeToVisible(const LayerRect& aRect)
 {
   return aRect - Bounds().TopLeft();
 }
 
 LayerRect
-WebRenderLayer::ParentStackingContextBounds()
+WebRenderLayer::ParentBounds()
 {
-  // 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.
+  // Walk up to find the parent stacking context. This will be created by the
+  // parent layer which must be a ContainerLayer if it exists.
   if (Layer* parent = GetLayer()->GetParent()) {
     return ToWebRenderLayer(parent)->Bounds();
   }
   return LayerRect();
 }
 
 LayerRect
 WebRenderLayer::RelativeToParent(const LayerRect& aRect)
 {
-  return aRect - ParentStackingContextBounds().TopLeft();
+  return aRect - ParentBounds().TopLeft();
 }
 
 LayerRect
 WebRenderLayer::RelativeToParent(const LayoutDeviceRect& aRect)
 {
   return RelativeToParent(ViewAs<LayerPixel>(
       aRect, PixelCastJustification::WebRenderHasUnitResolution));
 }
 
 LayerPoint
 WebRenderLayer::GetOffsetToParent()
 {
-  return ParentStackingContextBounds().TopLeft();
+  return ParentBounds().TopLeft();
 }
 
 LayerRect
 WebRenderLayer::VisibleBoundsRelativeToParent()
 {
   return RelativeToParent(Bounds());
 }
 
 gfx::Rect
 WebRenderLayer::TransformedVisibleBoundsRelativeToParent()
 {
   IntRect bounds = GetLayer()->GetVisibleRegion().GetBounds().ToUnknownRect();
   Rect transformed = GetLayer()->GetTransform().TransformBounds(IntRectToRect(bounds));
-  return transformed - ParentStackingContextBounds().ToUnknownRect().TopLeft();
+  return transformed - ParentBounds().ToUnknownRect().TopLeft();
 }
 
 Maybe<WrImageMask>
 WebRenderLayer::BuildWrMaskLayer(bool aUnapplyLayerTransform)
 {
   if (GetLayer()->GetMaskLayer()) {
     WebRenderLayer* maskLayer = ToWebRenderLayer(GetLayer()->GetMaskLayer());
 
--- a/gfx/layers/wr/WebRenderLayer.h
+++ b/gfx/layers/wr/WebRenderLayer.h
@@ -42,26 +42,26 @@ public:
                                      Maybe<wr::ImageKey>& aOldKey,
                                      wr::ExternalImageId& aExternalImageId);
 
   WebRenderLayerManager* WrManager();
   WebRenderBridgeChild* WrBridge();
   WrImageKey GetImageKey();
 
   LayerRect RelativeToVisible(const LayerRect& aRect);
-  LayerRect ParentStackingContextBounds();
   LayerRect RelativeToParent(const LayerRect& aRect);
   LayerRect RelativeToParent(const LayoutDeviceRect& aRect);
   LayerRect VisibleBoundsRelativeToParent();
   LayerPoint GetOffsetToParent();
   gfx::Rect TransformedVisibleBoundsRelativeToParent();
 protected:
   LayerRect Bounds();
   BoundsTransformMatrix BoundsTransform();
   LayerRect BoundsForStackingContext();
+  LayerRect ParentBounds();
   Maybe<LayerRect> ClipRect();
 
   LayerRect GetWrBoundsRect();
   LayerRect GetWrRelBounds();
   LayerRect GetWrClipRect(const LayerRect& aRect);
   void DumpLayerInfo(const char* aLayerType, const LayerRect& aRect);
   Maybe<WrImageMask> BuildWrMaskLayer(bool aUnapplyLayerTransform);
 };
--- a/gfx/layers/wr/WebRenderTextLayer.cpp
+++ b/gfx/layers/wr/WebRenderTextLayer.cpp
@@ -20,21 +20,21 @@ using namespace mozilla::gfx;
 void
 WebRenderTextLayer::RenderLayer(wr::DisplayListBuilder& aBuilder)
 {
     if (mBounds.IsEmpty()) {
         return;
     }
 
     gfx::Rect rect = GetTransform().TransformBounds(IntRectToRect(mBounds))
-        - ParentStackingContextBounds().ToUnknownRect().TopLeft();
+        - ParentBounds().ToUnknownRect().TopLeft();
     gfx::Rect clip;
     if (GetClipRect().isSome()) {
       clip = IntRectToRect(GetClipRect().ref().ToUnknownRect())
-          - ParentStackingContextBounds().ToUnknownRect().TopLeft();
+          - ParentBounds().ToUnknownRect().TopLeft();
     } else {
       clip = rect;
     }
 
     if (gfxPrefs::LayersDump()) {
         printf_stderr("TextLayer %p using rect=%s, clip=%s\n",
                       this->GetLayer(),
                       Stringify(rect).c_str(),