GM: replace boilerplate with macros
I have verified locally that nothing draws differently.
Motivation:
* SK_SIMPLE_GM makes it easier to write a GM.
* Reducing 1100 lines of code makes maintenance easier.
* Simple GMs are easy to convert to Fiddles.
Review URL: https://codereview.chromium.org/1333553002
diff --git a/gm/pathreverse.cpp b/gm/pathreverse.cpp
index 4487f9a..3350765 100644
--- a/gm/pathreverse.cpp
+++ b/gm/pathreverse.cpp
@@ -68,25 +68,8 @@
canvas->restore();
}
-namespace skiagm {
-
-class PathReverseGM : public GM {
-public:
- PathReverseGM() {
-
- }
-
-protected:
-
- SkString onShortName() override {
- return SkString("path-reverse");
- }
-
- SkISize onISize() override {
- return SkISize::Make(640, 480);
- }
-
- void onDraw(SkCanvas* canvas) override {
+DEF_SIMPLE_GM_BG_NAME(pathreverse, canvas, 640, 480, SK_ColorWHITE,
+ SkString("path-reverse")) {
SkRect r = { 10, 10, 100, 60 };
SkPath path;
@@ -108,15 +91,4 @@
path = hiragino_maru_goth_pro_e();
canvas->translate(0, 100);
test_rev(canvas, path);
- }
-
-private:
- typedef GM INHERITED;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-
-static GM* MyFactory(void*) { return new PathReverseGM; }
-static GMRegistry reg(MyFactory);
-
}