Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: gm/imagefilters.cpp

Issue 1333553002: GM: replace boilerplate with macros (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-09-09 (Wednesday) 11:01:10 EDT Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/imageblur.cpp ('k') | gm/imagefromyuvtextures.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagefilters.cpp
diff --git a/gm/imagefilters.cpp b/gm/imagefilters.cpp
index e28bf5255ec754c95b95ac5c03a7d8dbb7b40623..8b4deca93a92f53e5380ef62192e572a3f293f90 100644
--- a/gm/imagefilters.cpp
+++ b/gm/imagefilters.cpp
@@ -16,15 +16,7 @@
*
* see skbug.com/3741
*/
-class ImageFilterXfermodeTestGM : public skiagm::GM {
-protected:
- SkString onShortName() override {
- return SkString("imagefilters_xfermodes");
- }
-
- SkISize onISize() override { return SkISize::Make(480, 480); }
-
- void doDraw(SkCanvas* canvas, SkXfermode::Mode mode, SkImageFilter* imf) {
+static void do_draw(SkCanvas* canvas, SkXfermode::Mode mode, SkImageFilter* imf) {
SkAutoCanvasRestore acr(canvas, true);
canvas->clipRect(SkRect::MakeWH(220, 220));
@@ -47,9 +39,9 @@ protected:
paint.setImageFilter(imf);
paint.setXfermodeMode(mode);
canvas->drawOval(r1, paint);
- }
+}
- void onDraw(SkCanvas* canvas) override {
+DEF_SIMPLE_GM(imagefilters_xfermodes, canvas, 480, 480) {
canvas->translate(10, 10);
// just need an imagefilter to trigger the code-path (which creates a tmp layer)
@@ -62,17 +54,11 @@ protected:
for (size_t i = 0; i < SK_ARRAY_COUNT(modes); ++i) {
canvas->save();
- this->doDraw(canvas, modes[i], nullptr);
+ do_draw(canvas, modes[i], nullptr);
canvas->translate(240, 0);
- this->doDraw(canvas, modes[i], imf);
+ do_draw(canvas, modes[i], imf);
canvas->restore();
canvas->translate(0, 240);
}
- }
-
-private:
- typedef GM INHERITED;
-};
-DEF_GM( return new ImageFilterXfermodeTestGM; )
-
+}
« no previous file with comments | « gm/imageblur.cpp ('k') | gm/imagefromyuvtextures.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698