aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/mipmap.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/mipmap.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/mipmap.cpp')
-rw-r--r--gm/mipmap.cpp20
1 files changed, 1 insertions, 19 deletions
diff --git a/gm/mipmap.cpp b/gm/mipmap.cpp
index 4eb5c2aa3c..b0b0cc487c 100644
--- a/gm/mipmap.cpp
+++ b/gm/mipmap.cpp
@@ -28,7 +28,7 @@ static SkImage* make_image() {
return surface->newImageSnapshot();
}
-static void test_mip(SkCanvas* canvas) {
+DEF_SIMPLE_GM(mipmap, canvas, 400, 200) {
SkAutoTUnref<SkImage> img(make_image());//SkImage::NewFromEncoded(data));
SkPaint paint;
@@ -48,21 +48,3 @@ static void test_mip(SkCanvas* canvas) {
canvas->drawImage(img, 20, 20, nullptr);
}
-class MipMapGM : public skiagm::GM {
-public:
- MipMapGM() {}
-
-protected:
- SkString onShortName() override { return SkString("mipmap"); }
-
- SkISize onISize() override { return SkISize::Make(400, 200); }
-
- void onDraw(SkCanvas* canvas) override {
- test_mip(canvas);
- }
-
-private:
- typedef skiagm::GM INHERITED;
-};
-DEF_GM( return new MipMapGM; )
-