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

Unified Diff: gm/astcbitmap.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 | « no previous file | gm/beziereffects.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/astcbitmap.cpp
diff --git a/gm/astcbitmap.cpp b/gm/astcbitmap.cpp
index bc5e1e978f3027ce396beaac9c38b7879cad0842..d3191e25cca5f331b6b4fbc7d14053c4fb8f8dc2 100644
--- a/gm/astcbitmap.cpp
+++ b/gm/astcbitmap.cpp
@@ -42,26 +42,12 @@ static inline const char *get_astc_filename(int idx) {
return kASTCFilenames[idx];
}
-namespace skiagm {
+namespace {
+const int kGMDimension = 600;
+const int kBitmapDimension = kGMDimension / 4;
+} // namespace
-/**
- * Test decoding an image from an ASTC file and then from compressed ASTC data.
- */
-class ASTCBitmapGM : public GM {
-public:
- ASTCBitmapGM() { }
- virtual ~ASTCBitmapGM() { }
-
-protected:
- SkString onShortName() override {
- return SkString("astcbitmap");
- }
-
- SkISize onISize() override {
- return SkISize::Make(kGMDimension, kGMDimension);
- }
-
- void onDraw(SkCanvas* canvas) override {
+DEF_SIMPLE_GM(astcbitmap, canvas, kGMDimension, kGMDimension) {
for (int j = 0; j < 4; ++j) {
for (int i = 0; i < 4; ++i) {
SkString filename = GetResourcePath(get_astc_filename(j*4+i));
@@ -86,17 +72,4 @@ protected:
canvas->drawBitmap(bm, bmX, bmY);
}
}
- }
-
-private:
- static const int kGMDimension = 600;
- static const int kBitmapDimension = kGMDimension/4;
-
- typedef GM INHERITED;
-};
-
-} // namespace skiagm
-
-//////////////////////////////////////////////////////////////////////////////
-
-DEF_GM(return new skiagm::ASTCBitmapGM;)
+}
« no previous file with comments | « no previous file | gm/beziereffects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698