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

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, 2 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 15cd1a60c0dd6dc27bf517f0a85d9453e5301e70..6787a5f80aad402f8a1c332bdb2f94b636323605 100644
--- a/src/images/SkImageDecoder.cpp
+++ b/src/images/SkImageDecoder.cpp
@@ -245,8 +245,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() ?
scroggo 2013/10/18 19:32:40 src->alphaType()
+ 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