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

Unified Diff: gm/gradient_matrix.cpp

Issue 1333553002: GM: replace boilerplate with macros (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-09-09 (Wednesday) 11:01:10 EDT Created 5 years, 3 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
« no previous file with comments | « gm/gm.cpp ('k') | gm/hittestpath.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/gradient_matrix.cpp
diff --git a/gm/gradient_matrix.cpp b/gm/gradient_matrix.cpp
index 77227599e666994dc212ff5c2b7ca8146e864474..8f665a1b945eb0db671f44840a92d6b27734a0b7 100644
--- a/gm/gradient_matrix.cpp
+++ b/gm/gradient_matrix.cpp
@@ -111,25 +111,8 @@ static void draw_gradients(SkCanvas* canvas,
canvas->restore();
}
-namespace skiagm {
-
-class GradientMatrixGM : public GM {
-public:
- GradientMatrixGM() {
- this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
- }
-
-protected:
-
- SkString onShortName() override {
- return SkString("gradient_matrix");
- }
-
- SkISize onISize() override {
- return SkISize::Make(800, 800);
- }
-
- void onDraw(SkCanvas* canvas) override {
+DEF_SIMPLE_GM_BG(gradient_matrix, canvas, 800, 800,
+ sk_tool_utils::color_to_565(0xFFDDDDDD)) {
draw_gradients(canvas, &make_linear_gradient,
linearPts, SK_ARRAY_COUNT(linearPts));
@@ -137,11 +120,4 @@ protected:
draw_gradients(canvas, &make_radial_gradient,
radialPts, SK_ARRAY_COUNT(radialPts));
- }
-
-private:
- typedef GM INHERITED;
-};
-
-DEF_GM( return new GradientMatrixGM; )
}
« no previous file with comments | « gm/gm.cpp ('k') | gm/hittestpath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698