Skip to content

Commit dbbd263

Browse files
Mike KleinSkia Commit-Bot
authored andcommitted
Revert "move decal_filter_scale inline, walk decal in 32.32"
This reverts commit 6bee47b. Reason for revert: needs a Google3 guard. Original change's description: > move decal_filter_scale inline, walk decal in 32.32 > > Walking soemtimes in 32.32 and sometimes in 16.16 is leading to small > diffs in https://chromium-review.googlesource.com/c/chromium/src/+/1346729. > > I think by walking either consistently will help avoid the problems. > Might as well walk 32.32. > > Cq-Include-Trybots: luci.chromium.try:linux-blink-rel > Change-Id: I4bbe8e10655a97367d3b59d203206bc2c2cf55e8 > Reviewed-on: https://skia-review.googlesource.com/c/172941 > Auto-Submit: Mike Klein <mtklein@google.com> > Reviewed-by: Mike Klein <mtklein@google.com> > Commit-Queue: Mike Klein <mtklein@google.com> TBR=mtklein@google.com,fmalita@chromium.org,reed@google.com Change-Id: I0e1c3eb1459dd5466c7220623ba3891ab64b9ea8 No-Presubmit: true No-Tree-Checks: true No-Try: true Cq-Include-Trybots: luci.chromium.try:linux-blink-rel Reviewed-on: https://skia-review.googlesource.com/c/172943 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
1 parent f995c05 commit dbbd263

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

src/core/SkBitmapProcState_matrix.h

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,18 @@ void SCALE_FILTER_NAME(const SkBitmapProcState& s,
4141
}
4242

4343
#ifdef CHECK_FOR_DECAL
44-
// TODO: can_truncate_to_fixed_for_decal() is kind of misnamed now that
45-
// we're not really stepping in SkFixed (16.16) anymore.
46-
if (can_truncate_to_fixed_for_decal(SkFractionalIntToFixed(fx),
47-
SkFractionalIntToFixed(dx), count, maxX)) {
48-
while (count --> 0) {
44+
const SkFixed fixedFx = SkFractionalIntToFixed(fx);
45+
const SkFixed fixedDx = SkFractionalIntToFixed(dx);
46+
if (can_truncate_to_fixed_for_decal(fixedFx, fixedDx, count, maxX)) {
47+
decal_filter_scale(xy, fixedFx, fixedDx, count);
48+
} else
49+
#endif
50+
{
51+
do {
4952
SkFixed fixedFx = SkFractionalIntToFixed(fx);
50-
SkASSERT((fixedFx >> (16 + 14)) == 0);
51-
*xy++ = (fixedFx >> 12 << 14) | ((fixedFx >> 16) + 1);
53+
*xy++ = pack(fixedFx, maxX, s.fFilterOneX);
5254
fx += dx;
53-
}
54-
return;
55-
}
56-
#endif
57-
while (count --> 0) {
58-
SkFixed fixedFx = SkFractionalIntToFixed(fx);
59-
*xy++ = pack(fixedFx, maxX, s.fFilterOneX);
60-
fx += dx;
55+
} while (--count != 0);
6156
}
6257
}
6358

src/core/SkBitmapProcState_matrixProcs.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,14 @@ static void nofilter_scale(const SkBitmapProcState& s,
303303
#include "SkBitmapProcState_matrix_neon.h"
304304

305305
#else
306+
static void decal_filter_scale(uint32_t dst[], SkFixed fx, SkFixed dx, int count) {
307+
while (count --> 0) {
308+
SkASSERT((fx >> (16 + 14)) == 0);
309+
*dst++ = (fx >> 12 << 14) | ((fx >> 16) + 1);
310+
fx += dx;
311+
}
312+
}
313+
306314
static unsigned clamp(SkFixed fx, int max) {
307315
return SkClampMax(fx >> 16, max);
308316
}

0 commit comments

Comments
 (0)