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 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
540 for (float scale : nativeScales) { | 540 for (float scale : nativeScales) { |
541 for (CodecSrc::DstColorType colorType : colorTypes) { | 541 for (CodecSrc::DstColorType colorType : colorTypes) { |
542 for (SkAlphaType alphaType : alphaModes) { | 542 for (SkAlphaType alphaType : alphaModes) { |
543 // Only test kCroppedScanline_Mode when the alpha type is op aque. The test is | 543 // Only test kCroppedScanline_Mode when the alpha type is op aque. The test is |
544 // slow and won't be interestingly different with different alpha types. | 544 // slow and won't be interestingly different with different alpha types. |
545 if (CodecSrc::kCroppedScanline_Mode == mode && | 545 if (CodecSrc::kCroppedScanline_Mode == mode && |
546 kOpaque_SkAlphaType != alphaType) { | 546 kOpaque_SkAlphaType != alphaType) { |
547 continue; | 547 continue; |
548 } | 548 } |
549 | 549 |
550 // Only test kNonNative_DstColorType when the alpha type is premul and there is | |
scroggo
2016/04/26 13:22:33
I found this a little bit confusing. I thought you
msarett
2016/04/26 15:00:54
Yes you're correct. You make a good point that un
| |
551 // no native scale. This test won't be interestingly differ ent with different | |
552 // alpha types or scales. | |
553 if (CodecSrc::kNonNative8888_Always_DstColorType == colorTyp e && | |
554 (kPremul_SkAlphaType != alphaType || 1.0f != scale)) { | |
555 continue; | |
556 } | |
557 | |
550 push_codec_src(path, mode, colorType, alphaType, scale); | 558 push_codec_src(path, mode, colorType, alphaType, scale); |
551 } | 559 } |
552 } | 560 } |
553 } | 561 } |
554 } | 562 } |
555 | 563 |
556 if (FLAGS_simpleCodec) { | 564 if (FLAGS_simpleCodec) { |
557 return; | 565 return; |
558 } | 566 } |
559 | 567 |
(...skipping 10 matching lines...) Expand all Loading... | |
570 subset = true; | 578 subset = true; |
571 break; | 579 break; |
572 } | 580 } |
573 } | 581 } |
574 | 582 |
575 const int sampleSizes[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; | 583 const int sampleSizes[] = { 1, 2, 3, 4, 5, 6, 7, 8 }; |
576 | 584 |
577 for (int sampleSize : sampleSizes) { | 585 for (int sampleSize : sampleSizes) { |
578 for (CodecSrc::DstColorType colorType : colorTypes) { | 586 for (CodecSrc::DstColorType colorType : colorTypes) { |
579 for (SkAlphaType alphaType : alphaModes) { | 587 for (SkAlphaType alphaType : alphaModes) { |
588 // Only test kNonNative_DstColorType when the alpha type is prem ul and sample size | |
589 // is 1 or 2. This test won't be interestingly different with d ifferent | |
590 // alpha types or additional sample sizes. | |
scroggo
2016/04/26 13:22:33
Why not for additional sample sizes? Won't we be e
msarett
2016/04/26 15:00:54
Sampling vs not-sampling will exercise different c
scroggo
2016/04/26 15:31:40
sgtm
| |
591 if (CodecSrc::kNonNative8888_Always_DstColorType == colorType && | |
592 (kPremul_SkAlphaType != alphaType || sampleSize > 2)) { | |
593 continue; | |
594 } | |
595 | |
580 push_android_codec_src(path, AndroidCodecSrc::kFullImage_Mode, c olorType, | 596 push_android_codec_src(path, AndroidCodecSrc::kFullImage_Mode, c olorType, |
581 alphaType, sampleSize); | 597 alphaType, sampleSize); |
582 if (subset) { | 598 if (subset) { |
583 push_android_codec_src(path, AndroidCodecSrc::kDivisor_Mode, colorType, | 599 push_android_codec_src(path, AndroidCodecSrc::kDivisor_Mode, colorType, |
584 alphaType, sampleSize); | 600 alphaType, sampleSize); |
585 } | 601 } |
586 } | 602 } |
587 } | 603 } |
588 } | 604 } |
589 | 605 |
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1418 #endif | 1434 #endif |
1419 } | 1435 } |
1420 } // namespace skiatest | 1436 } // namespace skiatest |
1421 | 1437 |
1422 #if !defined(SK_BUILD_FOR_IOS) | 1438 #if !defined(SK_BUILD_FOR_IOS) |
1423 int main(int argc, char** argv) { | 1439 int main(int argc, char** argv) { |
1424 SkCommandLineFlags::Parse(argc, argv); | 1440 SkCommandLineFlags::Parse(argc, argv); |
1425 return dm_main(); | 1441 return dm_main(); |
1426 } | 1442 } |
1427 #endif | 1443 #endif |
OLD | NEW |