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

Unified Diff: gm/gm.h

Issue 680533002: add gm: colorwheel (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: refactor checkerboard() fn for simplicity Created 6 years, 2 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/colorwheel.cpp ('k') | gyp/gmslides.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/gm.h
diff --git a/gm/gm.h b/gm/gm.h
index e48f772f397a093521027abc56720f2955bdcbd3..9ba9f452a798bfb6d365511b1e7a6be3c5b4e4bf 100644
--- a/gm/gm.h
+++ b/gm/gm.h
@@ -24,6 +24,20 @@
static skiagm::GM* SK_MACRO_APPEND_LINE(F_)(void*) { code; } \
static skiagm::GMRegistry SK_MACRO_APPEND_LINE(R_)(SK_MACRO_APPEND_LINE(F_));
+// See colorwheel.cpp for example usage.
+#define DEF_SIMPLE_GM(NAME, CANVAS, W, H) \
+ class SK_MACRO_CONCAT(NAME, _GM) : public skiagm::GM { \
+ virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE; \
+ virtual SkISize onISize() SK_OVERRIDE { \
+ return SkISize::Make((W), (H)); \
+ } \
+ virtual SkString onShortName() SK_OVERRIDE { \
+ return SkString(#NAME); \
+ } \
+ }; \
+ DEF_GM( return SkNEW(SK_MACRO_CONCAT(NAME, _GM)); ) \
+ void SK_MACRO_CONCAT(NAME, _GM)::onDraw(SkCanvas* CANVAS)
+
namespace skiagm {
class GM {
« no previous file with comments | « gm/colorwheel.cpp ('k') | gyp/gmslides.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698