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
This commit is contained in:
parent
cdeca44619
commit
d709ea8d14
@ -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',
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
@ -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) \
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user