Fixed
Status Update
Comments
mt...@google.com <mt...@google.com> #2
This is probably because we picked up Florin's 2-point gradient shader and used SkRasterPipeline to blit. It doesn't dither.
mt...@google.com <mt...@google.com> #4
[Empty comment from Monorail migration]
bu...@chromium.org <bu...@chromium.org> #5
The following revision refers to this bug:
https://skia.googlesource.com/skia/+/581e69865ef5425aa5c9dba173b346dff1ec5652
commit 581e69865ef5425aa5c9dba173b346dff1ec5652
Author: Mike Klein <mtklein@chromium.org>
Date: Wed May 03 18:16:53 2017
dither stage
I think we can dither generically as a pipeline stage.
I'm not married to where the dither happens, or the implementation,
which is mostly cribbed from
https://en.wikipedia.org/wiki/Ordered_dithering .
BUG=skia:3302,skia:6224
Change-Id: If7f6b22a523ca0b34cb03c0aa97b6734c34e0133
Reviewed-on:https://skia-review.googlesource.com/15161
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
[modify]https://crrev.com/581e69865ef5425aa5c9dba173b346dff1ec5652/src/jumper/SkJumper_generated_win.S
[modify]https://crrev.com/581e69865ef5425aa5c9dba173b346dff1ec5652/src/jumper/SkJumper_generated.S
[modify]https://crrev.com/581e69865ef5425aa5c9dba173b346dff1ec5652/src/jumper/SkJumper_stages.cpp
[modify]https://crrev.com/581e69865ef5425aa5c9dba173b346dff1ec5652/src/core/SkRasterPipelineBlitter.cpp
[modify]https://crrev.com/581e69865ef5425aa5c9dba173b346dff1ec5652/src/core/SkRasterPipeline.h
[modify]https://crrev.com/581e69865ef5425aa5c9dba173b346dff1ec5652/src/jumper/SkJumper.h
commit 581e69865ef5425aa5c9dba173b346dff1ec5652
Author: Mike Klein <mtklein@chromium.org>
Date: Wed May 03 18:16:53 2017
dither stage
I think we can dither generically as a pipeline stage.
I'm not married to where the dither happens, or the implementation,
which is mostly cribbed from
BUG=skia:3302,skia:6224
Change-Id: If7f6b22a523ca0b34cb03c0aa97b6734c34e0133
Reviewed-on:
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
[modify]
[modify]
[modify]
[modify]
[modify]
[modify]
[Deleted User] <[Deleted User]> #6
The fiddle now shows dither on both 2 and 3 color gradients.
If you were quick, there were a couple weeks there in the middle where neither 2 nor 3 color gradients had dither... but all gradients should have dither now.
If you were quick, there were a couple weeks there in the middle where neither 2 nor 3 color gradients had dither... but all gradients should have dither now.
Description
SkBitmap bm16;
bm16.allocPixels(SkImageInfo::Make(20, 10, kRGB_565_SkColorType, kOpaque_SkAlphaType));
SkCanvas c16(bm16);
SkPoint points[] = {{0, 0}, {19, 0}, {20, 0}};
SkColor colors[] = {SK_ColorBLUE, SK_ColorRED, SK_ColorGREEN};
SkPaint paint;
paint.setShader(SkGradientShader::MakeLinear(
points, colors, nullptr, SK_ARRAY_COUNT(colors),
SkShader::kClamp_TileMode, 0, nullptr));
paint.setDither(true);
c16.drawPaint(paint); // dithers
canvas->scale(12, 12);
canvas->drawBitmap(bm16, 0, 0);
paint.setShader(SkGradientShader::MakeLinear(
points, colors, nullptr, 2,
SkShader::kClamp_TileMode, 0, nullptr));
c16.drawPaint(paint); // does not dither
canvas->drawBitmap(bm16, 0, 11);
}