gl-renderer: Calculate opaque region before blended

Just moving things around for now.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2024-06-06 12:12:52 -05:00 committed by Marius Vlad
parent 38487ec7e5
commit 3538466083
1 changed files with 9 additions and 9 deletions

View File

@ -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)) {