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

Unified Diff: include/core/SkFixed.h

Issue 119353003: Revert "Revert "begin to remove SkLONGLONG and wean Skia off of Sk64"" (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 | « include/core/Sk64.h ('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 580d94b9ca2f813fa3bde204db59e20dbf273cea..e63794e862f2552359fb48e312b1c628cd7f1e42 100644
--- a/include/core/SkFixed.h
+++ b/include/core/SkFixed.h
@@ -86,17 +86,6 @@ typedef int32_t SkFixed;
#define SkFixedAve(a, b) (((a) + (b)) >> 1)
SkFixed SkFixedMul_portable(SkFixed, SkFixed);
-inline SkFixed SkFixedSquare_portable(SkFixed value)
-{
- uint32_t a = SkAbs32(value);
- uint32_t ah = a >> 16;
- uint32_t al = a & 0xFFFF;
- SkFixed result = ah * a + al * ah + (al * al >> 16);
- if (result >= 0)
- return result;
- else // Overflow.
- return SK_FixedMax;
-}
#define SkFixedDiv(numer, denom) SkDivBits(numer, denom, 16)
@@ -118,14 +107,9 @@ static inline SkFixed SkFixedCos(SkFixed radians) {
#ifdef SkLONGLONG
inline SkFixed SkFixedMul_longlong(SkFixed a, SkFixed b)
{
- return (SkFixed)((SkLONGLONG)a * b >> 16);
- }
- inline SkFixed SkFixedSquare_longlong(SkFixed value)
- {
- return (SkFixed)((SkLONGLONG)value * value >> 16);
+ return (SkFixed)((int64_t)a * b >> 16);
}
#define SkFixedMul(a,b) SkFixedMul_longlong(a,b)
- #define SkFixedSquare(a) SkFixedSquare_longlong(a)
#endif
#if defined(SK_CPU_ARM)
« no previous file with comments | « include/core/Sk64.h ('k') | include/core/SkPostConfig.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698