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

Unified Diff: src/images/SkImageDecoder_libgif.cpp

Issue 12604006: Upstream Android modifications to the image encoders/decoders. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: minor fixes 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
« no previous file with comments | « src/images/SkImageDecoder_libbmp.cpp ('k') | src/images/SkImageDecoder_libico.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkImageDecoder_libgif.cpp
diff --git a/src/images/SkImageDecoder_libgif.cpp b/src/images/SkImageDecoder_libgif.cpp
index f81c601093851a9ed77611737572167f4ee98211..02bc67b7debeab463771ac107ea2a79730ada983 100644
--- a/src/images/SkImageDecoder_libgif.cpp
+++ b/src/images/SkImageDecoder_libgif.cpp
@@ -18,12 +18,15 @@
class SkGIFImageDecoder : public SkImageDecoder {
public:
- virtual Format getFormat() const {
+ virtual Format getFormat() const SK_OVERRIDE {
return kGIF_Format;
}
protected:
- virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode mode);
+ virtual bool onDecode(SkStream* stream, SkBitmap* bm, Mode mode) SK_OVERRIDE;
+
+private:
+ typedef SkImageDecoder INHERITED;
};
static const uint8_t gStartingIterlaceYValue[] = {
@@ -201,11 +204,18 @@ bool SkGIFImageDecoder::onDecode(SkStream* sk_stream, SkBitmap* bm, Mode mode) {
width, height)) {
return error_return(gif, *bm, "chooseFromOneChoice");
}
-
- bm->setConfig(SkBitmap::kIndex8_Config, width, height);
- if (SkImageDecoder::kDecodeBounds_Mode == mode)
+
+ if (SkImageDecoder::kDecodeBounds_Mode == mode) {
+ bm->setConfig(SkBitmap::kIndex8_Config, width, height);
return true;
+ }
+
+ // No Bitmap reuse supported for this format
+ if (!bm->isNull()) {
+ return false;
+ }
+ bm->setConfig(SkBitmap::kIndex8_Config, width, height);
SavedImage* image = &gif->SavedImages[gif->ImageCount-1];
const GifImageDesc& desc = image->ImageDesc;
« no previous file with comments | « src/images/SkImageDecoder_libbmp.cpp ('k') | src/images/SkImageDecoder_libico.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698