Index: src/images/SkImageDecoder_libwebp.cpp |
diff --git a/src/images/SkImageDecoder_libwebp.cpp b/src/images/SkImageDecoder_libwebp.cpp |
index 49d5bd1cca079653a3d7f014d300bb2638671b3c..02990258ebe84dbce0f46c5436a95b24b8bfe8b2 100644 |
--- a/src/images/SkImageDecoder_libwebp.cpp |
+++ b/src/images/SkImageDecoder_libwebp.cpp |
@@ -298,8 +298,20 @@ bool SkWEBPImageDecoder::setDecodeConfig(SkBitmap* decodedBitmap, |
return false; |
} |
- return decodedBitmap->setConfig(config, width, height, 0, |
- fHasAlpha ? kPremul_SkAlphaType : kOpaque_SkAlphaType); |
+ SkImageInfo info; |
+ info.fWidth = width; |
+ info.fHeight = height; |
+ info.fColorType = SkBitmapConfigToColorType(config); |
+ if (SkToBool(fHasAlpha)) { |
+ if (this->getRequireUnpremultipliedColors()) { |
+ info.fAlphaType = kUnpremul_SkAlphaType; |
+ } else { |
+ info.fAlphaType = kPremul_SkAlphaType; |
+ } |
+ } else { |
+ info.fAlphaType = kOpaque_SkAlphaType; |
+ } |
+ return decodedBitmap->setConfig(info); |
} |
bool SkWEBPImageDecoder::onBuildTileIndex(SkStreamRewindable* stream, |