Index: src/images/SkImageDecoder_libwebp.cpp |
diff --git a/src/images/SkImageDecoder_libwebp.cpp b/src/images/SkImageDecoder_libwebp.cpp |
index 517480665366dfa78231983e087b9a5ef8d728e6..4e23e50f5760fcf2024799265d7b4257823cf071 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, |