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

Unified Diff: gm/gradients_2pt_conical.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/gradients_2pt_conical.cpp
diff --git a/gm/gradients_2pt_conical.cpp b/gm/gradients_2pt_conical.cpp
index 1e32426547b7c7af24b01c18c6740ec20ca61554..39ebb4a1f9ec540d19639e8a3d605486db360638 100644
--- a/gm/gradients_2pt_conical.cpp
+++ b/gm/gradients_2pt_conical.cpp
@@ -305,10 +305,12 @@ enum GradCaseType { // these must match the order in gGradCases
class ConicalGradientsGM : public GM {
public:
- ConicalGradientsGM(GradCaseType gradCaseType) {
+ ConicalGradientsGM(GradCaseType gradCaseType, bool dither)
+ : fGradCaseType(gradCaseType)
+ , fDither(dither) {
this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
- fName.printf("gradients_2pt_conical_%s", gGradCases[gradCaseType].fName);
- fGradCaseType = gradCaseType;
+ fName.printf("gradients_2pt_conical_%s%s", gGradCases[gradCaseType].fName,
+ fDither ? "" : "_nodither");
}
protected:
@@ -328,6 +330,7 @@ protected:
SkRect r = { 0, 0, SkIntToScalar(100), SkIntToScalar(100) };
SkPaint paint;
paint.setAntiAlias(true);
+ paint.setDither(fDither);
canvas->translate(SkIntToScalar(20), SkIntToScalar(20));
@@ -360,15 +363,16 @@ private:
GradCaseType fGradCaseType;
SkString fName;
+ bool fDither;
};
///////////////////////////////////////////////////////////////////////////////
-static GM* MyFactory1(void*) { return new ConicalGradientsGM(kInside_GradCaseType); }
-static GMRegistry reg1(MyFactory1);
+DEF_GM( return new ConicalGradientsGM(kInside_GradCaseType, true); )
+DEF_GM( return new ConicalGradientsGM(kOutside_GradCaseType, true); )
+DEF_GM( return new ConicalGradientsGM(kEdge_GradCaseType, true); )
-static GM* MyFactory2(void*) { return new ConicalGradientsGM(kOutside_GradCaseType); }
-static GMRegistry reg2(MyFactory2);
+DEF_GM( return new ConicalGradientsGM(kInside_GradCaseType, false); )
+DEF_GM( return new ConicalGradientsGM(kOutside_GradCaseType, false); )
+DEF_GM( return new ConicalGradientsGM(kEdge_GradCaseType, false); )
-static GM* MyFactory3(void*) { return new ConicalGradientsGM(kEdge_GradCaseType); }
-static GMRegistry reg3(MyFactory3);
}

Powered by Google App Engine
This is Rietveld 408576698