diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-01-04 17:26:27 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-01-04 17:26:27 +0000 |
commit | 998343a134252872e91c70bd7c837f66ca03cd61 (patch) | |
tree | 99d26285b38db09829aee1cbf18e201acc5fca7a /src | |
parent | 9330cfe851b14b8985acc14caa3dc5ad20b0b2a8 (diff) |
implement dithering for vertical grads (was a todo:)
git-svn-id: http://skia.googlecode.com/svn/trunk@2960 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/effects/SkGradientShader.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/effects/SkGradientShader.cpp b/src/effects/SkGradientShader.cpp index 1e1add2e4b..459bd53d83 100644 --- a/src/effects/SkGradientShader.cpp +++ b/src/effects/SkGradientShader.cpp @@ -880,10 +880,9 @@ void Linear_Gradient::shadeSpan(int x, int y, SkPMColor* SK_RESTRICT dstC, int c if (SkFixedNearlyZero(dx)) { // we're a vertical gradient, so no change in a span - unsigned fi = proc(fx); - SkASSERT(fi <= 0xFFFF); - // TODO: dither version - sk_memset32(dstC, cache[fi >> (16 - kCache32Bits)], count); + unsigned fi = proc(fx) >> (16 - kCache32Bits); + sk_memset32_dither(dstC, cache[toggle + fi], + cache[(toggle ^ TOGGLE_MASK) + fi], count); } else if (proc == clamp_tileproc) { SkClampRange range; range.init(fx, dx, count, 0, 0xFF); |