Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Unified Diff: gm/etc1bitmap.cpp

Issue 564493002: Added test for non cached ETC1 Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Added this-> Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/SkGr.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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); )
« no previous file with comments | « no previous file | src/gpu/SkGr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698