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

Side by Side Diff: src/images/SkImageDecoder_libgif.cpp

Issue 865243002: Put close_gif() in an anonymous namespace. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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);
OLDNEW
« 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