aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gyp/common_conditions.gypi1
-rw-r--r--include/core/SkFixed.h18
-rw-r--r--include/core/SkPostConfig.h12
-rw-r--r--src/core/SkMath.cpp21
-rwxr-xr-xsrc/gpu/GrDistanceFieldTextContext.cpp4
-rw-r--r--src/gpu/GrStencilAndCoverTextContext.cpp6
6 files changed, 10 insertions, 52 deletions
diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi
index b9c4e983bb..fe0243d1ac 100644
--- a/gyp/common_conditions.gypi
+++ b/gyp/common_conditions.gypi
@@ -407,7 +407,6 @@
# Optimizations for chromium (m30)
'GR_GL_CUSTOM_SETUP_HEADER "gl/GrGLConfig_chrome.h"',
'IGNORE_ROT_AA_RECT_OPT',
- 'SkLONGLONG int64_t',
'SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)',
'SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)',
'SK_IGNORE_ETC1_SUPPORT',
diff --git a/include/core/SkFixed.h b/include/core/SkFixed.h
index cde244efeb..8cf7a5679c 100644
--- a/include/core/SkFixed.h
+++ b/include/core/SkFixed.h
@@ -78,20 +78,16 @@ 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)
//////////////////////////////////////////////////////////////////////////////////////////////////////
// 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
+inline SkFixed SkFixedMul_longlong(SkFixed a, SkFixed b) {
+ return (SkFixed)((int64_t)a * b >> 16);
+}
+#define SkFixedMul(a,b) SkFixedMul_longlong(a,b)
+
#if defined(SK_CPU_ARM32)
/* This guy does not handle NaN or other obscurities, but is faster than
@@ -134,10 +130,6 @@ SkFixed SkFixedMul_portable(SkFixed, SkFixed);
#define SkFloatToFixed(x) SkFloatToFixed_arm(x)
#endif
-#ifndef SkFixedMul
- #define SkFixedMul(x, y) SkFixedMul_portable(x, y)
-#endif
-
///////////////////////////////////////////////////////////////////////////////
typedef int64_t SkFixed3232; // 32.32
diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h
index cf111af37c..d08f68a1d9 100644
--- a/include/core/SkPostConfig.h
+++ b/include/core/SkPostConfig.h
@@ -232,18 +232,6 @@
SK_ ## C3 ## 32_SHIFT == 24)
#endif
-//////////////////////////////////////////////////////////////////////
-
-// TODO: rebaseline as needed so we can remove this flag entirely.
-// - all platforms have int64_t now
-// - we have slightly different fixed math results because of this check
-// since we don't define this for linux/android
-#if defined(SK_BUILD_FOR_WIN32) || defined(SK_BUILD_FOR_MAC)
-# ifndef SkLONGLONG
-# define SkLONGLONG int64_t
-# endif
-#endif
-
//////////////////////////////////////////////////////////////////////////////////////////////
#ifndef SK_BUILD_FOR_WINCE
# include <string.h>
diff --git a/src/core/SkMath.cpp b/src/core/SkMath.cpp
index e33fe55e01..af93d7ecb2 100644
--- a/src/core/SkMath.cpp
+++ b/src/core/SkMath.cpp
@@ -43,27 +43,6 @@ int SkCLZ_portable(uint32_t x) {
return zeros;
}
-SkFixed SkFixedMul_portable(SkFixed a, SkFixed b) {
-#if defined(SkLONGLONG)
- return static_cast<SkFixed>((int64_t)a * b >> 16);
-#else
- int sa = SkExtractSign(a);
- int sb = SkExtractSign(b);
- // now make them positive
- a = SkApplySign(a, sa);
- b = SkApplySign(b, sb);
-
- uint32_t ah = a >> 16;
- uint32_t al = a & 0xFFFF;
- uint32_t bh = b >> 16;
- uint32_t bl = b & 0xFFFF;
-
- uint32_t R = ah * b + al * bh + (al * bl >> 16);
-
- return SkApplySign(R, sa ^ sb);
-#endif
-}
-
///////////////////////////////////////////////////////////////////////////////
#define DIVBITS_ITER(n) \
diff --git a/src/gpu/GrDistanceFieldTextContext.cpp b/src/gpu/GrDistanceFieldTextContext.cpp
index eb172af1b6..2a439da4f2 100755
--- a/src/gpu/GrDistanceFieldTextContext.cpp
+++ b/src/gpu/GrDistanceFieldTextContext.cpp
@@ -246,10 +246,10 @@ void GrDistanceFieldTextContext::onDrawText(GrRenderTarget* rt, const GrClip& cl
const SkGlyph& glyph = glyphCacheProc(cache, &textPtr, 0, 0);
SkFixed width = glyph.fAdvanceX + autokern.adjust(glyph);
- positions.push_back(SkFixedToScalar(stopX + SkFixedMul_portable(origin, width)));
+ positions.push_back(SkFixedToScalar(stopX + SkFixedMul(origin, width)));
SkFixed height = glyph.fAdvanceY;
- positions.push_back(SkFixedToScalar(stopY + SkFixedMul_portable(origin, height)));
+ positions.push_back(SkFixedToScalar(stopY + SkFixedMul(origin, height)));
stopX += width;
stopY += height;
diff --git a/src/gpu/GrStencilAndCoverTextContext.cpp b/src/gpu/GrStencilAndCoverTextContext.cpp
index e43387e66f..ec2fa21af0 100644
--- a/src/gpu/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/GrStencilAndCoverTextContext.cpp
@@ -143,13 +143,13 @@ void GrStencilAndCoverTextContext::onDrawText(GrRenderTarget* rt,
SkFixed fy = SkScalarToFixed(y);
while (text < stop) {
const SkGlyph& glyph = glyphCacheProc(fGlyphCache, &text, 0, 0);
- fx += SkFixedMul_portable(autokern.adjust(glyph), fixedSizeRatio);
+ fx += SkFixedMul(autokern.adjust(glyph), fixedSizeRatio);
if (glyph.fWidth) {
this->appendGlyph(glyph, SkPoint::Make(SkFixedToScalar(fx), SkFixedToScalar(fy)));
}
- fx += SkFixedMul_portable(glyph.fAdvanceX, fixedSizeRatio);
- fy += SkFixedMul_portable(glyph.fAdvanceY, fixedSizeRatio);
+ fx += SkFixedMul(glyph.fAdvanceX, fixedSizeRatio);
+ fy += SkFixedMul(glyph.fAdvanceY, fixedSizeRatio);
}
this->finish();