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

Unified Diff: gm/etc1bitmap.cpp

Issue 292663011: Simple PKM image decoder. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 7 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 | gyp/etc1.gyp » ('j') | src/images/SkImageDecoder_pkm.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/etc1bitmap.cpp
diff --git a/gm/copyTo4444.cpp b/gm/etc1bitmap.cpp
similarity index 75%
copy from gm/copyTo4444.cpp
copy to gm/etc1bitmap.cpp
index 7e2c2798e450154700ee7e828e584b2ffd7c72d9..62b61f13b3efaef9722a5b45f4800415daa76460 100644
--- a/gm/copyTo4444.cpp
+++ b/gm/etc1bitmap.cpp
@@ -15,23 +15,24 @@ namespace skiagm {
/**
robertphillips 2014/05/22 14:41:35 Update comment.
krajcevski 2014/05/22 15:32:17 Done.
* Test copying an image from 8888 to 4444.
*/
-class CopyTo4444GM : public GM {
+class ETC1BitmapGM : public GM {
public:
- CopyTo4444GM() {}
+ ETC1BitmapGM() {}
protected:
robertphillips 2014/05/22 14:41:35 add SK_OVERRIDE after ever overridden method.
krajcevski 2014/05/22 15:32:17 Done.
virtual SkString onShortName() {
- return SkString("copyTo4444");
+ return SkString("etc1bitmap");
}
virtual SkISize onISize() {
- return make_isize(1024, 512);
+ return make_isize(512, 512);
}
virtual void onDraw(SkCanvas* canvas) {
- SkBitmap bm, bm4444;
+
+ 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,8 +41,6 @@ protected:
return;
}
canvas->drawBitmap(bm, 0, 0);
- SkAssertResult(bm.copyTo(&bm4444, kARGB_4444_SkColorType));
- canvas->drawBitmap(bm4444, SkIntToScalar(bm.width()), 0);
}
private:
@@ -50,7 +49,7 @@ private:
//////////////////////////////////////////////////////////////////////////////
robertphillips 2014/05/22 14:41:35 Use DEF_GM macro
krajcevski 2014/05/22 15:32:17 Done.
-static GM* MyFactory(void*) { return new CopyTo4444GM; }
+static GM* MyFactory(void*) { return new ETC1BitmapGM; }
static GMRegistry reg(MyFactory);
}
« no previous file with comments | « no previous file | gyp/etc1.gyp » ('j') | src/images/SkImageDecoder_pkm.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698