未验证 提交 098ada53 编写于 作者: B Brian Osman 提交者: GitHub

Convert animated unpremul images to premul during decode (#8698)

Skia allows drawing unpremul images, but filtering them can look bad.
Internally Skia performs this transformation when creating SkImages from
encoded data (so this already happens for MakeCrossContextFromEncoded),
and for consistency/quality it should be done here, too.

Fixes #28785
上级 c63d1cf9
......@@ -401,7 +401,10 @@ sk_sp<SkImage> MultiFrameCodec::GetNextFrameImage(
: SkBitmap();
const bool frameAlreadyCached = bitmap.getPixels();
if (!frameAlreadyCached) {
const SkImageInfo info = codec_->getInfo().makeColorType(kN32_SkColorType);
SkImageInfo info = codec_->getInfo().makeColorType(kN32_SkColorType);
if (info.alphaType() == kUnpremul_SkAlphaType) {
info = info.makeAlphaType(kPremul_SkAlphaType);
}
bitmap.allocPixels(info);
SkCodec::Options options;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册