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;) |
+} |