Bug 1165900 - Make MaybeSnapToDevicePixels return a boolean to indicate whether snapping occurred. r=Bas
authorJonathan Watt <jwatt@jwatt.org>
Wed, 06 May 2015 14:43:56 +0100
changeset 265188 61455ff4e6ef91611424e9a669aba8fab8b629fc
parent 265187 5a0278cd85f06e552721cf7806a69705e080744e
child 265189 bbee8cb95f97d1a44a6eb4f47f8b0c406495a29d
push id2102
push usermartin.thomson@gmail.com
push dateMon, 18 May 2015 17:35:37 +0000
reviewersBas
bugs1165900
milestone41.0a1
Bug 1165900 - Make MaybeSnapToDevicePixels return a boolean to indicate whether snapping occurred. r=Bas
gfx/2d/PathHelpers.h
--- a/gfx/2d/PathHelpers.h
+++ b/gfx/2d/PathHelpers.h
@@ -356,25 +356,27 @@ inline bool UserToDevicePixelSnapped(Rec
 
   return false;
 }
 
 /**
  * This function has the same behavior as UserToDevicePixelSnapped except that
  * aRect is not transformed to device space.
  */
-inline void MaybeSnapToDevicePixels(Rect& aRect, const DrawTarget& aDrawTarget,
+inline bool MaybeSnapToDevicePixels(Rect& aRect, const DrawTarget& aDrawTarget,
                                     bool aAllowScaleOr90DegreeRotate = false)
 {
   if (UserToDevicePixelSnapped(aRect, aDrawTarget,
                                aAllowScaleOr90DegreeRotate)) {
     // Since UserToDevicePixelSnapped returned true we know there is no
     // rotation/skew in 'mat', so we can just use TransformBounds() here.
     Matrix mat = aDrawTarget.GetTransform();
     mat.Invert();
     aRect = mat.TransformBounds(aRect);
+    return true;
   }
+  return false;
 }
 
 } // namespace gfx
 } // namespace mozilla
 
 #endif /* MOZILLA_GFX_PATHHELPERS_H_ */