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

Side by Side Diff: src/ports/SkImageDecoder_WIC.cpp

Issue 23453031: Rewrite SkTRegistry to take any trivially-copyable type. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: reed+scroggo Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/ports/SkImageDecoder_CG.cpp ('k') | tests/Test.h » ('j') | 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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #define WIN32_LEAN_AND_MEAN 10 #define WIN32_LEAN_AND_MEAN
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 case SkImageEncoder::kICO_Type: 425 case SkImageEncoder::kICO_Type:
426 case SkImageEncoder::kJPEG_Type: 426 case SkImageEncoder::kJPEG_Type:
427 case SkImageEncoder::kPNG_Type: 427 case SkImageEncoder::kPNG_Type:
428 break; 428 break;
429 default: 429 default:
430 return NULL; 430 return NULL;
431 } 431 }
432 return SkNEW_ARGS(SkImageEncoder_WIC, (t)); 432 return SkNEW_ARGS(SkImageEncoder_WIC, (t));
433 } 433 }
434 434
435 static SkTRegistry<SkImageEncoder*, SkImageEncoder::Type> gEReg(sk_imageencoder_ wic_factory); 435 static SkTRegistry<SkImageEncoder*(*)(SkImageEncoder::Type)> gEReg(sk_imageencod er_wic_factory);
436 436
437 static SkImageDecoder::Format get_format_wic(SkStream* stream) { 437 static SkImageDecoder::Format get_format_wic(SkStream* stream) {
438 SkImageDecoder::Format format; 438 SkImageDecoder::Format format;
439 SkImageDecoder_WIC codec; 439 SkImageDecoder_WIC codec;
440 if (!codec.decodeStream(stream, NULL, SkImageDecoder_WIC::kDecodeFormat_WICM ode, &format)) { 440 if (!codec.decodeStream(stream, NULL, SkImageDecoder_WIC::kDecodeFormat_WICM ode, &format)) {
441 format = SkImageDecoder::kUnknown_Format; 441 format = SkImageDecoder::kUnknown_Format;
442 } 442 }
443 return format; 443 return format;
444 } 444 }
445 445
446 static SkTRegistry<SkImageDecoder::Format, SkStream*> gFormatReg(get_format_wic) ; 446 static SkTRegistry<SkImageDecoder::Format(*)(SkStream*)> gFormatReg(get_format_w ic);
OLDNEW
« no previous file with comments | « src/ports/SkImageDecoder_CG.cpp ('k') | tests/Test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698