Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(332)

Unified Diff: include/effects/SkLightingImageFilter.h

Issue 132453008: remove SkScalarMul from public headers (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkScalar.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/effects/SkLightingImageFilter.h
diff --git a/include/effects/SkLightingImageFilter.h b/include/effects/SkLightingImageFilter.h
index 529ae9d620a13743d81c07cda57a9716d27215e2..b3fb7d0a0ed3e2b1d24b03aa8e97e15122e5169d 100644
--- a/include/effects/SkLightingImageFilter.h
+++ b/include/effects/SkLightingImageFilter.h
@@ -5,7 +5,6 @@
* found in the LICENSE file.
*/
-
#ifndef SkLightingImageFilter_DEFINED
#define SkLightingImageFilter_DEFINED
@@ -18,9 +17,7 @@ public:
SkPoint3(SkScalar x, SkScalar y, SkScalar z)
: fX(x), fY(y), fZ(z) {}
SkScalar dot(const SkPoint3& other) const {
- return SkScalarMul(fX, other.fX)
- + SkScalarMul(fY, other.fY)
- + SkScalarMul(fZ, other.fZ);
+ return fX * other.fX + fY * other.fY + fZ * other.fZ;
}
SkScalar maxComponent() const {
return fX > fY ? (fX > fZ ? fX : fZ) : (fY > fZ ? fY : fZ);
@@ -28,14 +25,12 @@ public:
void normalize() {
// Small epsilon is added to prevent division by 0.
SkScalar scale = SkScalarInvert(SkScalarSqrt(dot(*this)) + SK_ScalarNearlyZero);
- fX = SkScalarMul(fX, scale);
- fY = SkScalarMul(fY, scale);
- fZ = SkScalarMul(fZ, scale);
+ fX = fX * scale;
+ fY = fY * scale;
+ fZ = fZ * scale;
}
SkPoint3 operator*(SkScalar scalar) const {
- return SkPoint3(SkScalarMul(fX, scalar),
- SkScalarMul(fY, scalar),
- SkScalarMul(fZ, scalar));
+ return SkPoint3(fX * scalar, fY * scalar, fZ * scalar);
}
SkPoint3 operator-(const SkPoint3& other) const {
return SkPoint3(fX - other.fX, fY - other.fY, fZ - other.fZ);
« no previous file with comments | « include/core/SkScalar.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698