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

Unified Diff: include/core/SkScalar.h

Issue 111353003: deprecate SkScalarRound (and its ilk), use SkScalarRound[ToInt,ToScalar]. #define SK_SUPPORT_DEPREC… (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
« no previous file with comments | « experimental/SkiaExamples/SkExample.cpp ('k') | include/core/SkSize.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkScalar.h
diff --git a/include/core/SkScalar.h b/include/core/SkScalar.h
index 23e28cdc141f4653128cbfe80b8238be29e7632e..93677df06908f58027dc6cc14d37545e5ee2b30e 100644
--- a/include/core/SkScalar.h
+++ b/include/core/SkScalar.h
@@ -11,6 +11,8 @@
#include "SkFixed.h"
#include "SkFloatingPoint.h"
+//#define SK_SUPPORT_DEPRECATED_SCALARROUND
+
typedef float SkScalar;
/** SK_Scalar1 is defined to be 1.0 represented as an SkScalar
@@ -108,13 +110,13 @@ inline SkScalar SkScalarSquare(SkScalar x) { return x * x; }
#define SkScalarMulAdd(a, b, c) ((float)(a) * (b) + (c))
/** Returns the product of a SkScalar and an int rounded to the nearest integer value
*/
-#define SkScalarMulRound(a, b) SkScalarRound((float)(a) * (b))
+#define SkScalarMulRound(a, b) SkScalarRoundToInt((float)(a) * (b))
/** Returns the product of a SkScalar and an int promoted to the next larger int
*/
-#define SkScalarMulCeil(a, b) SkScalarCeil((float)(a) * (b))
+#define SkScalarMulCeil(a, b) SkScalarCeilToInt((float)(a) * (b))
/** Returns the product of a SkScalar and an int truncated to the next smaller int
*/
-#define SkScalarMulFloor(a, b) SkScalarFloor((float)(a) * (b))
+#define SkScalarMulFloor(a, b) SkScalarFloorToInt((float)(a) * (b))
/** Returns the quotient of two SkScalars (a/b)
*/
#define SkScalarDiv(a, b) ((float)(a) / (b))
@@ -168,9 +170,11 @@ static inline bool SkScalarIsInt(SkScalar x) {
}
// DEPRECATED : use ToInt or ToScalar variant
-#define SkScalarFloor(x) SkScalarFloorToInt(x)
-#define SkScalarCeil(x) SkScalarCeilToInt(x)
-#define SkScalarRound(x) SkScalarRoundToInt(x)
+#ifdef SK_SUPPORT_DEPRECATED_SCALARROUND
+# define SkScalarFloor(x) SkScalarFloorToInt(x)
+# define SkScalarCeil(x) SkScalarCeilToInt(x)
+# define SkScalarRound(x) SkScalarRoundToInt(x)
+#endif
/**
* Returns -1 || 0 || 1 depending on the sign of value:
« no previous file with comments | « experimental/SkiaExamples/SkExample.cpp ('k') | include/core/SkSize.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698