implement dithering for vertical grads (was a todo:)
git-svn-id: http://skia.googlecode.com/svn/trunk@2960 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
9330cfe851
commit
998343a134
@ -880,10 +880,9 @@ void Linear_Gradient::shadeSpan(int x, int y, SkPMColor* SK_RESTRICT dstC, int c
|
|||||||
|
|
||||||
if (SkFixedNearlyZero(dx)) {
|
if (SkFixedNearlyZero(dx)) {
|
||||||
// we're a vertical gradient, so no change in a span
|
// we're a vertical gradient, so no change in a span
|
||||||
unsigned fi = proc(fx);
|
unsigned fi = proc(fx) >> (16 - kCache32Bits);
|
||||||
SkASSERT(fi <= 0xFFFF);
|
sk_memset32_dither(dstC, cache[toggle + fi],
|
||||||
// TODO: dither version
|
cache[(toggle ^ TOGGLE_MASK) + fi], count);
|
||||||
sk_memset32(dstC, cache[fi >> (16 - kCache32Bits)], count);
|
|
||||||
} else if (proc == clamp_tileproc) {
|
} else if (proc == clamp_tileproc) {
|
||||||
SkClampRange range;
|
SkClampRange range;
|
||||||
range.init(fx, dx, count, 0, 0xFF);
|
range.init(fx, dx, count, 0, 0xFF);
|
||||||
|
Loading…
Reference in New Issue
Block a user