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/smallarc.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/smallarc.cpp')
-rw-r--r-- | gm/smallarc.cpp | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/gm/smallarc.cpp b/gm/smallarc.cpp index 6c0df8d8d7..25755accc4 100644 --- a/gm/smallarc.cpp +++ b/gm/smallarc.cpp @@ -8,27 +8,10 @@ #include "gm.h" #include "SkPath.h" -namespace skiagm { - // this draws a small arc scaled up // see https://code.google.com/p/chromium/issues/detail?id=102411 // and https://code.google.com/p/skia/issues/detail?id=2769 -class SmallArcGM : public GM { -public: - SmallArcGM() { - } - -protected: - - SkString onShortName() override { - return SkString("smallarc"); - } - - SkISize onISize() override { - return SkISize::Make(762, 762); - } - - void onDraw(SkCanvas* canvas) override { +DEF_SIMPLE_GM(smallarc, canvas, 762, 762) { SkPaint p; p.setColor(SK_ColorRED); p.setAntiAlias(true); @@ -42,13 +25,4 @@ protected: canvas->translate(-400, -400); canvas->scale(8, 8); canvas->drawPath(path, p); - } - -private: - typedef GM INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -DEF_GM(return new SmallArcGM;) } |