diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-27 13:41:02 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-27 13:41:02 +0000 |
commit | 1a5e51f94ed8cb01600184119e52bb64bdb3dccc (patch) | |
tree | bae5a6b6820a519e349a943625e063ea949d7bff /include/core | |
parent | e8989578cd05d4bf6ebe35f0d49afbc3d3bef2ed (diff) |
remove SkScalarMul from public headers
BUG=skia:
Review URL: https://codereview.chromium.org/132453008
git-svn-id: http://skia.googlecode.com/svn/trunk@13189 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkPoint.h | 6 | ||||
-rw-r--r-- | include/core/SkScalar.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/include/core/SkPoint.h b/include/core/SkPoint.h index caf26507ff..5dd331a14c 100644 --- a/include/core/SkPoint.h +++ b/include/core/SkPoint.h @@ -411,13 +411,13 @@ struct SK_API SkPoint { /** Returns the dot product of a and b, treating them as 2D vectors */ static SkScalar DotProduct(const SkPoint& a, const SkPoint& b) { - return SkScalarMul(a.fX, b.fX) + SkScalarMul(a.fY, b.fY); + return a.fX * b.fX + a.fY * b.fY; } /** Returns the cross product of a and b, treating them as 2D vectors */ static SkScalar CrossProduct(const SkPoint& a, const SkPoint& b) { - return SkScalarMul(a.fX, b.fY) - SkScalarMul(a.fY, b.fX); + return a.fX * b.fY - a.fY * b.fX; } SkScalar cross(const SkPoint& vec) const { @@ -435,7 +435,7 @@ struct SK_API SkPoint { SkScalar distanceToSqd(const SkPoint& pt) const { SkScalar dx = fX - pt.fX; SkScalar dy = fY - pt.fY; - return SkScalarMul(dx, dx) + SkScalarMul(dy, dy); + return dx * dx + dy * dy; } /** diff --git a/include/core/SkScalar.h b/include/core/SkScalar.h index 4e0d91b2b7..b9256badb4 100644 --- a/include/core/SkScalar.h +++ b/include/core/SkScalar.h @@ -202,7 +202,7 @@ static inline bool SkScalarNearlyEqual(SkScalar x, SkScalar y, */ static inline SkScalar SkScalarInterp(SkScalar A, SkScalar B, SkScalar t) { SkASSERT(t >= 0 && t <= SK_Scalar1); - return A + SkScalarMul(B - A, t); + return A + (B - A) * t; } /** Interpolate along the function described by (keys[length], values[length]) |