Bug 1396489 - Part 1. Change gfxContext::GetClipExtents to a const function. r=mstange
☠☠ backed out by 6106d550ba96 ☠ ☠
authorcku <cku@mozilla.com>
Mon, 04 Sep 2017 12:56:13 +0800
changeset 428304 dcfd73044bbabcfd43d767282a111c3d2cd45863
parent 428303 a7e16582c59b49efddc4b197637541fbb5317fc6
child 428305 fc779b639aebd3687932a61748384648a5426eaf
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1396489
milestone57.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 1396489 - Part 1. Change gfxContext::GetClipExtents to a const function. r=mstange MozReview-Commit-ID: ANFDAxeL5G0
gfx/thebes/gfxContext.cpp
gfx/thebes/gfxContext.h
--- a/gfx/thebes/gfxContext.cpp
+++ b/gfx/thebes/gfxContext.cpp
@@ -590,17 +590,17 @@ gfxContext::PopClip()
 {
   MOZ_ASSERT(CurrentState().pushedClips.Length() > 0);
 
   CurrentState().pushedClips.RemoveElementAt(CurrentState().pushedClips.Length() - 1);
   mDT->PopClip();
 }
 
 gfxRect
-gfxContext::GetClipExtents()
+gfxContext::GetClipExtents() const
 {
   Rect rect = GetAzureDeviceSpaceClipBounds();
 
   if (rect.width == 0 || rect.height == 0) {
     return gfxRect(0, 0, 0, 0);
   }
 
   Matrix mat = mTransform;
@@ -1057,23 +1057,23 @@ gfxContext::ChangeTransform(const Matrix
   }
 
   mTransform = aNewMatrix;
 
   mDT->SetTransform(GetDTTransform());
 }
 
 Rect
-gfxContext::GetAzureDeviceSpaceClipBounds()
+gfxContext::GetAzureDeviceSpaceClipBounds() const
 {
   Rect rect(CurrentState().deviceOffset.x, CurrentState().deviceOffset.y,
             Float(mDT->GetSize().width), Float(mDT->GetSize().height));
   for (unsigned int i = 0; i < mStateStack.Length(); i++) {
     for (unsigned int c = 0; c < mStateStack[i].pushedClips.Length(); c++) {
-      AzureState::PushedClip &clip = mStateStack[i].pushedClips[c];
+      const AzureState::PushedClip &clip = mStateStack[i].pushedClips[c];
       if (clip.path) {
         Rect bounds = clip.path->GetBounds(clip.transform);
         rect.IntersectRect(rect, bounds);
       } else {
         rect.IntersectRect(rect, clip.transform.TransformBounds(clip.rect));
       }
     }
   }
--- a/gfx/thebes/gfxContext.h
+++ b/gfx/thebes/gfxContext.h
@@ -376,17 +376,17 @@ public:
     void Clip(Path* aPath);
 
     void PopClip();
 
     /**
      * This will return the current bounds of the clip region in user
      * space.
      */
-    gfxRect GetClipExtents();
+    gfxRect GetClipExtents() const;
 
     /**
      * Returns true if the given rectangle is fully contained in the current clip.
      * This is conservative; it may return false even when the given rectangle is
      * fully contained by the current clip.
      */
     bool ClipContainsRect(const gfxRect& aRect);
 
@@ -514,17 +514,17 @@ private:
 
   // This ensures mPath contains a valid path (in user space!)
   void EnsurePath();
   // This ensures mPathBuilder contains a valid PathBuilder (in user space!)
   void EnsurePathBuilder();
   void FillAzure(const Pattern& aPattern, mozilla::gfx::Float aOpacity);
   CompositionOp GetOp();
   void ChangeTransform(const mozilla::gfx::Matrix &aNewMatrix, bool aUpdatePatternTransform = true);
-  Rect GetAzureDeviceSpaceClipBounds();
+  Rect GetAzureDeviceSpaceClipBounds() const;
   Matrix GetDeviceTransform() const;
   Matrix GetDTTransform() const;
 
   bool mPathIsRect;
   bool mTransformChanged;
   Matrix mPathTransform;
   Rect mRect;
   RefPtr<PathBuilder> mPathBuilder;