From 96f16e835e32665ea5af605e52715dbf43367291 Mon Sep 17 00:00:00 2001 From: scroggo Date: Thu, 10 Dec 2015 13:31:59 -0800 Subject: Use DEF_GM everywhere BUG=skia:1902 Review URL: https://codereview.chromium.org/1518893002 --- gm/arithmode.cpp | 3 +-- gm/beziers.cpp | 3 +-- gm/bitmaprect.cpp | 21 +++++---------------- gm/concavepaths.cpp | 3 +-- gm/drawfilter.cpp | 3 +-- gm/drawlooper.cpp | 3 +-- gm/dropshadowimagefilter.cpp | 3 +-- gm/giantbitmap.cpp | 40 +++++++++++++--------------------------- gm/imagefilterscropexpand.cpp | 3 +-- gm/imagefilterscropped.cpp | 3 +-- gm/pathfill.cpp | 7 ++----- gm/pathinterior.cpp | 3 +-- gm/selftest.cpp | 11 ++--------- gm/strokes.cpp | 16 +++++----------- gm/testimagefilters.cpp | 3 +-- 15 files changed, 37 insertions(+), 88 deletions(-) diff --git a/gm/arithmode.cpp b/gm/arithmode.cpp index 1e50e892f7..eb2ecb8abd 100644 --- a/gm/arithmode.cpp +++ b/gm/arithmode.cpp @@ -164,5 +164,4 @@ private: /////////////////////////////////////////////////////////////////////////////// -static skiagm::GM* MyFactory(void*) { return new ArithmodeGM; } -static skiagm::GMRegistry reg(MyFactory); +DEF_GM( return new ArithmodeGM; ) diff --git a/gm/beziers.cpp b/gm/beziers.cpp index 68960edbf3..20abb0307c 100755 --- a/gm/beziers.cpp +++ b/gm/beziers.cpp @@ -80,5 +80,4 @@ private: typedef skiagm::GM INHERITED; }; -static skiagm::GM* F0(void*) { return new BeziersGM; } -static skiagm::GMRegistry R0(F0); +DEF_GM( return new BeziersGM; ) diff --git a/gm/bitmaprect.cpp b/gm/bitmaprect.cpp index 077f0ee273..f855ad77c4 100644 --- a/gm/bitmaprect.cpp +++ b/gm/bitmaprect.cpp @@ -273,23 +273,12 @@ DEF_GM( return new BitmapRectRounding; ) ////////////////////////////////////////////////////////////////////////////// -static skiagm::GM* MyFactory0(void*) { return new DrawBitmapRect2(false); } -static skiagm::GM* MyFactory1(void*) { return new DrawBitmapRect2(true); } - -static skiagm::GM* MyFactory2(void*) { return new DrawBitmapRect3(); } - -#ifndef SK_BUILD_FOR_ANDROID -static skiagm::GM* MyFactory3(void*) { return new DrawBitmapRect4(false); } -static skiagm::GM* MyFactory4(void*) { return new DrawBitmapRect4(true); } -#endif - -static skiagm::GMRegistry reg0(MyFactory0); -static skiagm::GMRegistry reg1(MyFactory1); - -static skiagm::GMRegistry reg2(MyFactory2); +DEF_GM( return new DrawBitmapRect2(false); ) +DEF_GM( return new DrawBitmapRect2(true); ) +DEF_GM( return new DrawBitmapRect3(); ) #ifndef SK_BUILD_FOR_ANDROID -static skiagm::GMRegistry reg3(MyFactory3); -static skiagm::GMRegistry reg4(MyFactory4); +DEF_GM( return new DrawBitmapRect4(false); ) +DEF_GM( return new DrawBitmapRect4(true); ) #endif diff --git a/gm/concavepaths.cpp b/gm/concavepaths.cpp index 37635f8b67..4008a6457e 100644 --- a/gm/concavepaths.cpp +++ b/gm/concavepaths.cpp @@ -388,5 +388,4 @@ private: typedef skiagm::GM INHERITED; }; -static skiagm::GM* F0(void*) { return new ConcavePathsGM; } -static skiagm::GMRegistry R0(F0); +DEF_GM( return new ConcavePathsGM; ) diff --git a/gm/drawfilter.cpp b/gm/drawfilter.cpp index b0a21e9a11..cd1bbb0c16 100644 --- a/gm/drawfilter.cpp +++ b/gm/drawfilter.cpp @@ -68,6 +68,5 @@ private: typedef GM INHERITED; }; -static skiagm::GM* MyFactory(void*) { return new DrawFilterGM; } -static skiagm::GMRegistry reg(MyFactory); +DEF_GM( return new DrawFilterGM; ) diff --git a/gm/drawlooper.cpp b/gm/drawlooper.cpp index ffa7d6c91b..9f922a5ae4 100644 --- a/gm/drawlooper.cpp +++ b/gm/drawlooper.cpp @@ -99,5 +99,4 @@ private: ////////////////////////////////////////////////////////////////////////////// -static skiagm::GM* MyFactory(void*) { return new DrawLooperGM; } -static skiagm::GMRegistry reg(MyFactory); +DEF_GM( return new DrawLooperGM; ) diff --git a/gm/dropshadowimagefilter.cpp b/gm/dropshadowimagefilter.cpp index 1b6bca42d0..81824ab797 100644 --- a/gm/dropshadowimagefilter.cpp +++ b/gm/dropshadowimagefilter.cpp @@ -169,5 +169,4 @@ private: /////////////////////////////////////////////////////////////////////////////// -static skiagm::GM* MyFactory(void*) { return new DropShadowImageFilterGM; } -static skiagm::GMRegistry reg(MyFactory); +DEF_GM( return new DropShadowImageFilterGM; ) diff --git a/gm/giantbitmap.cpp b/gm/giantbitmap.cpp index 571dbd8114..4005359aca 100644 --- a/gm/giantbitmap.cpp +++ b/gm/giantbitmap.cpp @@ -122,30 +122,16 @@ private: /////////////////////////////////////////////////////////////////////////////// -static skiagm::GM* G000(void*) { return new GiantBitmapGM(SkShader::kClamp_TileMode, false, false); } -static skiagm::GM* G100(void*) { return new GiantBitmapGM(SkShader::kRepeat_TileMode, false, false); } -static skiagm::GM* G200(void*) { return new GiantBitmapGM(SkShader::kMirror_TileMode, false, false); } -static skiagm::GM* G010(void*) { return new GiantBitmapGM(SkShader::kClamp_TileMode, true, false); } -static skiagm::GM* G110(void*) { return new GiantBitmapGM(SkShader::kRepeat_TileMode, true, false); } -static skiagm::GM* G210(void*) { return new GiantBitmapGM(SkShader::kMirror_TileMode, true, false); } - -static skiagm::GM* G001(void*) { return new GiantBitmapGM(SkShader::kClamp_TileMode, false, true); } -static skiagm::GM* G101(void*) { return new GiantBitmapGM(SkShader::kRepeat_TileMode, false, true); } -static skiagm::GM* G201(void*) { return new GiantBitmapGM(SkShader::kMirror_TileMode, false, true); } -static skiagm::GM* G011(void*) { return new GiantBitmapGM(SkShader::kClamp_TileMode, true, true); } -static skiagm::GM* G111(void*) { return new GiantBitmapGM(SkShader::kRepeat_TileMode, true, true); } -static skiagm::GM* G211(void*) { return new GiantBitmapGM(SkShader::kMirror_TileMode, true, true); } - -static skiagm::GMRegistry reg000(G000); -static skiagm::GMRegistry reg100(G100); -static skiagm::GMRegistry reg200(G200); -static skiagm::GMRegistry reg010(G010); -static skiagm::GMRegistry reg110(G110); -static skiagm::GMRegistry reg210(G210); - -static skiagm::GMRegistry reg001(G001); -static skiagm::GMRegistry reg101(G101); -static skiagm::GMRegistry reg201(G201); -static skiagm::GMRegistry reg011(G011); -static skiagm::GMRegistry reg111(G111); -static skiagm::GMRegistry reg211(G211); +DEF_GM( return new GiantBitmapGM(SkShader::kClamp_TileMode, false, false); ) +DEF_GM( return new GiantBitmapGM(SkShader::kRepeat_TileMode, false, false); ) +DEF_GM( return new GiantBitmapGM(SkShader::kMirror_TileMode, false, false); ) +DEF_GM( return new GiantBitmapGM(SkShader::kClamp_TileMode, true, false); ) +DEF_GM( return new GiantBitmapGM(SkShader::kRepeat_TileMode, true, false); ) +DEF_GM( return new GiantBitmapGM(SkShader::kMirror_TileMode, true, false); ) + +DEF_GM( return new GiantBitmapGM(SkShader::kClamp_TileMode, false, true); ) +DEF_GM( return new GiantBitmapGM(SkShader::kRepeat_TileMode, false, true); ) +DEF_GM( return new GiantBitmapGM(SkShader::kMirror_TileMode, false, true); ) +DEF_GM( return new GiantBitmapGM(SkShader::kClamp_TileMode, true, true); ) +DEF_GM( return new GiantBitmapGM(SkShader::kRepeat_TileMode, true, true); ) +DEF_GM( return new GiantBitmapGM(SkShader::kMirror_TileMode, true, true); ) diff --git a/gm/imagefilterscropexpand.cpp b/gm/imagefilterscropexpand.cpp index 2e452ee577..b173648a8c 100644 --- a/gm/imagefilterscropexpand.cpp +++ b/gm/imagefilterscropexpand.cpp @@ -170,5 +170,4 @@ private: /////////////////////////////////////////////////////////////////////////////// -static skiagm::GM* MyFactory(void*) { return new ImageFiltersCropExpandGM; } -static skiagm::GMRegistry reg(MyFactory); +DEF_GM( return new ImageFiltersCropExpandGM; ) diff --git a/gm/imagefilterscropped.cpp b/gm/imagefilterscropped.cpp index 82d538999f..745e8984db 100644 --- a/gm/imagefilterscropped.cpp +++ b/gm/imagefilterscropped.cpp @@ -197,5 +197,4 @@ private: /////////////////////////////////////////////////////////////////////////////// -static skiagm::GM* MyFactory(void*) { return new ImageFiltersCroppedGM; } -static skiagm::GMRegistry reg(MyFactory); +DEF_GM( return new ImageFiltersCroppedGM; ) diff --git a/gm/pathfill.cpp b/gm/pathfill.cpp index f4e42e8165..a524588241 100644 --- a/gm/pathfill.cpp +++ b/gm/pathfill.cpp @@ -215,8 +215,5 @@ private: /////////////////////////////////////////////////////////////////////////////// -static skiagm::GM* MyFactory(void*) { return new PathFillGM; } -static skiagm::GMRegistry reg(MyFactory); - -static skiagm::GM* F1(void*) { return new PathInverseFillGM; } -static skiagm::GMRegistry gR1(F1); +DEF_GM( return new PathFillGM; ) +DEF_GM( return new PathInverseFillGM; ) diff --git a/gm/pathinterior.cpp b/gm/pathinterior.cpp index f1cbfc4627..f93e68250d 100644 --- a/gm/pathinterior.cpp +++ b/gm/pathinterior.cpp @@ -110,5 +110,4 @@ private: ////////////////////////////////////////////////////////////////////////////// -static skiagm::GM* MyFactory(void*) { return new PathInteriorGM; } -static skiagm::GMRegistry reg(MyFactory); +DEF_GM( return new PathInteriorGM; ) diff --git a/gm/selftest.cpp b/gm/selftest.cpp index 332a0cd275..b54a528bee 100644 --- a/gm/selftest.cpp +++ b/gm/selftest.cpp @@ -48,12 +48,5 @@ private: static SkColor kTranslucentGreen = 0x7700EE00; static SkColor kTranslucentBlue = 0x770000DD; -static skiagm::GM* F1(void*) { - return new SelfTestGM("selftest1", kTranslucentGreen); -} -static skiagm::GM* F2(void*) { - return new SelfTestGM("selftest2", kTranslucentBlue); -} - -static skiagm::GMRegistry gR1(F1); -static skiagm::GMRegistry gR2(F2); +DEF_GM( return new SelfTestGM("selftest1", kTranslucentGreen); ) +DEF_GM( return new SelfTestGM("selftest2", kTranslucentBlue); ) diff --git a/gm/strokes.cpp b/gm/strokes.cpp index 303d4a538b..f2abb0b7dd 100644 --- a/gm/strokes.cpp +++ b/gm/strokes.cpp @@ -483,17 +483,11 @@ private: ////////////////////////////////////////////////////////////////////////////// -static skiagm::GM* F0(void*) { return new StrokesGM; } -static skiagm::GM* F1(void*) { return new Strokes2GM; } -static skiagm::GM* F2(void*) { return new Strokes3GM; } -static skiagm::GM* F3(void*) { return new Strokes4GM; } -static skiagm::GM* F4(void*) { return new Strokes5GM; } - -static skiagm::GMRegistry R0(F0); -static skiagm::GMRegistry R1(F1); -static skiagm::GMRegistry R2(F2); -static skiagm::GMRegistry R3(F3); -static skiagm::GMRegistry R4(F4); +DEF_GM( return new StrokesGM; ) +DEF_GM( return new Strokes2GM; ) +DEF_GM( return new Strokes3GM; ) +DEF_GM( return new Strokes4GM; ) +DEF_GM( return new Strokes5GM; ) DEF_GM( return new ZeroLenStrokesGM; ) DEF_GM( return new TeenyStrokesGM; ) diff --git a/gm/testimagefilters.cpp b/gm/testimagefilters.cpp index 2c4fadb092..1ea9575c7c 100644 --- a/gm/testimagefilters.cpp +++ b/gm/testimagefilters.cpp @@ -141,5 +141,4 @@ private: ////////////////////////////////////////////////////////////////////////////// -static skiagm::GM* MyFactory(void*) { return new TestImageFiltersGM; } -static skiagm::GMRegistry reg(MyFactory); +DEF_GM( return new TestImageFiltersGM; ) -- cgit v1.2.3