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

Unified Diff: src/images/SkImageDecoder_libico.cpp

Issue 12604006: Upstream Android modifications to the image encoders/decoders. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 9 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
Index: src/images/SkImageDecoder_libico.cpp
diff --git a/src/images/SkImageDecoder_libico.cpp b/src/images/SkImageDecoder_libico.cpp
index edfaa2e62b3023fa6d4c9e4d5ac2cf7438c2f64d..7451cf6512cb79e153ba16829524b1aff2d14dbc 100644
--- a/src/images/SkImageDecoder_libico.cpp
+++ b/src/images/SkImageDecoder_libico.cpp
@@ -24,12 +24,6 @@ protected:
virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode);
};
-#if 0 // UNUSED
-SkImageDecoder* SkCreateICOImageDecoder() {
- return new SkICOImageDecoder;
-}
-#endif
-
/////////////////////////////////////////////////////////////////////////////////////////
//read bytes starting from the begin-th index in the buffer
@@ -235,12 +229,16 @@ bool SkICOImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode)
//if the andbitmap (mask) is all zeroes, then we can easily do an index bitmap
//however, with small images with large colortables, maybe it's better to still do argb_8888
- bm->setConfig(SkBitmap::kARGB_8888_Config, w, h, calculateRowBytesFor8888(w, bitCount));
-
if (SkImageDecoder::kDecodeBounds_Mode == mode) {
+ bm->setConfig(SkBitmap::kARGB_8888_Config, w, h, calculateRowBytesFor8888(w, bitCount));
delete[] colors;
return true;
}
+ // No Bitmap reuse supported for this format
+ if (!bm->isNull()) {
+ return false;
+ }
robertphillips 2013/03/11 18:25:55 Is this expensive enough to make duplicating the c
djsollen 2013/03/11 19:43:24 I supposed this was to work around some android bu
+ bm->setConfig(SkBitmap::kARGB_8888_Config, w, h, calculateRowBytesFor8888(w, bitCount));
if (!this->allocPixelRef(bm, NULL))
{

Powered by Google App Engine
This is Rietveld 408576698