Index: gm/etc1bitmap.cpp |
diff --git a/gm/etc1bitmap.cpp b/gm/etc1bitmap.cpp |
index fcf521a1803fec084c3a9ee68eba507bccee2f8b..2782705c7dda892255246f2437cb3a0e4fd0e55b 100644 |
--- a/gm/etc1bitmap.cpp |
+++ b/gm/etc1bitmap.cpp |
@@ -84,6 +84,9 @@ protected: |
virtual SkString onShortName() SK_OVERRIDE { |
SkString str = SkString("etc1bitmap_"); |
str.append(this->fileExtension()); |
+ if (this->isVolatile()) { |
+ str.append("_volatile"); |
+ } |
return str; |
} |
@@ -91,6 +94,8 @@ protected: |
return SkISize::Make(128, 128); |
} |
+ virtual bool isVolatile() const { return false; } |
+ |
virtual SkString fileExtension() const = 0; |
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
@@ -110,6 +115,8 @@ protected: |
return; |
} |
+ bm.setIsVolatile(this->isVolatile()); |
+ |
canvas->drawBitmap(bm, 0, 0); |
} |
@@ -131,6 +138,21 @@ private: |
typedef ETC1BitmapGM INHERITED; |
}; |
+// This class specializes ETC1BitmapGM to load the mandrill_128.pkm file in a volatile bitmap. |
+class ETC1Bitmap_PKM_VOLATILE_GM : public ETC1BitmapGM { |
+public: |
+ ETC1Bitmap_PKM_VOLATILE_GM() : ETC1BitmapGM() { } |
+ virtual ~ETC1Bitmap_PKM_VOLATILE_GM() { } |
+ |
+protected: |
+ |
+ virtual SkString fileExtension() const SK_OVERRIDE { return SkString("pkm"); } |
+ virtual bool isVolatile() const SK_OVERRIDE { return true; } |
+ |
+private: |
+ typedef ETC1BitmapGM INHERITED; |
+}; |
+ |
// This class specializes ETC1BitmapGM to load the mandrill_128.ktx file. |
class ETC1Bitmap_KTX_GM : public ETC1BitmapGM { |
public: |
@@ -224,6 +246,7 @@ private: |
////////////////////////////////////////////////////////////////////////////// |
DEF_GM( return SkNEW(skiagm::ETC1Bitmap_PKM_GM); ) |
+DEF_GM( return SkNEW(skiagm::ETC1Bitmap_PKM_VOLATILE_GM); ) |
DEF_GM( return SkNEW(skiagm::ETC1Bitmap_KTX_GM); ) |
DEF_GM( return SkNEW(skiagm::ETC1Bitmap_R11_KTX_GM); ) |