From 35384660832652fe71a9c1ab46a667bb5f2e6724 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Thu, 6 Jun 2024 12:12:52 -0500 Subject: [PATCH] gl-renderer: Calculate opaque region before blended Just moving things around for now. Signed-off-by: Derek Foreman --- libweston/renderer-gl/gl-renderer.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c index 7837f53e..ab921edf 100644 --- a/libweston/renderer-gl/gl-renderer.c +++ b/libweston/renderer-gl/gl-renderer.c @@ -1589,15 +1589,6 @@ draw_paint_node(struct weston_paint_node *pnode, if (!gl_shader_config_init_for_paint_node(&sconf, pnode, filter)) goto out; - /* blended region is whole surface minus opaque region: */ - pixman_region32_init_rect(&surface_blend, 0, 0, - pnode->surface->width, pnode->surface->height); - if (pnode->view->geometry.scissor_enabled) - pixman_region32_intersect(&surface_blend, &surface_blend, - &pnode->view->geometry.scissor); - pixman_region32_subtract(&surface_blend, &surface_blend, - &pnode->surface->opaque); - /* XXX: Should we be using ev->transform.opaque here? */ pixman_region32_init(&surface_opaque); if (pnode->view->geometry.scissor_enabled) @@ -1607,6 +1598,15 @@ draw_paint_node(struct weston_paint_node *pnode, else pixman_region32_copy(&surface_opaque, &pnode->surface->opaque); + /* blended region is whole surface minus opaque region: */ + pixman_region32_init_rect(&surface_blend, 0, 0, + pnode->surface->width, pnode->surface->height); + if (pnode->view->geometry.scissor_enabled) + pixman_region32_intersect(&surface_blend, &surface_blend, + &pnode->view->geometry.scissor); + pixman_region32_subtract(&surface_blend, &surface_blend, + &pnode->surface->opaque); + maybe_replace_paint_node(&sconf, pnode); if (pixman_region32_not_empty(&surface_opaque)) {