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:
parent
900ecf2f15
commit
0a097ea91c
@ -121,13 +121,12 @@ bool SkImageRef::prepareBitmap(SkImageDecoder::Mode mode) {
|
|||||||
|
|
||||||
codec->setSampleSize(fSampleSize);
|
codec->setSampleSize(fSampleSize);
|
||||||
codec->setDitherImage(fDoDither);
|
codec->setDitherImage(fDoDither);
|
||||||
|
codec->setRequireUnpremultipliedColors(this->info().fAlphaType == kUnpremul_SkAlphaType);
|
||||||
if (this->onDecode(codec, fStream, &fBitmap, fBitmap.config(), mode)) {
|
if (this->onDecode(codec, fStream, &fBitmap, fBitmap.config(), mode)) {
|
||||||
if (kOpaque_SkAlphaType == fBitmap.alphaType()) {
|
if (kOpaque_SkAlphaType == fBitmap.alphaType()) {
|
||||||
this->changeAlphaType(kOpaque_SkAlphaType);
|
this->changeAlphaType(kOpaque_SkAlphaType);
|
||||||
}
|
}
|
||||||
SkASSERT(this->info().fColorType == fBitmap.colorType());
|
SkASSERT(this->info() == fBitmap.info());
|
||||||
SkASSERT(this->info().fWidth == fBitmap.width());
|
|
||||||
SkASSERT(this->info().fHeight == fBitmap.height());
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user