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

Unified Diff: src/images/SkImageDecoder_libgif.cpp

Issue 860853003: Upstream support for giflib >= 5.1. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 98 Created 5 years, 11 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 | src/images/SkMovie_gif.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 0701eb68ae57022f97463d10c39ab858be4e030f..fa12301e9938523ffcac1f2ba41e2cb127c20989 100644
--- a/src/images/SkImageDecoder_libgif.cpp
+++ b/src/images/SkImageDecoder_libgif.cpp
@@ -229,6 +229,15 @@ static void sanitize_indexed_bitmap(SkBitmap* bm) {
}
}
+int close_gif(GifFileType*); // This function is a template argument, so can't be static.
+int close_gif(GifFileType* gif) {
+#if GIFLIB_MAJOR < 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR == 0)
+ return DGifCloseFile(gif);
+#else
+ return DGifCloseFile(gif, NULL);
+#endif
+}
+
SkImageDecoder::Result SkGIFImageDecoder::onDecode(SkStream* sk_stream, SkBitmap* bm, Mode mode) {
#if GIFLIB_MAJOR < 5
GifFileType* gif = DGifOpen(sk_stream, DecodeCallBackProc);
@@ -239,7 +248,7 @@ SkImageDecoder::Result SkGIFImageDecoder::onDecode(SkStream* sk_stream, SkBitmap
return error_return(*bm, "DGifOpen");
}
- SkAutoTCallIProc<GifFileType, DGifCloseFile> acp(gif);
+ SkAutoTCallIProc<GifFileType, close_gif> acp(gif);
SavedImage temp_save;
temp_save.ExtensionBlocks=NULL;
« no previous file with comments | « no previous file | src/images/SkMovie_gif.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698