Bug 1407654. Inline ToRelativeLayoutPoint. r=kats
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Wed, 11 Oct 2017 11:44:41 -0400
changeset 385581 22f087c0c507625ff48b762d752bd55ca91bccc7
parent 385580 e0c112aed854cc1a44cb5a00553debf85ab74ed0
child 385582 c801b23bbf1a434a958b5db5a48bed772b5af2e3
push id32662
push userryanvm@gmail.com
push dateWed, 11 Oct 2017 21:53:47 +0000
treeherdermozilla-central@3d918ff5d634 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1407654
milestone58.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 1407654. Inline ToRelativeLayoutPoint. r=kats This is a very short function and is showing up in profiles because it's used inside of a hot loop while we're constructing glyph runs.
gfx/layers/wr/StackingContextHelper.cpp
gfx/layers/wr/StackingContextHelper.h
--- a/gfx/layers/wr/StackingContextHelper.cpp
+++ b/gfx/layers/wr/StackingContextHelper.cpp
@@ -74,16 +74,10 @@ StackingContextHelper::ToRelativeLayoutR
 
 wr::LayoutRect
 StackingContextHelper::ToRelativeLayoutRect(const LayoutDeviceRect& aRect) const
 {
   return wr::ToLayoutRect(RoundedToInt(ViewAs<LayerPixel>(aRect,
                                                           PixelCastJustification::WebRenderHasUnitResolution) - mOrigin));
 }
 
-wr::LayoutPoint
-StackingContextHelper::ToRelativeLayoutPoint(const LayerPoint& aPoint) const
-{
-  return wr::ToLayoutPoint(aPoint - mOrigin);
-}
-
 } // namespace layers
 } // namespace mozilla
--- a/gfx/layers/wr/StackingContextHelper.h
+++ b/gfx/layers/wr/StackingContextHelper.h
@@ -57,17 +57,21 @@ public:
   // We allow passing in a LayoutDeviceRect for convenience because in a lot of
   // cases with WebRender display item generate the layout device space is the
   // same as the layer space. (TODO: try to make this more explicit somehow).
   // We also round the rectangle to ints after transforming since the output
   // is the final destination rect.
   wr::LayoutRect ToRelativeLayoutRect(const LayerRect& aRect) const;
   wr::LayoutRect ToRelativeLayoutRect(const LayoutDeviceRect& aRect) const;
   // Same but for points
-  wr::LayoutPoint ToRelativeLayoutPoint(const LayerPoint& aPoint) const;
+  wr::LayoutPoint ToRelativeLayoutPoint(const LayerPoint& aPoint) const
+  {
+    return wr::ToLayoutPoint(aPoint - mOrigin);
+  }
+
 
   // Export the inherited scale
   gfx::Size GetInheritedScale() const { return mScale; }
 
   bool IsBackfaceVisible() const { return mTransform.IsBackfaceVisible(); }
 
 private:
   wr::DisplayListBuilder* mBuilder;