aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/largeglyphblur.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/largeglyphblur.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/largeglyphblur.cpp')
-rw-r--r--gm/largeglyphblur.cpp28
1 files changed, 1 insertions, 27 deletions
diff --git a/gm/largeglyphblur.cpp b/gm/largeglyphblur.cpp
index b74f9024b8..a4c112328d 100644
--- a/gm/largeglyphblur.cpp
+++ b/gm/largeglyphblur.cpp
@@ -14,21 +14,7 @@
// This test ensures that glyphs whose point size is less than the SkGlyphCache's maxmium, but
// who have a large blur, are still handled correctly
-namespace skiagm {
-class LargeGlyphBlur : public GM {
-public:
- LargeGlyphBlur() {}
-
-protected:
- SkString onShortName() override {
- return SkString("largeglyphblur");
- }
-
- SkISize onISize() override {
- return SkISize::Make(kWidth, kHeight);
- }
-
- void onDraw(SkCanvas* canvas) override {
+DEF_SIMPLE_GM(largeglyphblur, canvas, 1920, 600) {
const char text[] = "Hamburgefons";
SkPaint paint;
@@ -54,16 +40,4 @@ protected:
size_t len = strlen(text);
canvas->drawText(text, len, 10, 500, blurPaint);
canvas->drawText(text, len, 10, 500, paint);
- }
-
-private:
- static const int kWidth = 1920;
- static const int kHeight = 600;
-
- typedef GM INHERITED;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-
-DEF_GM(return new LargeGlyphBlur;)
}