diff options
author | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2010-02-09 18:30:59 +0000 |
---|---|---|
committer | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2010-02-09 18:30:59 +0000 |
commit | eebf5cb6c0f5ed2630de2e7712d61b4ec1d49015 (patch) | |
tree | 291354b16917cd7810ca63fcfd1885c3d5419c93 /include/core/SkScalar.h | |
parent | d3aa4ff7a564953dff9a15ff03fd42eebf64569f (diff) |
add copysign for ints and floats
fix addArc to not wrap around if the sweepAngle is close to 360 but lost
precision when convert to radians (and then to unit vectors ala sin/cos)
git-svn-id: http://skia.googlecode.com/svn/trunk@495 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkScalar.h')
-rw-r--r-- | include/core/SkScalar.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/core/SkScalar.h b/include/core/SkScalar.h index 5be809f9e3..9130a7cf12 100644 --- a/include/core/SkScalar.h +++ b/include/core/SkScalar.h @@ -91,6 +91,9 @@ /** Returns the absolute value of the specified SkScalar */ #define SkScalarAbs(x) sk_float_abs(x) + /** Return x with the sign of y + */ + #define SkScalarCopySign(x, y) sk_float_copysign(x, y) /** Returns the value pinned between 0 and max inclusive */ inline SkScalar SkScalarClampMax(SkScalar x, SkScalar max) { @@ -189,6 +192,7 @@ #define SkScalarCeil(x) SkFixedCeil(x) #define SkScalarFloor(x) SkFixedFloor(x) #define SkScalarAbs(x) SkFixedAbs(x) + #define SkScalarCopySign(x, y) SkCopySign32(x, y) #define SkScalarClampMax(x, max) SkClampMax(x, max) #define SkScalarPin(x, min, max) SkPin32(x, min, max) #define SkScalarSquare(x) SkFixedSquare(x) |