aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/hittestpath.cpp
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2015-09-09 08:16:41 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-09 08:16:41 -0700
commit2a24338c777462e04a2b26295f9c034155ee8f3e (patch)
treecab82add826f6d77e75c8265ea960f16929033a8 /gm/hittestpath.cpp
parent157e6483fb089bf4d2e5cd2c18b521e5ab4ff32a (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/hittestpath.cpp')
-rw-r--r--gm/hittestpath.cpp25
1 files changed, 2 insertions, 23 deletions
diff --git a/gm/hittestpath.cpp b/gm/hittestpath.cpp
index b5f01cd2fd..d0fe1aabb3 100644
--- a/gm/hittestpath.cpp
+++ b/gm/hittestpath.cpp
@@ -30,19 +30,7 @@ static void test_hittest(SkCanvas* canvas, const SkPath& path) {
}
}
-class HitTestPathGM : public skiagm::GM {
-public:
- HitTestPathGM () {}
-
-protected:
-
- SkString onShortName() override {
- return SkString("hittestpath");
- }
-
- SkISize onISize() override { return SkISize::Make(700, 460); }
-
- void onDraw(SkCanvas* canvas) override {
+DEF_SIMPLE_GM(hittestpath, canvas, 700, 460) {
SkPath path;
SkRandom rand;
@@ -70,13 +58,4 @@ protected:
path.setFillType(SkPath::kWinding_FillType);
test_hittest(canvas, path);
- }
-
-private:
- typedef GM INHERITED;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-
-static skiagm::GM* MyFactory(void*) { return new HitTestPathGM; }
-static skiagm::GMRegistry reg(MyFactory);
+}