Fix bug in deferred decoding where we don't properly pass the unpremul option to the codec.

R=reed@google.com, scroggo@google.com

Author: djsollen@google.com

Review URL: https://codereview.chromium.org/172873003

git-svn-id: http://skia.googlecode.com/svn/trunk@13521 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
commit-bot@chromium.org 2014-02-20 21:04:40 +00:00
parent 900ecf2f15
commit 0a097ea91c

View File

@ -121,13 +121,12 @@ bool SkImageRef::prepareBitmap(SkImageDecoder::Mode mode) {
codec->setSampleSize(fSampleSize);
codec->setDitherImage(fDoDither);
codec->setRequireUnpremultipliedColors(this->info().fAlphaType == kUnpremul_SkAlphaType);
if (this->onDecode(codec, fStream, &fBitmap, fBitmap.config(), mode)) {
if (kOpaque_SkAlphaType == fBitmap.alphaType()) {
this->changeAlphaType(kOpaque_SkAlphaType);
}
SkASSERT(this->info().fColorType == fBitmap.colorType());
SkASSERT(this->info().fWidth == fBitmap.width());
SkASSERT(this->info().fHeight == fBitmap.height());
SkASSERT(this->info() == fBitmap.info());
return true;
}
}