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

Unified Diff: gm/dashcubics.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/convexpolyeffect.cpp ('k') | gm/dcshader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/dashcubics.cpp
diff --git a/gm/dashcubics.cpp b/gm/dashcubics.cpp
index ecbe41537b7d89671b269ba209ee4cd34034628a..1773303f0c8d04306e15e25c43ebeb97901d59ed 100644
--- a/gm/dashcubics.cpp
+++ b/gm/dashcubics.cpp
@@ -14,22 +14,8 @@
/*
* Inspired by http://code.google.com/p/chromium/issues/detail?id=112145
*/
-
-class DashCubicsGM : public skiagm::GM {
-public:
- DashCubicsGM() {}
-
-protected:
-
- virtual SkString onShortName() {
- return SkString("dashcubics");
- }
-
- virtual SkISize onISize() {
- return SkISize::Make(860, 700);
- }
-
- void flower(SkCanvas* canvas, const SkPath& path, SkScalar intervals[2], SkPaint::Join join) {
+static void flower(SkCanvas* canvas, const SkPath& path,
+ SkScalar intervals[2], SkPaint::Join join) {
SkPathEffect* pe = SkDashPathEffect::Create(intervals, 2, 0);
SkPaint paint;
@@ -48,9 +34,9 @@ protected:
paint.setPathEffect(nullptr);
paint.setStrokeWidth(0);
canvas->drawPath(path, paint);
- }
+}
- virtual void onDraw(SkCanvas* canvas) {
+DEF_SIMPLE_GM(dashcubics, canvas, 860, 700) {
SkPath path;
const char* d = "M 337,98 C 250,141 250,212 250,212 C 250,212 250,212 250,212"
"C 250,212 250,212 250,212 C 250,212 250,141 163,98 C 156,195 217,231 217,231"
@@ -73,13 +59,4 @@ protected:
canvas->restore();
}
}
- }
-
-private:
- typedef GM INHERITED;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-
-static skiagm::GM* MyFactory(void*) { return new DashCubicsGM; }
-static skiagm::GMRegistry reg(MyFactory);
+}
« no previous file with comments | « gm/convexpolyeffect.cpp ('k') | gm/dcshader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698