aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/astcbitmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gm/astcbitmap.cpp')
-rw-r--r--gm/astcbitmap.cpp39
1 files changed, 6 insertions, 33 deletions
diff --git a/gm/astcbitmap.cpp b/gm/astcbitmap.cpp
index bc5e1e978f..d3191e25cc 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;)
+}