Merge "Update skia to use giflib 5.1.1"
diff --git a/src/images/SkImageDecoder_libgif.cpp b/src/images/SkImageDecoder_libgif.cpp
index 830e58c..b79084c 100644
--- a/src/images/SkImageDecoder_libgif.cpp
+++ b/src/images/SkImageDecoder_libgif.cpp
@@ -229,6 +229,17 @@
}
}
+namespace {
+// 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
+}
+}//namespace
+
SkImageDecoder::Result SkGIFImageDecoder::onDecode(SkStream* sk_stream, SkBitmap* bm, Mode mode) {
#if GIFLIB_MAJOR < 5
GifFileType* gif = DGifOpen(sk_stream, DecodeCallBackProc);
@@ -239,7 +250,7 @@
return error_return(*bm, "DGifOpen");
}
- SkAutoTCallIProc<GifFileType, DGifCloseFile> acp(gif);
+ SkAutoTCallIProc<GifFileType, close_gif> acp(gif);
SavedImage temp_save;
temp_save.ExtensionBlocks=NULL;
diff --git a/src/images/SkMovie_gif.cpp b/src/images/SkMovie_gif.cpp
index decefd5..a5d12ec 100644
--- a/src/images/SkMovie_gif.cpp
+++ b/src/images/SkMovie_gif.cpp
@@ -50,7 +50,7 @@
if (DGifSlurp(fGIF) != GIF_OK)
{
- DGifCloseFile(fGIF);
+ DGifCloseFile(fGIF, NULL);
fGIF = NULL;
}
fCurrIndex = -1;
@@ -60,7 +60,7 @@
SkGIFMovie::~SkGIFMovie()
{
if (fGIF)
- DGifCloseFile(fGIF);
+ DGifCloseFile(fGIF, NULL);
}
static SkMSec savedimage_duration(const SavedImage* image)