pixman-renderer: Use pnode precalculated region for clipped draw

Instead of using the surface rectangle and the view scissor, make a
union of the blend/opaque regions from the pnode.

This is probably measurably more math in cases with freeform window
rotations, but it helps us get weston_view out of the renderer.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2026-03-17 11:58:23 -05:00
parent 7ed55f8390
commit c91d312b32

View file

@ -394,7 +394,6 @@ draw_node_source_clipped(struct weston_paint_node *pnode,
{
struct weston_surface *surface = pnode->surface;
struct weston_output *output = pnode->output;
struct weston_view *view = pnode->view;
pixman_region32_t surf_region;
pixman_region32_t buffer_region;
pixman_region32_t repaint_output;
@ -404,11 +403,10 @@ draw_node_source_clipped(struct weston_paint_node *pnode,
* opaque separately has no benefit.
*/
pixman_region32_init_rect(&surf_region, 0, 0,
surface->width, surface->height);
if (view->geometry.scissor_enabled)
pixman_region32_intersect(&surf_region, &surf_region,
&view->geometry.scissor);
pixman_region32_init(&surf_region);
pixman_region32_union(&surf_region,
&pnode->surface_opaque,
&pnode->surface_blend);
pixman_region32_init(&buffer_region);
weston_surface_to_buffer_region(surface, &surf_region, &buffer_region);