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

Unified Diff: dm/DM.cpp

Issue 1999593003: Only decode opaque to premul in DM image (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Don't decode opaque to unpremul, either Created 4 years, 7 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 bb536382d3444354626ca799be1024262776ec34..d35787e1c75d4a6492b7b5d16080e97d67fc6283 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -373,9 +373,6 @@ static void push_codec_src(Path path, CodecSrc::Mode mode, CodecSrc::DstColorTyp
}
switch (dstAlphaType) {
- case kOpaque_SkAlphaType:
- folder.append("_opaque");
- break;
case kPremul_SkAlphaType:
folder.append("_premul");
break;
@@ -414,9 +411,6 @@ static void push_android_codec_src(Path path, CodecSrc::DstColorType dstColorTyp
}
switch (dstAlphaType) {
- case kOpaque_SkAlphaType:
- folder.append("_opaque");
- break;
case kPremul_SkAlphaType:
folder.append("_premul");
break;
@@ -524,18 +518,17 @@ static void push_codec_srcs(Path path) {
SkTArray<SkAlphaType> alphaModes;
alphaModes.push_back(kPremul_SkAlphaType);
- alphaModes.push_back(kUnpremul_SkAlphaType);
- if (codec->getInfo().alphaType() == kOpaque_SkAlphaType) {
- alphaModes.push_back(kOpaque_SkAlphaType);
+ if (codec->getInfo().alphaType() != kOpaque_SkAlphaType) {
+ alphaModes.push_back(kUnpremul_SkAlphaType);
}
for (CodecSrc::Mode mode : nativeModes) {
for (CodecSrc::DstColorType colorType : colorTypes) {
for (SkAlphaType alphaType : alphaModes) {
- // Only test kCroppedScanline_Mode when the alpha type is opaque. The test is
+ // Only test kCroppedScanline_Mode when the alpha type is premul. The test is
// slow and won't be interestingly different with different alpha types.
if (CodecSrc::kCroppedScanline_Mode == mode &&
- kOpaque_SkAlphaType != alphaType) {
+ kPremul_SkAlphaType != alphaType) {
continue;
}
« 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