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

Unified Diff: gm/shadertext2.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/rrects.cpp ('k') | gm/skbug1719.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/shadertext2.cpp
diff --git a/gm/shadertext2.cpp b/gm/shadertext2.cpp
index 8ceb5e494b0a33a5d3666b6f8af97fae616eb41b..74f01a0c9d30e37105696718a90661bf4117a614 100644
--- a/gm/shadertext2.cpp
+++ b/gm/shadertext2.cpp
@@ -9,8 +9,6 @@
#include "SkGradientShader.h"
#include "SkPath.h"
-namespace skiagm {
-
static void makebm(SkBitmap* bm, int w, int h) {
bm->allocN32Pixels(w, h);
bm->eraseColor(SK_ColorTRANSPARENT);
@@ -41,21 +39,8 @@ struct LabeledMatrix {
const char* fLabel;
};
-class ShaderText2GM : public GM {
-public:
- ShaderText2GM() {
- this->setBGColor(sk_tool_utils::color_to_565(0xFFDDDDDD));
- }
-
-protected:
-
- SkString onShortName() override {
- return SkString("shadertext2");
- }
-
- SkISize onISize() override { return SkISize::Make(1800, 900); }
-
- void onDraw(SkCanvas* canvas) override {
+DEF_SIMPLE_GM_BG(shadertext2, canvas, 1800, 900,
+ sk_tool_utils::color_to_565(0xFFDDDDDD)) {
static const char kText[] = "SKIA";
static const int kTextLen = SK_ARRAY_COUNT(kText) - 1;
static const int kPointSize = 55;
@@ -198,14 +183,4 @@ protected:
canvas->drawText(kStrokeLabel, strlen(kStrokeLabel), strokeX, y, labelPaint);
}
}
- }
-
-private:
- typedef GM INHERITED;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-
-static GM* MyFactory(void*) { return new ShaderText2GM; }
-static GMRegistry reg(MyFactory);
}
« no previous file with comments | « gm/rrects.cpp ('k') | gm/skbug1719.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698