Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 5223243

Browse files
brianosmanSkia Commit-Bot
authored andcommitted
Fix alpha type when doing GPU color space conversion of unpremul images
Fixes fringing seen on bottom row of https://gold.skia.org/detail?test=makecolorspace&digest=eccdd2a952d9503734b35b3a725a18b2 Change-Id: I4d05a2edab99dc989f4088d38a13827384f0444a Reviewed-on: https://skia-review.googlesource.com/150121 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
1 parent 7c8d2e9 commit 5223243

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/image/SkImage_Gpu.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,9 +970,11 @@ sk_sp<SkImage> SkImage_Gpu::onMakeColorSpace(sk_sp<SkColorSpace> target, SkColor
970970
return nullptr;
971971
}
972972

973+
SkAlphaType newAlphaType = (kUnpremul_SkAlphaType == fAlphaType) ? kPremul_SkAlphaType
974+
: fAlphaType;
973975
// MDB: this call is okay bc we know 'renderTargetContext' was exact
974976
return sk_make_sp<SkImage_Gpu>(fContext, kNeedNewImageUniqueID,
975-
fAlphaType, renderTargetContext->asTextureProxyRef(),
977+
newAlphaType, renderTargetContext->asTextureProxyRef(),
976978
std::move(target), fBudgeted);
977979

978980
}

0 commit comments

Comments
 (0)