diff --git a/src/core/SkBitmapProcState_matrix.h b/src/core/SkBitmapProcState_matrix.h index 6244a5d51b..712a21dae6 100644 --- a/src/core/SkBitmapProcState_matrix.h +++ b/src/core/SkBitmapProcState_matrix.h @@ -41,18 +41,28 @@ void SCALE_FILTER_NAME(const SkBitmapProcState& s, } #ifdef CHECK_FOR_DECAL - const SkFixed fixedFx = SkFractionalIntToFixed(fx); + // TODO: can_truncate_to_fixed_for_decal() is kind of misnamed now that + // we're not really stepping in SkFixed (16.16) anymore. + SkFixed fixedFx = SkFractionalIntToFixed(fx); const SkFixed fixedDx = SkFractionalIntToFixed(dx); if (can_truncate_to_fixed_for_decal(fixedFx, fixedDx, count, maxX)) { - decal_filter_scale(xy, fixedFx, fixedDx, count); - } else -#endif - { - do { - SkFixed fixedFx = SkFractionalIntToFixed(fx); - *xy++ = pack(fixedFx, maxX, s.fFilterOneX); + while (count --> 0) { + SkASSERT((fixedFx >> (16 + 14)) == 0); + *xy++ = (fixedFx >> 12 << 14) | ((fixedFx >> 16) + 1); + #if defined(SK_WALK_DECAL_IN_1616) + fixedFx += fixedDx; + #else fx += dx; - } while (--count != 0); + fixedFx = SkFractionalIntToFixed(fx); + #endif + } + return; + } +#endif + while (count --> 0) { + SkFixed fixedFx = SkFractionalIntToFixed(fx); + *xy++ = pack(fixedFx, maxX, s.fFilterOneX); + fx += dx; } } diff --git a/src/core/SkBitmapProcState_matrixProcs.cpp b/src/core/SkBitmapProcState_matrixProcs.cpp index a354ee5a14..2e30b2a590 100644 --- a/src/core/SkBitmapProcState_matrixProcs.cpp +++ b/src/core/SkBitmapProcState_matrixProcs.cpp @@ -303,14 +303,6 @@ static void nofilter_scale(const SkBitmapProcState& s, #include "SkBitmapProcState_matrix_neon.h" #else - static void decal_filter_scale(uint32_t dst[], SkFixed fx, SkFixed dx, int count) { - while (count --> 0) { - SkASSERT((fx >> (16 + 14)) == 0); - *dst++ = (fx >> 12 << 14) | ((fx >> 16) + 1); - fx += dx; - } - } - static unsigned clamp(SkFixed fx, int max) { return SkClampMax(fx >> 16, max); }