use colortypes instead of bitmap::config
BUG=skia: Review URL: https://codereview.chromium.org/177823002 git-svn-id: http://skia.googlecode.com/svn/trunk@13558 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
6ebfbf9968
commit
e9336aa216
@ -186,7 +186,7 @@ bool SkImageDecoder_WIC::decodeStream(SkStream* stream, SkBitmap* bm, WICModes w
|
||||
|
||||
//Exit early if we're only looking for the bitmap bounds.
|
||||
if (SUCCEEDED(hr)) {
|
||||
bm->setConfig(SkBitmap::kARGB_8888_Config, width, height);
|
||||
bm->setConfig(SkImageInfo::MakeN32Premul(width, height));
|
||||
if (kDecodeBounds_WICMode == wicMode) {
|
||||
return true;
|
||||
}
|
||||
@ -306,10 +306,10 @@ bool SkImageEncoder_WIC::onEncode(SkWStream* stream
|
||||
//Convert to 8888 if needed.
|
||||
const SkBitmap* bitmap;
|
||||
SkBitmap bitmapCopy;
|
||||
if (SkBitmap::kARGB_8888_Config == bitmapOrig.config() && bitmapOrig.isOpaque()) {
|
||||
if (kPMColor_SkColorType == bitmapOrig.colorType() && bitmapOrig.isOpaque()) {
|
||||
bitmap = &bitmapOrig;
|
||||
} else {
|
||||
if (!bitmapOrig.copyTo(&bitmapCopy, SkBitmap::kARGB_8888_Config)) {
|
||||
if (!bitmapOrig.copyTo(&bitmapCopy, kPMColor_SkColorType)) {
|
||||
return false;
|
||||
}
|
||||
bitmap = &bitmapCopy;
|
||||
|
Loading…
Reference in New Issue
Block a user