Bug 1082530, part 5 - remove the variant of Moz2D's UserToDevicePixelSnapped that takes a Matrix argument instead of a DrawTarget argument. r=mattwoodrow

This commit is contained in:
Jonathan Watt 2014-10-19 10:22:47 +01:00
parent 71c5fdb910
commit bf1e0353fb

View File

@ -197,10 +197,14 @@ extern UserDataKey sDisablePixelSnapping;
* stroke width then the edges of the stroke will be antialiased (assuming an
* AntialiasMode that does antialiasing).
*/
inline bool UserToDevicePixelSnapped(Rect& aRect, const Matrix& aTransform,
inline bool UserToDevicePixelSnapped(Rect& aRect, const DrawTarget& aDrawTarget,
bool aAllowScaleOr90DegreeRotate = false)
{
Matrix mat = aTransform;
if (aDrawTarget.GetUserData(&sDisablePixelSnapping)) {
return false;
}
Matrix mat = aDrawTarget.GetTransform();
const Float epsilon = 0.0000001f;
#define WITHIN_E(a,b) (fabs((a)-(b)) < epsilon)
@ -235,15 +239,6 @@ inline bool UserToDevicePixelSnapped(Rect& aRect, const Matrix& aTransform,
return false;
}
inline bool UserToDevicePixelSnapped(Rect& aRect, const DrawTarget& aDrawTarget,
bool aIgnoreScale = false)
{
if (aDrawTarget.GetUserData(&sDisablePixelSnapping)) {
return false;
}
return UserToDevicePixelSnapped(aRect, aDrawTarget.GetTransform());
}
/**
* This function has the same behavior as UserToDevicePixelSnapped except that
* aRect is not transformed to device space.