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

Side by Side Diff: src/images/SkImageDecoder_wbmp.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/images/SkImageDecoder_libwebp.cpp ('k') | src/images/SkImageEncoder_Factory.cpp » ('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 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
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 #include "SkImageDecoder.h" 10 #include "SkImageDecoder.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 src += srcRB; 145 src += srcRB;
146 } 146 }
147 147
148 return true; 148 return true;
149 } 149 }
150 150
151 /////////////////////////////////////////////////////////////////////////////// 151 ///////////////////////////////////////////////////////////////////////////////
152 DEFINE_DECODER_CREATOR(WBMPImageDecoder); 152 DEFINE_DECODER_CREATOR(WBMPImageDecoder);
153 /////////////////////////////////////////////////////////////////////////////// 153 ///////////////////////////////////////////////////////////////////////////////
154 154
155 #include "SkTRegistry.h"
156
157 static SkImageDecoder* sk_wbmp_dfactory(SkStream* stream) { 155 static SkImageDecoder* sk_wbmp_dfactory(SkStream* stream) {
158 wbmp_head head; 156 wbmp_head head;
159 157
160 if (head.init(stream)) { 158 if (head.init(stream)) {
161 return SkNEW(SkWBMPImageDecoder); 159 return SkNEW(SkWBMPImageDecoder);
162 } 160 }
163 return NULL; 161 return NULL;
164 } 162 }
165 163
166 static SkImageDecoder::Format get_format_wbmp(SkStream* stream) { 164 static SkImageDecoder::Format get_format_wbmp(SkStream* stream) {
167 wbmp_head head; 165 wbmp_head head;
168 if (head.init(stream)) { 166 if (head.init(stream)) {
169 return SkImageDecoder::kWBMP_Format; 167 return SkImageDecoder::kWBMP_Format;
170 } 168 }
171 return SkImageDecoder::kUnknown_Format; 169 return SkImageDecoder::kUnknown_Format;
172 } 170 }
173 171
174 static SkTRegistry<SkImageDecoder*, SkStream*> gReg(sk_wbmp_dfactory); 172 static SkImageDecoder_DecodeReg gDReg(sk_wbmp_dfactory);
175 static SkTRegistry<SkImageDecoder::Format, SkStream*> gFormatReg(get_format_wbmp ); 173 static SkImageDecoder_FormatReg gFormatReg(get_format_wbmp);
OLDNEW
« no previous file with comments | « src/images/SkImageDecoder_libwebp.cpp ('k') | src/images/SkImageEncoder_Factory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698