aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2015-03-17 07:23:39 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-17 07:23:39 -0700
commitd709ea8d142eba727dda568d0641a4a2c9d09851 (patch)
tree9f5ef0e889a44b59ac5641aeb8c8503eddc6dc1d /src
parentcdeca446197329de91d87d12ad689d03d7e4d261 (diff)
Remove SkLONGLONG.
All users now define SkLONGLONG. This fixes a long outstanding TODO now that int64_t is required. BUG=skia:179 Review URL: https://codereview.chromium.org/1000933003
Diffstat (limited to 'src')
-rw-r--r--src/core/SkMath.cpp21
-rwxr-xr-xsrc/gpu/GrDistanceFieldTextContext.cpp4
-rw-r--r--src/gpu/GrStencilAndCoverTextContext.cpp6
3 files changed, 5 insertions, 26 deletions
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();