Index: gm/etc1bitmap.cpp |
diff --git a/gm/copyTo4444.cpp b/gm/etc1bitmap.cpp |
similarity index 60% |
copy from gm/copyTo4444.cpp |
copy to gm/etc1bitmap.cpp |
index 7e2c2798e450154700ee7e828e584b2ffd7c72d9..d2cd726886b47385450bcd6c3a75f9fb79c45359 100644 |
--- a/gm/copyTo4444.cpp |
+++ b/gm/etc1bitmap.cpp |
@@ -1,5 +1,5 @@ |
/* |
- * Copyright 2013 Google Inc. |
+ * Copyright 2014 Google Inc. |
* |
* Use of this source code is governed by a BSD-style license that can be |
* found in the LICENSE file. |
@@ -13,25 +13,28 @@ |
namespace skiagm { |
/** |
- * Test copying an image from 8888 to 4444. |
+ * Test decoding an image from a PKM file and then |
+ * from compressed ETC1 data. |
*/ |
-class CopyTo4444GM : public GM { |
+class ETC1BitmapGM : public GM { |
public: |
- CopyTo4444GM() {} |
+ ETC1BitmapGM() { } |
+ virtual ~ETC1BitmapGM() { } |
protected: |
- virtual SkString onShortName() { |
- return SkString("copyTo4444"); |
+ virtual SkString onShortName() SK_OVERRIDE { |
+ return SkString("etc1bitmap"); |
} |
- virtual SkISize onISize() { |
- return make_isize(1024, 512); |
+ virtual SkISize onISize() SK_OVERRIDE { |
+ return make_isize(512, 512); |
} |
- virtual void onDraw(SkCanvas* canvas) { |
- SkBitmap bm, bm4444; |
+ virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
+ |
+ SkBitmap bm; |
SkString filename = SkOSPath::SkPathJoin( |
- INHERITED::gResourcePath.c_str(), "mandrill_512.png"); |
+ INHERITED::gResourcePath.c_str(), "mandrill_512.pkm"); |
if (!SkImageDecoder::DecodeFile(filename.c_str(), &bm, |
SkBitmap::kARGB_8888_Config, |
SkImageDecoder::kDecodePixels_Mode)) { |
@@ -40,17 +43,14 @@ protected: |
return; |
} |
canvas->drawBitmap(bm, 0, 0); |
- SkAssertResult(bm.copyTo(&bm4444, kARGB_4444_SkColorType)); |
- canvas->drawBitmap(bm4444, SkIntToScalar(bm.width()), 0); |
} |
private: |
typedef GM INHERITED; |
}; |
-////////////////////////////////////////////////////////////////////////////// |
+} // namespace skiagm |
-static GM* MyFactory(void*) { return new CopyTo4444GM; } |
-static GMRegistry reg(MyFactory); |
+////////////////////////////////////////////////////////////////////////////// |
-} |
+DEF_GM( return SkNEW(skiagm::ETC1BitmapGM); ) |