OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
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 "SkEndian.h" | 8 #include "SkEndian.h" |
9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
10 #include "SkImageDecoder.h" | 10 #include "SkImageDecoder.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 uint32_t magic; | 179 uint32_t magic; |
180 if (stream->read((void*)&magic, 4) != 4) { | 180 if (stream->read((void*)&magic, 4) != 4) { |
181 return false; | 181 return false; |
182 } | 182 } |
183 | 183 |
184 return kASTCMagicNumber == SkEndian_SwapLE32(magic); | 184 return kASTCMagicNumber == SkEndian_SwapLE32(magic); |
185 } | 185 } |
186 | 186 |
187 static SkImageDecoder* sk_libastc_dfactory(SkStreamRewindable* stream) { | 187 static SkImageDecoder* sk_libastc_dfactory(SkStreamRewindable* stream) { |
188 if (is_astc(stream)) { | 188 if (is_astc(stream)) { |
189 return SkNEW(SkASTCImageDecoder); | 189 return new SkASTCImageDecoder; |
190 } | 190 } |
191 return NULL; | 191 return NULL; |
192 } | 192 } |
193 | 193 |
194 static SkImageDecoder_DecodeReg gReg(sk_libastc_dfactory); | 194 static SkImageDecoder_DecodeReg gReg(sk_libastc_dfactory); |
195 | 195 |
196 static SkImageDecoder::Format get_format_astc(SkStreamRewindable* stream) { | 196 static SkImageDecoder::Format get_format_astc(SkStreamRewindable* stream) { |
197 if (is_astc(stream)) { | 197 if (is_astc(stream)) { |
198 return SkImageDecoder::kASTC_Format; | 198 return SkImageDecoder::kASTC_Format; |
199 } | 199 } |
200 return SkImageDecoder::kUnknown_Format; | 200 return SkImageDecoder::kUnknown_Format; |
201 } | 201 } |
202 | 202 |
203 static SkImageDecoder_FormatReg gFormatReg(get_format_astc); | 203 static SkImageDecoder_FormatReg gFormatReg(get_format_astc); |
OLD | NEW |