Reland "move decal_filter_scale inline, walk decal in 32.32""

This reverts commit dbbd263d77.

And adds a guard flag for Google3.

Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: I6b7615aaf5f161bfad2b3344fd9ab95a7f1e9d47
Reviewed-on: https://skia-review.googlesource.com/c/172944
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This commit is contained in:
Mike Klein 2018-11-27 10:29:27 -05:00 committed by Skia Commit-Bot
parent 017aa53068
commit cc3c342451
2 changed files with 19 additions and 17 deletions

View File

@ -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
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;
fixedFx = SkFractionalIntToFixed(fx);
#endif
}
return;
}
#endif
{
do {
while (count --> 0) {
SkFixed fixedFx = SkFractionalIntToFixed(fx);
*xy++ = pack(fixedFx, maxX, s.fFilterOneX);
fx += dx;
} while (--count != 0);
}
}

View File

@ -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);
}