Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Unified Diff: gm/shallowgradient.cpp

Issue 1400813006: Remove SK_SUPPORT_LEGACY_GRADIENT_DITHERING from Skia proper (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gm/shallowgradient.cpp
diff --git a/gm/shallowgradient.cpp b/gm/shallowgradient.cpp
index b2a34f3b4c6d670cd4ec745b690cb1394b9806ee..764b1a50342c710da213046e2cd0c66ea5b1cf15 100644
--- a/gm/shallowgradient.cpp
+++ b/gm/shallowgradient.cpp
@@ -37,7 +37,9 @@ static SkShader* shader_sweep(const SkColor colors[], int count, const SkSize& s
class ShallowGradientGM : public skiagm::GM {
public:
- ShallowGradientGM(MakeShaderProc proc, const char name[]) : fProc(proc) {
+ ShallowGradientGM(MakeShaderProc proc, const char name[], bool dither)
+ : fProc(proc)
+ , fDither(dither) {
fName.printf("shallow_gradient_%s", name);
}
@@ -61,19 +63,26 @@ protected:
SkPaint paint;
paint.setShader(fProc(colors, colorCount, size))->unref();
+ paint.setDither(fDither);
canvas->drawRect(r, paint);
}
private:
MakeShaderProc fProc;
SkString fName;
+ bool fDither;
typedef skiagm::GM INHERITED;
};
///////////////////////////////////////////////////////////////////////////////
-DEF_GM( return new ShallowGradientGM(shader_linear, "linear"); )
-DEF_GM( return new ShallowGradientGM(shader_radial, "radial"); )
-DEF_GM( return new ShallowGradientGM(shader_conical, "conical"); )
-DEF_GM( return new ShallowGradientGM(shader_sweep, "sweep"); )
+DEF_GM( return new ShallowGradientGM(shader_linear, "linear", true); )
+DEF_GM( return new ShallowGradientGM(shader_radial, "radial", true); )
+DEF_GM( return new ShallowGradientGM(shader_conical, "conical", true); )
+DEF_GM( return new ShallowGradientGM(shader_sweep, "sweep", true); )
+
+DEF_GM( return new ShallowGradientGM(shader_linear, "linear_nodither", false); )
+DEF_GM( return new ShallowGradientGM(shader_radial, "radial_nodither", false); )
+DEF_GM( return new ShallowGradientGM(shader_conical, "conical_nodither", false); )
+DEF_GM( return new ShallowGradientGM(shader_sweep, "sweep_nodither", false); )

Powered by Google App Engine
This is Rietveld 408576698