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

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: remove occurances of setIsOpaque 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
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/09/30 22:20:04 This should check this->getRequireUnpremultipliedC
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);
scroggo 2013/09/30 22:20:04 This should also check requireUnpremul
if (swapOnly) {
bm->swap(decodedBitmap);

Powered by Google App Engine
This is Rietveld 408576698