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

Unified Diff: src/animator/SkDrawGradient.cpp

Issue 117053002: remove SK_SCALAR_IS_[FLOAT,FIXED] and assume floats (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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
Index: src/animator/SkDrawGradient.cpp
diff --git a/src/animator/SkDrawGradient.cpp b/src/animator/SkDrawGradient.cpp
index 44086e4269d9b85ab7029a706f0392bbff159da6..1b158f23c108a273c4bbe505b345a70d85af1361 100644
--- a/src/animator/SkDrawGradient.cpp
+++ b/src/animator/SkDrawGradient.cpp
@@ -14,20 +14,12 @@
#include "SkUnitMapper.h"
static SkScalar SkUnitToScalar(U16CPU x) {
-#ifdef SK_SCALAR_IS_FLOAT
return x / 65535.0f;
-#else
- return x + (x >> 8);
-#endif
}
static U16CPU SkScalarToUnit(SkScalar x) {
SkScalar pin = SkScalarPin(x, 0, SK_Scalar1);
-#ifdef SK_SCALAR_IS_FLOAT
return (int) (pin * 65535.0f);
-#else
- return pin - (pin >= 32768);
-#endif
}
class SkDrawGradientUnitMapper : public SkUnitMapper {
« no previous file with comments | « src/animator/SkDrawColor.cpp ('k') | src/animator/SkScript.cpp » ('j') | src/core/SkCanvas.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698