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

Unified Diff: gm/colorfilterimagefilter.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/clipdrawdraw.cpp ('k') | gm/constcolorprocessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/colorfilterimagefilter.cpp
diff --git a/gm/colorfilterimagefilter.cpp b/gm/colorfilterimagefilter.cpp
index 4f5a768d57ff730569a3c661809c624e2fa49610..fb5b0d4067fc72523b7cf5af542b09478fed0560 100644
--- a/gm/colorfilterimagefilter.cpp
+++ b/gm/colorfilterimagefilter.cpp
@@ -49,29 +49,19 @@ static SkImageFilter* make_mode_blue(SkImageFilter* input = nullptr) {
return SkColorFilterImageFilter::Create(filter, input);
}
-class ColorFilterImageFilterGM : public skiagm::GM {
-public:
- ColorFilterImageFilterGM () {}
-
-protected:
-
- virtual SkString onShortName() {
- return SkString("colorfilterimagefilter");
- }
-
- void drawClippedRect(SkCanvas* canvas, const SkRect& r, const SkPaint& paint, float outset = 0.0f) {
+static void drawClippedRect(SkCanvas* canvas,
+ const SkRect& r,
+ const SkPaint& paint,
+ float outset = 0.0f) {
canvas->save();
SkRect clip(r);
clip.outset(outset, outset);
canvas->clipRect(clip);
canvas->drawRect(r, paint);
canvas->restore();
- }
-
- virtual SkISize onISize() { return SkISize::Make(400, 100); }
-
- virtual void onDraw(SkCanvas* canvas) {
+}
+DEF_SIMPLE_GM(colorfilterimagefilter, canvas, 400, 100){
SkRect r = SkRect::MakeWH(FILTER_WIDTH, FILTER_HEIGHT);
SkPaint paint;
paint.setColor(SK_ColorRED);
@@ -126,13 +116,4 @@ protected:
drawClippedRect(canvas, r, paint, 5);
canvas->translate(FILTER_WIDTH + MARGIN, 0);
}
- }
-
-private:
- typedef GM INHERITED;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-
-static skiagm::GM* MyFactory(void*) { return new ColorFilterImageFilterGM; }
-static skiagm::GMRegistry reg(MyFactory);
+}
« no previous file with comments | « gm/clipdrawdraw.cpp ('k') | gm/constcolorprocessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698