Index: src/images/SkImageDecoder_libico.cpp |
diff --git a/src/images/SkImageDecoder_libico.cpp b/src/images/SkImageDecoder_libico.cpp |
index edfaa2e62b3023fa6d4c9e4d5ac2cf7438c2f64d..14f575babab4162f9db3706e6350af9479692a1c 100644 |
--- a/src/images/SkImageDecoder_libico.cpp |
+++ b/src/images/SkImageDecoder_libico.cpp |
@@ -16,19 +16,16 @@ class SkICOImageDecoder : public SkImageDecoder { |
public: |
SkICOImageDecoder(); |
- virtual Format getFormat() const { |
+ virtual Format getFormat() const SK_OVERRIDE { |
return kICO_Format; |
} |
protected: |
- virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode); |
-}; |
+ virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode) SK_OVERRIDE; |
-#if 0 // UNUSED |
-SkImageDecoder* SkCreateICOImageDecoder() { |
- return new SkICOImageDecoder; |
-} |
-#endif |
+private: |
+ typedef SkImageDecoder INHERITED; |
+}; |
///////////////////////////////////////////////////////////////////////////////////////// |
@@ -235,12 +232,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; |
+ } |
+ bm->setConfig(SkBitmap::kARGB_8888_Config, w, h, calculateRowBytesFor8888(w, bitCount)); |
if (!this->allocPixelRef(bm, NULL)) |
{ |