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

Unified Diff: src/images/SkImageDecoder.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
Index: src/images/SkImageDecoder.cpp
diff --git a/src/images/SkImageDecoder.cpp b/src/images/SkImageDecoder.cpp
index 1544edf366bca7939bebae7faa1faaef536dec06..52a445c78277f78e360e3c2889f5a13da5da13b3 100644
--- a/src/images/SkImageDecoder.cpp
+++ b/src/images/SkImageDecoder.cpp
@@ -242,8 +242,8 @@ bool SkImageDecoder::cropBitmap(SkBitmap *dst, SkBitmap *src, int sampleSize,
}
// if the destination has no pixels then we must allocate them.
if (dst->isNull()) {
- dst->setConfig(src->getConfig(), w, h);
- dst->setIsOpaque(src->isOpaque());
+ dst->setConfig(src->getConfig(), w, h, 0, src->isOpaque() ?
+ kOpaque_SkAlphaType : kPremul_SkAlphaType);
if (!this->allocPixelRef(dst, NULL)) {
SkDEBUGF(("failed to allocate pixels needed to crop the bitmap"));

Powered by Google App Engine
This is Rietveld 408576698