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

Unified Diff: src/codec/SkCodecPriv.h

Issue 1695473002: Fix colorType/alphaType checks in SkCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 10 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 | « src/codec/SkCodec.cpp ('k') | src/codec/SkGifCodec.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkCodecPriv.h
diff --git a/src/codec/SkCodecPriv.h b/src/codec/SkCodecPriv.h
index 235c4e24aff3bcbc56787487824170c33f6fd4fa..5d66118943b19717c288adbc29bed1b7ed4d4e7e 100644
--- a/src/codec/SkCodecPriv.h
+++ b/src/codec/SkCodecPriv.h
@@ -136,7 +136,12 @@ inline bool conversion_possible(const SkImageInfo& dst, const SkImageInfo& src)
case kN32_SkColorType:
return true;
case kRGB_565_SkColorType:
- return src.alphaType() == kOpaque_SkAlphaType;
+ return kOpaque_SkAlphaType == dst.alphaType();
+ case kGray_8_SkColorType:
+ if (kOpaque_SkAlphaType != dst.alphaType()) {
+ return false;
+ }
+ // Fall through
default:
return dst.colorType() == src.colorType();
}
« no previous file with comments | « src/codec/SkCodec.cpp ('k') | src/codec/SkGifCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698