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

Unified Diff: gm/clipdrawdraw.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/blurs.cpp ('k') | gm/colorfilterimagefilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/clipdrawdraw.cpp
diff --git a/gm/clipdrawdraw.cpp b/gm/clipdrawdraw.cpp
index aa635d97a9174301f036c0d19678c898b6b275dc..1aecb9ff3b177516d9cffaf9ddf82d7b9dc06edc 100644
--- a/gm/clipdrawdraw.cpp
+++ b/gm/clipdrawdraw.cpp
@@ -7,8 +7,6 @@
#include "gm.h"
-namespace skiagm {
-
// This GM exercises the use case found in crbug.com/423834.
// The following pattern:
// save();
@@ -18,16 +16,7 @@ namespace skiagm {
//
// drawRect(rect, noAA);
// can leave 1 pixel wide remnants of the first rect.
-class ClipDrawDrawGM : public GM {
-public:
- ClipDrawDrawGM() { this->setBGColor(sk_tool_utils::color_to_565(0xFFCCCCCC)); }
-
-protected:
- SkString onShortName() override { return SkString("clipdrawdraw"); }
-
- SkISize onISize() override { return SkISize::Make(512, 512); }
-
- static void Draw(SkCanvas* canvas, const SkRect& rect) {
+static void Draw(SkCanvas* canvas, const SkRect& rect) {
SkPaint p;
p.setAntiAlias(false);
@@ -44,9 +33,10 @@ protected:
p.setColor(SK_ColorWHITE);
canvas->drawRect(rect, p);
canvas->restore();
- }
+}
- void onDraw(SkCanvas* canvas) override {
+DEF_SIMPLE_GM_BG(clipdrawdraw, canvas, 512, 512,
+ sk_tool_utils::color_to_565(0xFFCCCCCC)) {
// Vertical remnant
const SkRect rect1 = SkRect::MakeLTRB(136.5f, 137.5f, 338.5f, 293.5f);
@@ -56,13 +46,4 @@ protected:
Draw(canvas, rect1);
Draw(canvas, rect2);
- }
-
-private:
- typedef GM INHERITED;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-
-DEF_GM(return new ClipDrawDrawGM;)
}
« no previous file with comments | « gm/blurs.cpp ('k') | gm/colorfilterimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698