| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkColor.h" | 8 #include "SkColor.h" |
| 9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
| 10 #include "SkColorTable.h" | 10 #include "SkColorTable.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 addr += rowBytes; | 222 addr += rowBytes; |
| 223 } | 223 } |
| 224 if (warning) { | 224 if (warning) { |
| 225 gif_warning(*bm, "Index out of bounds."); | 225 gif_warning(*bm, "Index out of bounds."); |
| 226 } | 226 } |
| 227 } | 227 } |
| 228 } | 228 } |
| 229 } | 229 } |
| 230 } | 230 } |
| 231 | 231 |
| 232 int close_gif(GifFileType*); // This function is a template argument, so can't
be static. | 232 namespace { |
| 233 // This function is a template argument, so can't be static. |
| 233 int close_gif(GifFileType* gif) { | 234 int close_gif(GifFileType* gif) { |
| 234 #if GIFLIB_MAJOR < 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR == 0) | 235 #if GIFLIB_MAJOR < 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR == 0) |
| 235 return DGifCloseFile(gif); | 236 return DGifCloseFile(gif); |
| 236 #else | 237 #else |
| 237 return DGifCloseFile(gif, NULL); | 238 return DGifCloseFile(gif, NULL); |
| 238 #endif | 239 #endif |
| 239 } | 240 } |
| 241 }//namespace |
| 240 | 242 |
| 241 SkImageDecoder::Result SkGIFImageDecoder::onDecode(SkStream* sk_stream, SkBitmap
* bm, Mode mode) { | 243 SkImageDecoder::Result SkGIFImageDecoder::onDecode(SkStream* sk_stream, SkBitmap
* bm, Mode mode) { |
| 242 #if GIFLIB_MAJOR < 5 | 244 #if GIFLIB_MAJOR < 5 |
| 243 GifFileType* gif = DGifOpen(sk_stream, DecodeCallBackProc); | 245 GifFileType* gif = DGifOpen(sk_stream, DecodeCallBackProc); |
| 244 #else | 246 #else |
| 245 GifFileType* gif = DGifOpen(sk_stream, DecodeCallBackProc, NULL); | 247 GifFileType* gif = DGifOpen(sk_stream, DecodeCallBackProc, NULL); |
| 246 #endif | 248 #endif |
| 247 if (NULL == gif) { | 249 if (NULL == gif) { |
| 248 return error_return(*bm, "DGifOpen"); | 250 return error_return(*bm, "DGifOpen"); |
| 249 } | 251 } |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 static SkImageDecoder_DecodeReg gReg(sk_libgif_dfactory); | 532 static SkImageDecoder_DecodeReg gReg(sk_libgif_dfactory); |
| 531 | 533 |
| 532 static SkImageDecoder::Format get_format_gif(SkStreamRewindable* stream) { | 534 static SkImageDecoder::Format get_format_gif(SkStreamRewindable* stream) { |
| 533 if (is_gif(stream)) { | 535 if (is_gif(stream)) { |
| 534 return SkImageDecoder::kGIF_Format; | 536 return SkImageDecoder::kGIF_Format; |
| 535 } | 537 } |
| 536 return SkImageDecoder::kUnknown_Format; | 538 return SkImageDecoder::kUnknown_Format; |
| 537 } | 539 } |
| 538 | 540 |
| 539 static SkImageDecoder_FormatReg gFormatReg(get_format_gif); | 541 static SkImageDecoder_FormatReg gFormatReg(get_format_gif); |
| OLD | NEW |