1
0
Fork 0
forked from wry/wry

theme: add support for alpha modes

This commit is contained in:
Julian Orth 2026-02-21 14:14:45 +01:00
parent c6db02a43d
commit 37674a229c
5 changed files with 93 additions and 34 deletions

View file

@ -1,6 +1,6 @@
use {
crate::{
gfx_api::{AcquireSync, GfxApiOpt, ReleaseSync, SampleRect},
gfx_api::{AcquireSync, AlphaMode, GfxApiOpt, ReleaseSync, SampleRect},
icons::{IconState, SizedIcons},
ifs::wl_surface::{
SurfaceBuffer, WlSurface,
@ -493,8 +493,13 @@ impl Renderer<'_> {
Some(bounds) => rect.intersect(*bounds),
};
if !rect.is_empty() {
let color = Color::from_u32_premultiplied(
cd.eotf, color[0], color[1], color[2], color[3],
let color = Color::from_u32(
cd.eotf,
AlphaMode::PremultipliedElectrical,
color[0],
color[1],
color[2],
color[3],
);
self.base.sync();
self.base