diff options
author | fmalita <fmalita@chromium.org> | 2015-10-12 10:41:48 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-12 10:41:48 -0700 |
commit | 063675ba374cb520fe58bbcdaf5afeea0aa0ad60 (patch) | |
tree | 6e84670d0f050d81d906eb8247387337e31f6601 /gm/shallowgradient.cpp | |
parent | afa95e270c64c9777647b6c58b796750ced57c39 (diff) |
Remove SK_SUPPORT_LEGACY_GRADIENT_DITHERING from Skia proper
Migrating the flag to embedder defines (Chromium already guarded).
Also augment gradient-focused GMs to generate both dithered/undithered
results.
BUG=skia:4436
R=reed@google.com,robertphillips@google.com
Review URL: https://codereview.chromium.org/1400813006
Diffstat (limited to 'gm/shallowgradient.cpp')
-rw-r--r-- | gm/shallowgradient.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/gm/shallowgradient.cpp b/gm/shallowgradient.cpp index b2a34f3b4c..764b1a5034 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); ) |