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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DM.cpp
diff --git a/dm/DM.cpp b/dm/DM.cpp
index e77c99c3042740aef3c304024ce0b1c18b8ee14c..9878ae8d21f6ae7181ba3fa2fb7581faaed19ec2 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -547,6 +547,14 @@ static void push_codec_srcs(Path path) {
continue;
}
+ // 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
+ // no native scale. This test won't be interestingly different with different
+ // alpha types or scales.
+ if (CodecSrc::kNonNative8888_Always_DstColorType == colorType &&
+ (kPremul_SkAlphaType != alphaType || 1.0f != scale)) {
+ continue;
+ }
+
push_codec_src(path, mode, colorType, alphaType, scale);
}
}
@@ -577,6 +585,14 @@ static void push_codec_srcs(Path path) {
for (int sampleSize : sampleSizes) {
for (CodecSrc::DstColorType colorType : colorTypes) {
for (SkAlphaType alphaType : alphaModes) {
+ // Only test kNonNative_DstColorType when the alpha type is premul and sample size
+ // is 1 or 2. This test won't be interestingly different with different
+ // 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
+ if (CodecSrc::kNonNative8888_Always_DstColorType == colorType &&
+ (kPremul_SkAlphaType != alphaType || sampleSize > 2)) {
+ continue;
+ }
+
push_android_codec_src(path, AndroidCodecSrc::kFullImage_Mode, colorType,
alphaType, sampleSize);
if (subset) {
« 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