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

Unified Diff: gm/inversepaths.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/imageresizetiled.cpp ('k') | gm/largeglyphblur.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/inversepaths.cpp
diff --git a/gm/inversepaths.cpp b/gm/inversepaths.cpp
index ae54bee218a52064432a5d085dde9945bc12b230..92ea051d123c9e0ecb3889f9fc85964354412675 100644
--- a/gm/inversepaths.cpp
+++ b/gm/inversepaths.cpp
@@ -9,8 +9,6 @@
#include "SkCanvas.h"
#include "SkPath.h"
-namespace skiagm {
-
static SkPath generate_square(SkScalar cx, SkScalar cy, SkScalar w) {
SkRect rect = SkRect::MakeXYWH(cx - w / 2, cy - w / 2, w, w);
SkPath path;
@@ -38,6 +36,7 @@ static SkPath generate_line(SkScalar cx, SkScalar cy, SkScalar l) {
return path;
}
+namespace {
SkPaint::Style styles[] = {
SkPaint::kStroke_Style,
SkPaint::kStrokeAndFill_Style,
@@ -62,24 +61,9 @@ SkPath ((*paths[])(SkScalar, SkScalar, SkScalar)) = {
const SkScalar slideWidth = 90, slideHeight = 90;
const SkScalar slideBoundary = 5;
+} // namespace
-class InversePathsGM : public GM {
-public:
- InversePathsGM() {
-
- }
-
-protected:
-
- SkString onShortName() override {
- return SkString("inverse_paths");
- }
-
- SkISize onISize() override {
- return SkISize::Make(800, 900);
- }
-
- void onDraw(SkCanvas* canvas) override {
+DEF_SIMPLE_GM(inverse_paths, canvas, 800, 900) {
SkScalar cx = slideWidth / 2 + slideBoundary;
SkScalar cy = slideHeight / 2 + slideBoundary;
SkScalar dx = slideWidth + 2 * slideBoundary;
@@ -137,11 +121,4 @@ protected:
canvas->translate(0, dy);
}
}
- }
-
-private:
- typedef GM INHERITED;
-};
-
-DEF_GM( return new InversePathsGM; )
}
« no previous file with comments | « gm/imageresizetiled.cpp ('k') | gm/largeglyphblur.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698