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/largeglyphblur.cpp b/gm/largeglyphblur.cpp
index b74f902..a4c1123 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 @@
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;)
}