mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 06:11:16 +00:00
Improve colorize effect with the GL backend
As reported in issue #176 , there is a difference between the rendering with Qt and femtovg. It appears that this is due to incorrect assumptions about whether the rgb values in the intermediate buffer image for colorization have the alpha-channel pre-multiplied or not. When rendering into the image buffer, we would pre-multiply the alpha, but when rendering the buffer itself, femtovg's fragment shader would assume texture type 2 and multiply the alpha again. Therefore set the image flag to avoid that.
This commit is contained in:
parent
ce6aa06964
commit
fad4ef677f
1 changed files with 1 additions and 1 deletions
|
@ -1174,7 +1174,7 @@ impl GLItemRenderer {
|
|||
image_size.width as _,
|
||||
image_size.height as _,
|
||||
femtovg::PixelFormat::Rgba8,
|
||||
femtovg::ImageFlags::empty(),
|
||||
femtovg::ImageFlags::PREMULTIPLIED,
|
||||
)
|
||||
.expect("internal error allocating temporary texture for image colorization");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue