mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-07 21:23:32 +00:00
sw_engine: ++raster color accuracy
Improves the color accuracy of rasterized images by skipping the pre-multiply step when the alpha is full opaque or fully transparent. fixes: #3429
This commit is contained in:
parent
7bcee79077
commit
2990e72b23
1 changed files with 1 additions and 0 deletions
|
@ -1706,6 +1706,7 @@ void rasterPremultiply(RenderSurface* surface)
|
|||
for (uint32_t x = 0; x < surface->w; ++x, ++dst) {
|
||||
auto c = *dst;
|
||||
auto a = (c >> 24);
|
||||
if (a == 255 || a == 0) continue;
|
||||
*dst = (c & 0xff000000) + ((((c >> 8) & 0xff) * a) & 0xff00) + ((((c & 0x00ff00ff) * a) >> 8) & 0x00ff00ff);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue