diff options
author | reed <reed@google.com> | 2015-01-20 07:41:24 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-20 07:41:24 -0800 |
commit | 83c8dec46a7a191b8e5a0b31a866e0b743f4dd72 (patch) | |
tree | b032a8b12f9a7c7c29d7e1b07566c7c57a75babb /src/core/SkMipMap.cpp | |
parent | 2babfd96ae3b8abea6a6a61c43059bc752c7316c (diff) |
remove legacy flags for old image filtering
BUG=skia:
TBR=
Review URL: https://codereview.chromium.org/857193003
Diffstat (limited to 'src/core/SkMipMap.cpp')
-rw-r--r-- | src/core/SkMipMap.cpp | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/core/SkMipMap.cpp b/src/core/SkMipMap.cpp index 2dad6d9c57..4e7fc4bd08 100644 --- a/src/core/SkMipMap.cpp +++ b/src/core/SkMipMap.cpp @@ -225,23 +225,6 @@ SkMipMap* SkMipMap::Build(const SkBitmap& src, SkDiscardableFactoryProc fact) { /////////////////////////////////////////////////////////////////////////////// -#ifdef SK_SUPPORT_LEGACY_MIPLEVELCHOICE -static SkFixed compute_level(SkScalar scale) { - SkScalar inv = SkScalarAbs(SkScalarInvert(scale)); - if (inv > 32767) { // Watch out for SkFixed overflow. - inv = 32767; - } - SkFixed s = SkScalarToFixed(inv); - - if (s < SK_Fixed1) { - return 0; - } - int clz = SkCLZ(s); - SkASSERT(clz >= 1 && clz <= 15); - return SkIntToFixed(15 - clz) + ((unsigned)(s << (clz + 1)) >> 16); -} -#endif - bool SkMipMap::extractLevel(SkScalar scale, Level* levelPtr) const { if (NULL == fLevels) { return false; @@ -251,9 +234,6 @@ bool SkMipMap::extractLevel(SkScalar scale, Level* levelPtr) const { return false; } -#ifdef SK_SUPPORT_LEGACY_MIPLEVELCHOICE - int level = compute_level(scale) >> 16; -#else SkScalar L = -SkScalarLog2(scale); if (!SkScalarIsFinite(L)) { return false; @@ -261,7 +241,6 @@ bool SkMipMap::extractLevel(SkScalar scale, Level* levelPtr) const { SkASSERT(L >= 0); int level = SkScalarRoundToInt(L); // SkDebugf("mipmap scale=%g L=%g level=%d\n", scale, L, level); -#endif SkASSERT(level >= 0); if (level <= 0) { |