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

Unified Diff: src/images/SkImageDecoder_libpng.cpp

Issue 25275004: store SkAlphaType inside SkBitmap, on road to support unpremul (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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/images/SkImageDecoder_libjpeg.cpp ('k') | src/images/SkImageDecoder_libwebp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkImageDecoder_libpng.cpp
diff --git a/src/images/SkImageDecoder_libpng.cpp b/src/images/SkImageDecoder_libpng.cpp
index b6aa329104288aead5ae32f788e0f80b9aba153d..91520f2b7b1375d1e7d2352ad0eaff4bd485d7e5 100644
--- a/src/images/SkImageDecoder_libpng.cpp
+++ b/src/images/SkImageDecoder_libpng.cpp
@@ -437,7 +437,7 @@ bool SkPNGImageDecoder::onDecode(SkStream* sk_stream, SkBitmap* decodedBitmap,
// return false, since the result will have premultiplied colors.
return false;
}
- decodedBitmap->setIsOpaque(!reallyHasAlpha);
+ decodedBitmap->setAlphaType(reallyHasAlpha ? kPremul_SkAlphaType : kOpaque_SkAlphaType);
scroggo 2013/10/02 18:49:58 In addition to checking for unpremultiply, this ne
reed1 2013/10/03 08:22:54 Not sure what the change to the code should be. If
scroggo 2013/10/03 14:05:19 It doesn't currently change reallyHasAlpha, but it
reed1 2013/10/18 15:27:06 Done.
return true;
}
@@ -889,7 +889,7 @@ bool SkPNGImageDecoder::onDecodeSubset(SkBitmap* bm, const SkIRect& region) {
if (0 != theTranspColor) {
reallyHasAlpha |= substituteTranspColor(&decodedBitmap, theTranspColor);
}
- decodedBitmap.setIsOpaque(!reallyHasAlpha);
+ decodedBitmap.setAlphaType(reallyHasAlpha ? kPremul_SkAlphaType : kOpaque_SkAlphaType);
if (swapOnly) {
bm->swap(decodedBitmap);
« no previous file with comments | « src/images/SkImageDecoder_libjpeg.cpp ('k') | src/images/SkImageDecoder_libwebp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698