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

Unified Diff: gm/patch.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/mipmap.cpp ('k') | gm/pathreverse.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/patch.cpp
diff --git a/gm/patch.cpp b/gm/patch.cpp
index c3e43004a62f95cd228f1a6e9f235834bd93e5b0..d9f6d57d6f940f4e232b188ef78073ab9787057c 100644
--- a/gm/patch.cpp
+++ b/gm/patch.cpp
@@ -64,28 +64,7 @@ static void draw_control_points(SkCanvas* canvas, const SkPoint cubics[12]) {
canvas->drawPoints(SkCanvas::kPoints_PointMode, 2, right + 1, paint);
}
-namespace skiagm {
-/**
- * This GM draws a cubics coons patch using the specialized call SkCanvas::drawPatch.
- */
-class SkPatchGM : public GM {
-
-public:
- SkPatchGM() {
- this->setBGColor(0xFFFFFFFF);
- }
-
-protected:
- SkString onShortName() override {
- return SkString("patch_primitive");
- }
-
- SkISize onISize() override {
- return SkISize::Make(800, 800);
- }
-
- void onDraw(SkCanvas* canvas) override {
-
+DEF_SIMPLE_GM(patch_primitive, canvas, 800, 800) {
SkPaint paint;
// The order of the colors and points is clockwise starting at upper-left corner.
@@ -148,11 +127,4 @@ protected:
}
}
canvas->restore();
- }
-
-private:
- typedef GM INHERITED;
-};
-
-DEF_GM(return new SkPatchGM;)
}
« no previous file with comments | « gm/mipmap.cpp ('k') | gm/pathreverse.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698