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/texteffects.cpp b/gm/texteffects.cpp
index 902bed3..53395f0 100644
--- a/gm/texteffects.cpp
+++ b/gm/texteffects.cpp
@@ -170,20 +170,7 @@
paint->setColor(SK_ColorBLUE);
}
-class TextEffectsGM : public skiagm::GM {
-public:
- TextEffectsGM() {}
-
-protected:
- SkString onShortName() override {
- return SkString("texteffects");
- }
-
- SkISize onISize() override {
- return SkISize::Make(460, 680);
- }
-
- void onDraw(SkCanvas* canvas) override {
+DEF_SIMPLE_GM(texteffects, canvas, 460, 680) {
canvas->save();
SkPaint paint;
@@ -208,13 +195,4 @@
}
canvas->restore();
- }
-
-private:
- typedef skiagm::GM INHERITED;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-
-static skiagm::GM* MyFactory(void*) { return new TextEffectsGM; }
-static skiagm::GMRegistry reg(MyFactory);
+}