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

Unified Diff: gm/texdata.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/stroketext.cpp ('k') | gm/textblobrandomfont.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/texdata.cpp
diff --git a/gm/texdata.cpp b/gm/texdata.cpp
index 1a807c7b9bd5a57d171af1fcd9989ff3bb2b1a45..e36e94dba443f736b9a72dbbbe56a07f31aff133 100644
--- a/gm/texdata.cpp
+++ b/gm/texdata.cpp
@@ -17,26 +17,9 @@
#include "effects/GrPorterDuffXferProcessor.h"
#include "effects/GrSimpleTextureEffect.h"
-namespace skiagm {
-
static const int S = 200;
-class TexDataGM : public GM {
-public:
- TexDataGM() {
- this->setBGColor(0xff000000);
- }
-
-protected:
- SkString onShortName() override {
- return SkString("texdata");
- }
-
- SkISize onISize() override {
- return SkISize::Make(2*S, 2*S);
- }
-
- void onDraw(SkCanvas* canvas) override {
+DEF_SIMPLE_GM_BG(texdata, canvas, 2 * S, 2 * S, SK_ColorBLACK) {
GrRenderTarget* target = canvas->internal_private_accessTopLayerRenderTarget();
GrContext* ctx = canvas->getGrContext();
SkAutoTUnref<GrDrawContext> drawContext(ctx ? ctx->drawContext() : nullptr);
@@ -130,19 +113,7 @@ protected:
drawContext->drawRect(target, clip, paint, vm, SkRect::MakeWH(2*S, 2*S));
}
} else {
- this->drawGpuOnlyMessage(canvas);
+ skiagm::GM::DrawGpuOnlyMessage(canvas);
}
- }
-
-private:
- typedef GM INHERITED;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-
-static GM* MyFactory(void*) { return new TexDataGM; }
-static GMRegistry reg(MyFactory);
-
}
-
#endif
« no previous file with comments | « gm/stroketext.cpp ('k') | gm/textblobrandomfont.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698