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

Unified Diff: src/images/SkImageDecoder_libjpeg.cpp

Issue 19613002: A8 bitmaps from JPEG are not opaque. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 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: src/images/SkImageDecoder_libjpeg.cpp
diff --git a/src/images/SkImageDecoder_libjpeg.cpp b/src/images/SkImageDecoder_libjpeg.cpp
index e4d7ace0d48295d32c98ba4805909a2204e69afc..0a016e5cd2daae89222ae53f8e6754df579dc7b3 100644
--- a/src/images/SkImageDecoder_libjpeg.cpp
+++ b/src/images/SkImageDecoder_libjpeg.cpp
@@ -333,7 +333,7 @@ bool SkJPEGImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) {
if (1 == sampleSize && SkImageDecoder::kDecodeBounds_Mode == mode) {
bm->setConfig(config, cinfo.image_width, cinfo.image_height);
- bm->setIsOpaque(true);
+ bm->setIsOpaque(config != SkBitmap::kA8_Config);
return true;
}
@@ -355,7 +355,7 @@ bool SkJPEGImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) {
SkScaledBitmapSampler smpl(cinfo.output_width, cinfo.output_height,
recompute_sampleSize(sampleSize, cinfo));
bm->setConfig(config, smpl.scaledWidth(), smpl.scaledHeight());
- bm->setIsOpaque(true);
+ bm->setIsOpaque(config != SkBitmap::kA8_Config);
return true;
} else {
return return_false(cinfo, *bm, "start_decompress");
@@ -370,7 +370,7 @@ bool SkJPEGImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) {
SkScaledBitmapSampler sampler(cinfo.output_width, cinfo.output_height, sampleSize);
bm->setConfig(config, sampler.scaledWidth(), sampler.scaledHeight());
- bm->setIsOpaque(true);
+ bm->setIsOpaque(config != SkBitmap::kA8_Config);
if (SkImageDecoder::kDecodeBounds_Mode == mode) {
return true;
}
« 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