OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "CrashHandler.h" | 8 #include "CrashHandler.h" |
9 #include "DMJsonWriter.h" | 9 #include "DMJsonWriter.h" |
10 #include "DMSrcSink.h" | 10 #include "DMSrcSink.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 return; | 202 return; |
203 } | 203 } |
204 | 204 |
205 // Build additional test cases for images that decode natively to non-canvas
types | 205 // Build additional test cases for images that decode natively to non-canvas
types |
206 switch(codec->getInfo().colorType()) { | 206 switch(codec->getInfo().colorType()) { |
207 case kGray_8_SkColorType: | 207 case kGray_8_SkColorType: |
208 push_src("image", "codec_kGray8", new CodecSrc(path, CodecSrc::kNorm
al_Mode, | 208 push_src("image", "codec_kGray8", new CodecSrc(path, CodecSrc::kNorm
al_Mode, |
209 CodecSrc::kGrayscale_Always_DstColorType)); | 209 CodecSrc::kGrayscale_Always_DstColorType)); |
210 push_src("image", "scanline_kGray8", new CodecSrc(path, CodecSrc::kS
canline_Mode, | 210 push_src("image", "scanline_kGray8", new CodecSrc(path, CodecSrc::kS
canline_Mode, |
211 CodecSrc::kGrayscale_Always_DstColorType)); | 211 CodecSrc::kGrayscale_Always_DstColorType)); |
| 212 push_src("image", "scanline_subset_kGray8", new CodecSrc(path, |
| 213 CodecSrc::kScanline_Subset_Mode, CodecSrc::kGrayscale_Always
_DstColorType)); |
212 // Intentional fall through | 214 // Intentional fall through |
213 // FIXME: Is this a long term solution for testing wbmps decodes to
kIndex8? | 215 // FIXME: Is this a long term solution for testing wbmps decodes to
kIndex8? |
214 // Further discussion on this topic is at skbug.com/3683 | 216 // Further discussion on this topic is at skbug.com/3683 |
215 case kIndex_8_SkColorType: | 217 case kIndex_8_SkColorType: |
216 push_src("image", "codec_kIndex8", new CodecSrc(path, CodecSrc::kNorma
l_Mode, | 218 push_src("image", "codec_kIndex8", new CodecSrc(path, CodecSrc::kNor
mal_Mode, |
217 CodecSrc::kIndex8_Always_DstColorType)); | 219 CodecSrc::kIndex8_Always_DstColorType)); |
218 push_src("image", "scanline_kIndex8", new CodecSrc(path, CodecSrc::kSc
anline_Mode, | 220 push_src("image", "scanline_kIndex8", new CodecSrc(path, CodecSrc::k
Scanline_Mode, |
219 CodecSrc::kIndex8_Always_DstColorType)); | 221 CodecSrc::kIndex8_Always_DstColorType)); |
220 break; | 222 push_src("image", "scanline_subset_kIndex8", new CodecSrc(path, |
221 default: | 223 CodecSrc::kScanline_Subset_Mode, CodecSrc::kIndex8_Always_Ds
tColorType)); |
222 // Do nothing | 224 break; |
223 break; | 225 default: |
| 226 // Do nothing |
| 227 break; |
224 } | 228 } |
225 | 229 |
226 // Decode all images to the canvas color type | 230 // Decode all images to the canvas color type |
227 push_src("image", "codec", new CodecSrc(path, CodecSrc::kNormal_Mode, | 231 push_src("image", "codec", new CodecSrc(path, CodecSrc::kNormal_Mode, |
228 CodecSrc::kGetFromCanvas_DstColorType)); | 232 CodecSrc::kGetFromCanvas_DstColorType)); |
229 push_src("image", "scanline", new CodecSrc(path, CodecSrc::kScanline_Mode, | 233 push_src("image", "scanline", new CodecSrc(path, CodecSrc::kScanline_Mode, |
230 CodecSrc::kGetFromCanvas_DstColorType)); | 234 CodecSrc::kGetFromCanvas_DstColorType)); |
| 235 push_src("image", "scanline_subset", new CodecSrc(path, CodecSrc::kScanline_
Subset_Mode, |
| 236 CodecSrc::kGetFromCanvas_DstColorType)); |
231 } | 237 } |
232 | 238 |
233 static bool codec_supported(const char* ext) { | 239 static bool codec_supported(const char* ext) { |
234 // FIXME: Once other versions of SkCodec are available, we can add them to t
his | 240 // FIXME: Once other versions of SkCodec are available, we can add them to t
his |
235 // list (and eventually we can remove this check once they are all supported
). | 241 // list (and eventually we can remove this check once they are all supported
). |
236 static const char* const exts[] = { | 242 static const char* const exts[] = { |
237 "bmp", "gif", "jpg", "jpeg", "png", "ico", "wbmp", | 243 "bmp", "gif", "jpg", "jpeg", "png", "ico", "wbmp", |
238 "BMP", "GIF", "JPG", "JPEG", "PNG", "ICO", "WBMP" | 244 "BMP", "GIF", "JPG", "JPEG", "PNG", "ICO", "WBMP" |
239 }; | 245 }; |
240 | 246 |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 } | 766 } |
761 return 0; | 767 return 0; |
762 } | 768 } |
763 | 769 |
764 #if !defined(SK_BUILD_FOR_IOS) | 770 #if !defined(SK_BUILD_FOR_IOS) |
765 int main(int argc, char** argv) { | 771 int main(int argc, char** argv) { |
766 SkCommandLineFlags::Parse(argc, argv); | 772 SkCommandLineFlags::Parse(argc, argv); |
767 return dm_main(); | 773 return dm_main(); |
768 } | 774 } |
769 #endif | 775 #endif |
OLD | NEW |