diff options
author | halcanary <halcanary@google.com> | 2015-09-09 08:16:41 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-09 08:16:41 -0700 |
commit | 2a24338c777462e04a2b26295f9c034155ee8f3e (patch) | |
tree | cab82add826f6d77e75c8265ea960f16929033a8 /gm/texteffects.cpp | |
parent | 157e6483fb089bf4d2e5cd2c18b521e5ab4ff32a (diff) |
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
Diffstat (limited to 'gm/texteffects.cpp')
-rw-r--r-- | gm/texteffects.cpp | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/gm/texteffects.cpp b/gm/texteffects.cpp index 902bed3ea8..53395f0732 100644 --- a/gm/texteffects.cpp +++ b/gm/texteffects.cpp @@ -170,20 +170,7 @@ static void apply_shader(SkPaint* paint, int index) { 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 @@ protected: } canvas->restore(); - } - -private: - typedef skiagm::GM INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -static skiagm::GM* MyFactory(void*) { return new TextEffectsGM; } -static skiagm::GMRegistry reg(MyFactory); +} |