1
0
Fork 0
forked from wry/wry

wl_surface: handle buffer release automatically

This commit is contained in:
Julian Orth 2026-02-28 02:19:45 +01:00
parent 6bdd1ff6e7
commit 8f576f498e
5 changed files with 51 additions and 34 deletions

View file

@ -468,10 +468,11 @@ impl Renderer<'_> {
tsize: (i32, i32),
bounds: Option<&Rect>,
) {
let buf = &buffer.buffer.buf;
let alpha = surface.alpha();
let cd = surface.color_description();
let alpha_mode = surface.alpha_mode();
if let Some(tex) = buffer.buffer.get_texture(surface) {
if let Some(tex) = buf.get_texture(surface) {
let mut opaque = surface.opaque();
if !opaque && tex.format().has_alpha {
opaque = self.bounds_are_opaque(x, y, bounds, surface);
@ -492,7 +493,7 @@ impl Renderer<'_> {
&cd,
alpha_mode,
);
} else if let Some(color) = &buffer.buffer.color {
} else if let Some(color) = &buf.color {
if let Some(rect) = Rect::new_sized(x, y, tsize.0, tsize.1) {
let rect = match bounds {
None => rect,