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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 const float nativeScales[] = { 0.125f, 0.25f, 0.375f, 0.5f, 0.625f, 0.750f,
0.875f, 1.0f }; | 347 const float nativeScales[] = { 0.125f, 0.25f, 0.375f, 0.5f, 0.625f, 0.750f,
0.875f, 1.0f }; |
348 | 348 |
349 const CodecSrc::Mode nativeModes[] = { CodecSrc::kCodec_Mode, CodecSrc::kCod
ecZeroInit_Mode, | 349 const CodecSrc::Mode nativeModes[] = { CodecSrc::kCodec_Mode, CodecSrc::kCod
ecZeroInit_Mode, |
350 CodecSrc::kScanline_Mode, CodecSrc::kStripe_Mode, CodecSrc::kSubset_
Mode, | 350 CodecSrc::kScanline_Mode, CodecSrc::kStripe_Mode, CodecSrc::kSubset_
Mode, |
351 CodecSrc::kGen_Mode }; | 351 CodecSrc::kGen_Mode }; |
352 | 352 |
353 CodecSrc::DstColorType colorTypes[3]; | 353 CodecSrc::DstColorType colorTypes[3]; |
354 uint32_t numColorTypes; | 354 uint32_t numColorTypes; |
355 switch (codec->getInfo().colorType()) { | 355 switch (codec->getInfo().colorType()) { |
356 case kGray_8_SkColorType: | 356 case kGray_8_SkColorType: |
357 // FIXME: Is this a long term solution for testing wbmps decodes to
kIndex8? | |
358 // Further discussion on this topic is at https://bug.skia.org/3683
. | |
359 // This causes us to try to convert grayscale jpegs to kIndex8. We
currently | |
360 // fail non-fatally in this case. | |
361 colorTypes[0] = CodecSrc::kGetFromCanvas_DstColorType; | 357 colorTypes[0] = CodecSrc::kGetFromCanvas_DstColorType; |
362 colorTypes[1] = CodecSrc::kGrayscale_Always_DstColorType; | 358 colorTypes[1] = CodecSrc::kGrayscale_Always_DstColorType; |
363 colorTypes[2] = CodecSrc::kIndex8_Always_DstColorType; | 359 if (kWBMP_SkEncodedFormat == codec->getEncodedFormat()) { |
364 numColorTypes = 3; | 360 colorTypes[2] = CodecSrc::kIndex8_Always_DstColorType; |
| 361 numColorTypes = 3; |
| 362 } else { |
| 363 numColorTypes = 2; |
| 364 } |
365 break; | 365 break; |
366 case kIndex_8_SkColorType: | 366 case kIndex_8_SkColorType: |
367 colorTypes[0] = CodecSrc::kGetFromCanvas_DstColorType; | 367 colorTypes[0] = CodecSrc::kGetFromCanvas_DstColorType; |
368 colorTypes[1] = CodecSrc::kIndex8_Always_DstColorType; | 368 colorTypes[1] = CodecSrc::kIndex8_Always_DstColorType; |
369 numColorTypes = 2; | 369 numColorTypes = 2; |
370 break; | 370 break; |
371 default: | 371 default: |
372 colorTypes[0] = CodecSrc::kGetFromCanvas_DstColorType; | 372 colorTypes[0] = CodecSrc::kGetFromCanvas_DstColorType; |
373 numColorTypes = 1; | 373 numColorTypes = 1; |
374 break; | 374 break; |
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 Reporter* reporter, | 1274 Reporter* reporter, |
1275 GrContextFactory* fac
tory); | 1275 GrContextFactory* fac
tory); |
1276 } // namespace skiatest | 1276 } // namespace skiatest |
1277 | 1277 |
1278 #if !defined(SK_BUILD_FOR_IOS) | 1278 #if !defined(SK_BUILD_FOR_IOS) |
1279 int main(int argc, char** argv) { | 1279 int main(int argc, char** argv) { |
1280 SkCommandLineFlags::Parse(argc, argv); | 1280 SkCommandLineFlags::Parse(argc, argv); |
1281 return dm_main(); | 1281 return dm_main(); |
1282 } | 1282 } |
1283 #endif | 1283 #endif |
OLD | NEW |