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

Side by Side Diff: dm/DM.cpp

Issue 1923533002: Remove redundant tests to make DM a little faster (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | no next file » | 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 * 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
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698