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

Unified Diff: include/private/SkFixed.h

Issue 2433233003: Make SkFixedRound/Ceil/FloorToFixed as inline func (Closed)
Patch Set: Remove one more bracket Created 4 years, 2 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 | « no previous file | tests/MathTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/private/SkFixed.h
diff --git a/include/private/SkFixed.h b/include/private/SkFixed.h
index be3bb5d6045d9b24fd98096295b3385be409d5d3..cdde0930073d3136eeb7be1be55186494432e0f0 100644
--- a/include/private/SkFixed.h
+++ b/include/private/SkFixed.h
@@ -69,9 +69,15 @@ typedef int32_t SkFixed;
#define SkFixedCeilToInt(x) (((x) + SK_Fixed1 - 1) >> 16)
#define SkFixedFloorToInt(x) ((x) >> 16)
-#define SkFixedRoundToFixed(x) (((x) + SK_FixedHalf) & 0xFFFF0000)
-#define SkFixedCeilToFixed(x) (((x) + SK_Fixed1 - 1) & 0xFFFF0000)
-#define SkFixedFloorToFixed(x) ((x) & 0xFFFF0000)
+static inline SkFixed SkFixedRoundToFixed(SkFixed x) {
+ return (x + SK_FixedHalf) & 0xFFFF0000;
+}
+static inline SkFixed SkFixedCeilToFixed(SkFixed x) {
+ return (x + SK_Fixed1 - 1) & 0xFFFF0000;
+}
+static inline SkFixed SkFixedFloorToFixed(SkFixed x) {
+ return x & 0xFFFF0000;
+}
#define SkFixedAbs(x) SkAbs32(x)
#define SkFixedAve(a, b) (((a) + (b)) >> 1)
« no previous file with comments | « no previous file | tests/MathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698