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

Unified Diff: src/codec/SkJpegCodec.cpp

Issue 1641273003: Support decoding opaque to *premul (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update SkMaskSwizzler to support opaque to premul Created 4 years, 11 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
Index: src/codec/SkJpegCodec.cpp
diff --git a/src/codec/SkJpegCodec.cpp b/src/codec/SkJpegCodec.cpp
index 50db897a8ee7fb2bc7e26e36407ff93385ddc41c..b834ecbafe5596ead625ffb21b7d8ec7383798f2 100644
--- a/src/codec/SkJpegCodec.cpp
+++ b/src/codec/SkJpegCodec.cpp
@@ -164,11 +164,15 @@ bool SkJpegCodec::setOutputColorSpace(const SkImageInfo& dst) {
return false;
}
- // Ensure that the alpha type is opaque
- if (kOpaque_SkAlphaType != dst.alphaType()) {
+ if (kUnknown_SkAlphaType == dst.alphaType()) {
return false;
}
+ if (kOpaque_SkAlphaType != dst.alphaType()) {
+ SkCodecPrintf("Warning: an opaque image should be decoded as opaque "
+ "- it is being decoded as non-opaque, which will draw slower\n");
+ }
+
// Check if we will decode to CMYK because a conversion to RGBA is not supported
J_COLOR_SPACE colorSpace = fDecoderMgr->dinfo()->jpeg_color_space;
bool isCMYK = JCS_CMYK == colorSpace || JCS_YCCK == colorSpace;

Powered by Google App Engine
This is Rietveld 408576698