mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
sw_engine: fix _rasterDirectImage
Since the source buffer is 32 bits, not 8 bits, both alpha and inverse alpha need to be calculated.
This commit is contained in:
parent
9ce784751c
commit
fa49f14412
1 changed files with 2 additions and 2 deletions
|
@ -1170,11 +1170,11 @@ static bool _rasterDirectImage(SwSurface* surface, const SwImage* image, const S
|
||||||
auto src = sbuffer;
|
auto src = sbuffer;
|
||||||
if (opacity == 255) {
|
if (opacity == 255) {
|
||||||
for (auto x = region.min.x; x < region.max.x; ++x, ++dst, ++src) {
|
for (auto x = region.min.x; x < region.max.x; ++x, ++dst, ++src) {
|
||||||
*dst = *src + MULTIPLY(*dst, ~*src);
|
*dst = *src + MULTIPLY(*dst, IA(*src));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (auto x = region.min.x; x < region.max.x; ++x, ++dst, ++src) {
|
for (auto x = region.min.x; x < region.max.x; ++x, ++dst, ++src) {
|
||||||
*dst = INTERPOLATE8(*src, *dst, opacity);
|
*dst = INTERPOLATE8(A(*src), *dst, opacity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue