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); |