git-svn-id: http://skia.googlecode.com/svn/trunk@1447 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2011-05-31 14:36:21 +00:00
Родитель ae85aea58e
Коммит 5a1e79595f
1 изменённых файлов: 16 добавлений и 25 удалений

Просмотреть файл

@ -148,36 +148,27 @@ void SuperBlitter::blitH(int x, int y, int width) {
// hit 256 as a summed max, but 255. // hit 256 as a summed max, but 255.
// int maxValue = (1 << (8 - SHIFT)) - (((y & MASK) + 1) >> SHIFT); // int maxValue = (1 << (8 - SHIFT)) - (((y & MASK) + 1) >> SHIFT);
#if 0 int start = x;
SkAntiRun<SHIFT> arun; int stop = x + width;
arun.set(x, x + width);
fRuns.add(x >> SHIFT, arun.getStartAlpha(), arun.getMiddleCount(),
arun.getStopAlpha(), maxValue);
#else
{
int start = x;
int stop = x + width;
SkASSERT(start >= 0 && stop > start); SkASSERT(start >= 0 && stop > start);
int fb = start & SUPER_Mask; int fb = start & SUPER_Mask;
int fe = stop & SUPER_Mask; int fe = stop & SUPER_Mask;
int n = (stop >> SHIFT) - (start >> SHIFT) - 1; int n = (stop >> SHIFT) - (start >> SHIFT) - 1;
if (n < 0) { if (n < 0) {
fb = fe - fb; fb = fe - fb;
n = 0; n = 0;
fe = 0; fe = 0;
} else {
if (fb == 0) {
n += 1;
} else { } else {
if (fb == 0) { fb = (1 << SHIFT) - fb;
n += 1;
} else {
fb = (1 << SHIFT) - fb;
}
} }
fRuns.add(x >> SHIFT, coverage_to_alpha(fb), n, coverage_to_alpha(fe),
(1 << (8 - SHIFT)) - (((y & MASK) + 1) >> SHIFT));
} }
#endif fRuns.add(x >> SHIFT, coverage_to_alpha(fb), n, coverage_to_alpha(fe),
(1 << (8 - SHIFT)) - (((y & MASK) + 1) >> SHIFT));
#ifdef SK_DEBUG #ifdef SK_DEBUG
fRuns.assertValid(y & MASK, (1 << (8 - SHIFT))); fRuns.assertValid(y & MASK, (1 << (8 - SHIFT)));