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

Unified Diff: src/codec/SkCodec_libgif.cpp

Issue 1309763002: Clean up ifdefs in SkGifCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkCodec_libgif.cpp
diff --git a/src/codec/SkCodec_libgif.cpp b/src/codec/SkCodec_libgif.cpp
index c18e06ddd1996918753c8c577cc12cb52af6e016..120044193481200edd79aeb05b59c61f36ba1b8d 100644
--- a/src/codec/SkCodec_libgif.cpp
+++ b/src/codec/SkCodec_libgif.cpp
@@ -59,11 +59,7 @@ static int32_t read_bytes_callback(GifFileType* fileType, GifByteType* out,
* Open the gif file
*/
static GifFileType* open_gif(SkStream* stream) {
-#if GIFLIB_MAJOR < 5
- return DGifOpen(stream, read_bytes_callback);
-#else
return DGifOpen(stream, read_bytes_callback, NULL);
-#endif
}
/*
@@ -84,11 +80,7 @@ void SkGifCodec::CloseGif(GifFileType* gif) {
*/
void SkGifCodec::FreeExtension(SavedImage* image) {
if (NULL != image->ExtensionBlocks) {
-#if GIFLIB_MAJOR < 5
- FreeExtension(image);
-#else
GifFreeExtensions(&image->ExtensionBlockCount, &image->ExtensionBlocks);
-#endif
}
}
@@ -254,9 +246,7 @@ SkCodec::Result SkGifCodec::onGetPixels(const SkImageInfo& dstInfo,
saveExt.ExtensionBlocks = NULL;
saveExt.ExtensionBlockCount = 0;
GifByteType* extData;
-#if GIFLIB_MAJOR >= 5
int32_t extFunction;
-#endif
// We will loop over components of gif images until we find an image. Once
// we find an image, we will decode and return it. While many gif files
@@ -505,13 +495,8 @@ SkCodec::Result SkGifCodec::onGetPixels(const SkImageInfo& dstInfo,
// such as transparency or animation.
case EXTENSION_RECORD_TYPE:
// Read extension data
-#if GIFLIB_MAJOR < 5
- if (GIF_ERROR ==
- DGifGetExtension(fGif, &saveExt.Function, &extData)) {
-#else
if (GIF_ERROR ==
DGifGetExtension(fGif, &extFunction, &extData)) {
-#endif
return gif_error("Could not get extension.\n",
kIncompleteInput);
}
@@ -519,15 +504,10 @@ SkCodec::Result SkGifCodec::onGetPixels(const SkImageInfo& dstInfo,
// Create an extension block with our data
while (NULL != extData) {
// Add a single block
-#if GIFLIB_MAJOR < 5
- if (GIF_ERROR == AddExtensionBlock(&saveExt, extData[0],
- &extData[1])) {
-#else
if (GIF_ERROR ==
GifAddExtensionBlock(&saveExt.ExtensionBlockCount,
&saveExt.ExtensionBlocks, extFunction, extData[0],
&extData[1])) {
-#endif
return gif_error("Could not add extension block.\n",
kIncompleteInput);
}
@@ -536,9 +516,6 @@ SkCodec::Result SkGifCodec::onGetPixels(const SkImageInfo& dstInfo,
return gif_error("Could not get next extension.\n",
kIncompleteInput);
}
-#if GIFLIB_MAJOR < 5
- saveExt.Function = 0;
-#endif
}
break;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698