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

Unified Diff: include/core/SkFixed.h

Issue 349663005: always use 64 bit long for fixed mul (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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 | « gyp/common_conditions.gypi ('k') | include/core/SkPostConfig.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkFixed.h
diff --git a/include/core/SkFixed.h b/include/core/SkFixed.h
index 6f168c8edd9ed0c31d417a5368ac84ee684ee0ec..2220a189a450293e00412882d9d5484236812e1f 100644
--- a/include/core/SkFixed.h
+++ b/include/core/SkFixed.h
@@ -78,8 +78,6 @@ typedef int32_t SkFixed;
#define SkFixedAbs(x) SkAbs32(x)
#define SkFixedAve(a, b) (((a) + (b)) >> 1)
-SkFixed SkFixedMul_portable(SkFixed, SkFixed);
-
#define SkFixedDiv(numer, denom) SkDivBits(numer, denom, 16)
///////////////////////////////////////////////////////////////////////////////
@@ -94,17 +92,16 @@ static inline SkFixed SkFixedCos(SkFixed radians) {
return cosValue;
}
+inline SkFixed SkFixedMul_longlong(SkFixed a, SkFixed b)
+{
+ return (SkFixed)((int64_t)a * b >> 16);
+}
+
+#define SkFixedMul(a,b) SkFixedMul_longlong(a,b)
+
//////////////////////////////////////////////////////////////////////////////////////////////////////
// Now look for ASM overrides for our portable versions (should consider putting this in its own file)
-#ifdef SkLONGLONG
- inline SkFixed SkFixedMul_longlong(SkFixed a, SkFixed b)
- {
- return (SkFixed)((int64_t)a * b >> 16);
- }
- #define SkFixedMul(a,b) SkFixedMul_longlong(a,b)
-#endif
-
#if defined(SK_CPU_ARM32)
/* This guy does not handle NaN or other obscurities, but is faster than
than (int)(x*65536). When built on Android with -Os, needs forcing
@@ -146,10 +143,6 @@ static inline SkFixed SkFixedCos(SkFixed radians) {
#define SkFloatToFixed(x) SkFloatToFixed_arm(x)
#endif
-#ifndef SkFixedMul
- #define SkFixedMul(x, y) SkFixedMul_portable(x, y)
-#endif
-
///////////////////////////////////////////////////////////////////////////////
typedef int64_t SkFixed48;
« no previous file with comments | « gyp/common_conditions.gypi ('k') | include/core/SkPostConfig.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698