mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
sw_engine: corrected a wrong blending equation at 8 bits grayscale rle.
This commit is contained in:
parent
3a0f3536ad
commit
e9490e375c
1 changed files with 9 additions and 1 deletions
|
@ -620,7 +620,15 @@ static bool _rasterSolidRle(SwSurface* surface, const SwRleData* rle, uint8_t r,
|
||||||
//8bit grayscale
|
//8bit grayscale
|
||||||
} else if (surface->channelSize == sizeof(uint8_t)) {
|
} else if (surface->channelSize == sizeof(uint8_t)) {
|
||||||
for (uint32_t i = 0; i < rle->size; ++i, ++span) {
|
for (uint32_t i = 0; i < rle->size; ++i, ++span) {
|
||||||
rasterGrayscale8(surface->buf8, span->coverage, span->y * surface->stride + span->x, span->len);
|
if (span->coverage == 255) {
|
||||||
|
rasterGrayscale8(surface->buf8, span->coverage, span->y * surface->stride + span->x, span->len);
|
||||||
|
} else {
|
||||||
|
auto dst = &surface->buf8[span->y * surface->stride + span->x];
|
||||||
|
auto ialpha = 255 - span->coverage;
|
||||||
|
for (uint32_t x = 0; x < span->len; ++x, ++dst) {
|
||||||
|
*dst = span->coverage + MULTIPLY(*dst, ialpha);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue