diff options
author | sugoi <sugoi@chromium.org> | 2014-09-10 13:40:18 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-09-10 13:40:18 -0700 |
commit | d9ec549071581d9d1dc2e5fac3163305ae935a39 (patch) | |
tree | c0a25b8d61578f2f087f02078ded1ee2337d2dba /gm | |
parent | fd731ce804cd3223318f3feee2c98404890b65f2 (diff) |
Added test for non cached ETC1
BUG=skia:
R=bsalomon@chromium.org, robertphillips@chromium.org, robertphillips@google.com
Author: sugoi@chromium.org
Review URL: https://codereview.chromium.org/564493002
Diffstat (limited to 'gm')
-rw-r--r-- | gm/etc1bitmap.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gm/etc1bitmap.cpp b/gm/etc1bitmap.cpp index fcf521a180..2782705c7d 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); ) |