Bug 1359842 - Remove a bunch of now unused functions. r?nical draft
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 26 Apr 2017 16:37:17 -0400
changeset 568976 6614a1e8f1419d653c9b3e0c635702fd85b2e6f6
parent 568975 d2ee3c4f7d03db2c63d3440ccfe627270c0ed916
child 626077 91edd8c33b29506811164390ae0b0cfa1b86864d
push id56034
push userkgupta@mozilla.com
push dateWed, 26 Apr 2017 20:37:45 +0000
reviewersnical
bugs1359842
milestone55.0a1
Bug 1359842 - Remove a bunch of now unused functions. r?nical MozReview-Commit-ID: HeIXvHl41IZ
gfx/layers/wr/WebRenderLayer.cpp
gfx/layers/wr/WebRenderLayer.h
--- a/gfx/layers/wr/WebRenderLayer.cpp
+++ b/gfx/layers/wr/WebRenderLayer.cpp
@@ -36,22 +36,16 @@ WebRenderLayer::GetImageKey()
 {
   WrImageKey key;
   key.mNamespace = WrBridge()->GetNamespace();
   key.mHandle = WrBridge()->GetNextResourceId();
   return key;
 }
 
 LayerRect
-WebRenderLayer::RelativeToVisible(const LayerRect& aRect)
-{
-  return aRect - Bounds().TopLeft();
-}
-
-LayerRect
 WebRenderLayer::ParentBounds()
 {
   // 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();
@@ -71,22 +65,16 @@ WebRenderLayer::RelativeToParent(const L
 }
 
 LayerPoint
 WebRenderLayer::GetOffsetToParent()
 {
   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 - ParentBounds().ToUnknownRect().TopLeft();
 }
 
@@ -108,34 +96,16 @@ WebRenderLayer::BuildWrMaskLayer(bool aU
 
     return maskLayer->RenderMaskLayer(transform);
   }
 
   return Nothing();
 }
 
 LayerRect
-WebRenderLayer::GetWrBoundsRect()
-{
-  LayerRect bounds = Bounds();
-  bounds.MoveTo(0, 0);
-  return bounds;
-}
-
-LayerRect
-WebRenderLayer::GetWrClipRect(const LayerRect& aRect)
-{
-  Maybe<LayerRect> clip = ClipRect();
-  if (clip) {
-    return RelativeToVisible(clip.ref());
-  }
-  return aRect;
-}
-
-LayerRect
 WebRenderLayer::Bounds()
 {
   return LayerRect(GetLayer()->GetVisibleRegion().GetBounds());
 }
 
 BoundsTransformMatrix
 WebRenderLayer::BoundsTransform()
 {
@@ -166,22 +136,16 @@ WebRenderLayer::ClipRect()
   if (!layer->GetClipRect()) {
     return Nothing();
   }
   ParentLayerRect clip(layer->GetClipRect().ref());
   LayerToParentLayerMatrix4x4 transform = layer->GetLocalTransformTyped();
   return Some(transform.Inverse().TransformBounds(clip));
 }
 
-LayerRect
-WebRenderLayer::GetWrRelBounds()
-{
-  return RelativeToParent(BoundsForStackingContext());
-}
-
 Maybe<wr::ImageKey>
 WebRenderLayer::UpdateImageKey(ImageClientSingle* aImageClient,
                                ImageContainer* aContainer,
                                Maybe<wr::ImageKey>& aOldKey,
                                wr::ExternalImageId& aExternalImageId)
 {
   MOZ_ASSERT(aImageClient);
   MOZ_ASSERT(aContainer);
@@ -215,26 +179,23 @@ WebRenderLayer::UpdateImageKey(ImageClie
 void
 WebRenderLayer::DumpLayerInfo(const char* aLayerType, const LayerRect& aRect)
 {
   if (!gfxPrefs::LayersDump()) {
     return;
   }
 
   Matrix4x4 transform = GetLayer()->GetTransform();
-  LayerRect clip = GetWrClipRect(aRect);
-  LayerRect relBounds = GetWrRelBounds();
-  Rect overflow(0, 0, relBounds.width, relBounds.height);
+  LayerRect bounds = Bounds();
   WrMixBlendMode mixBlendMode = wr::ToWrMixBlendMode(GetLayer()->GetMixBlendMode());
 
-  printf_stderr("%s %p using bounds=%s, overflow=%s, transform=%s, rect=%s, clip=%s, mix-blend-mode=%s\n",
+  printf_stderr("%s %p using bounds=%s, transform=%s, rect=%s, clip=%s, mix-blend-mode=%s\n",
                 aLayerType,
                 GetLayer(),
-                Stringify(relBounds).c_str(),
-                Stringify(overflow).c_str(),
+                Stringify(bounds).c_str(),
                 Stringify(transform).c_str(),
                 Stringify(aRect).c_str(),
-                Stringify(clip).c_str(),
+                Stringify(ClipRect().valueOr(aRect)).c_str(),
                 Stringify(mixBlendMode).c_str());
 }
 
 } // namespace layers
 } // namespace mozilla
--- a/gfx/layers/wr/WebRenderLayer.h
+++ b/gfx/layers/wr/WebRenderLayer.h
@@ -41,33 +41,29 @@ public:
                                      ImageContainer* aContainer,
                                      Maybe<wr::ImageKey>& aOldKey,
                                      wr::ExternalImageId& aExternalImageId);
 
   WebRenderLayerManager* WrManager();
   WebRenderBridgeChild* WrBridge();
   WrImageKey GetImageKey();
 
-  LayerRect RelativeToVisible(const LayerRect& aRect);
   LayerRect RelativeToParent(const LayerRect& aRect);
   LayerRect RelativeToParent(const LayoutDeviceRect& aRect);
-  LayerRect VisibleBoundsRelativeToParent();
   LayerPoint GetOffsetToParent();
-  gfx::Rect TransformedVisibleBoundsRelativeToParent();
 
   LayerRect Bounds();
   LayerRect BoundsForStackingContext();
 protected:
   BoundsTransformMatrix BoundsTransform();
   LayerRect ParentBounds();
   Maybe<LayerRect> ClipRect();
 
-  LayerRect GetWrBoundsRect();
-  LayerRect GetWrRelBounds();
-  LayerRect GetWrClipRect(const LayerRect& aRect);
+  gfx::Rect TransformedVisibleBoundsRelativeToParent();
+
   void DumpLayerInfo(const char* aLayerType, const LayerRect& aRect);
   Maybe<WrImageMask> BuildWrMaskLayer(bool aUnapplyLayerTransform);
 };
 
 } // namespace layers
 } // namespace mozilla
 
 #endif /* GFX_WEBRENDERLAYER_H */