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

Unified Diff: gm/bigmatrix.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/beziereffects.cpp ('k') | gm/bigrrectaaeffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/bigmatrix.cpp
diff --git a/gm/bigmatrix.cpp b/gm/bigmatrix.cpp
index c7c3b0dd07ea4855c9bf9ef12f833fdd3d0f2ddc..2d2b7d9f7ee95a53f08c58a8b36f81db175b8293 100644
--- a/gm/bigmatrix.cpp
+++ b/gm/bigmatrix.cpp
@@ -11,24 +11,8 @@
#include "SkPath.h"
#include "SkShader.h"
-namespace skiagm {
-
-class BigMatrixGM : public GM {
-public:
- BigMatrixGM() {
- this->setBGColor(sk_tool_utils::color_to_565(0xFF66AA99));
- }
-
-protected:
- virtual SkString onShortName() {
- return SkString("bigmatrix");
- }
-
- virtual SkISize onISize() {
- return SkISize::Make(50, 50);
- }
-
- virtual void onDraw(SkCanvas* canvas) {
+DEF_SIMPLE_GM_BG(bigmatrix, canvas, 50, 50,
+ sk_tool_utils::color_to_565(0xFF66AA99)) {
SkMatrix m;
m.reset();
m.setRotate(33 * SK_Scalar1);
@@ -82,15 +66,4 @@ protected:
rect.setLTRB(pt.fX - small, pt.fY - small,
pt.fX + small, pt.fY + small);
canvas->drawRect(rect, paint);
- }
-
-private:
- typedef GM INHERITED;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-
-static GM* MyFactory(void*) { return new BigMatrixGM; }
-static GMRegistry reg(MyFactory);
-
}
« no previous file with comments | « gm/beziereffects.cpp ('k') | gm/bigrrectaaeffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698