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

Unified Diff: gm/getpostextpath.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/fatpathfill.cpp ('k') | gm/glyph_pos.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/getpostextpath.cpp
diff --git a/gm/getpostextpath.cpp b/gm/getpostextpath.cpp
index faace242e02fbccb290d7e316d406a08b35d8a53..dcd983b3f34617ba43adc6a552ec9bfad19f3581 100644
--- a/gm/getpostextpath.cpp
+++ b/gm/getpostextpath.cpp
@@ -12,27 +12,14 @@
#include "SkRandom.h"
#include "SkTemplates.h"
-class GetPosTextPathGM : public skiagm::GM {
-public:
- GetPosTextPathGM() {}
-
-protected:
-
- SkString onShortName() override {
- return SkString("getpostextpath");
- }
-
- SkISize onISize() override { return SkISize::Make(480, 780); }
-
- static void strokePath(SkCanvas* canvas, const SkPath& path) {
+static void strokePath(SkCanvas* canvas, const SkPath& path) {
SkPaint paint;
paint.setAntiAlias(true);
paint.setColor(SK_ColorRED);
paint.setStyle(SkPaint::kStroke_Style);
canvas->drawPath(path, paint);
- }
-
- void onDraw(SkCanvas* canvas) override {
+}
+DEF_SIMPLE_GM(getpostextpath, canvas, 480, 780) {
// explicitly add spaces, to test a prev. bug
const char* text = "Ham bur ge fons";
int len = SkToInt(strlen(text));
@@ -67,10 +54,4 @@ protected:
canvas->drawPosText(text, len, &pos[0], paint);
paint.getPosTextPath(text, len, &pos[0], &path);
strokePath(canvas, path);
- }
-};
-
-//////////////////////////////////////////////////////////////////////////////
-
-static skiagm::GM* F(void*) { return new GetPosTextPathGM; }
-static skiagm::GMRegistry gR(F);
+}
« no previous file with comments | « gm/fatpathfill.cpp ('k') | gm/glyph_pos.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698