Chromium Code Reviews| 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)) |
| { |