gl-renderer: Set blend func once per output repaint

The blending func is constant across the entire renderer. This commit
sets it once per output repaint instead of once per view repaint.

Signed-off-by: Loïc Molinari <loic.molinari@gmail.com>
This commit is contained in:
Loïc Molinari 2023-01-03 19:30:24 +01:00 committed by Derek Foreman
parent fc8d260ce3
commit 4669a0897f

View File

@ -1166,8 +1166,6 @@ draw_paint_node(struct weston_paint_node *pnode,
if (ensure_surface_buffer_is_ready(gr, gs) < 0)
goto out;
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
if (pnode->needs_filtering)
filter = GL_LINEAR;
else
@ -1236,6 +1234,8 @@ repaint_views(struct weston_output *output, pixman_region32_t *damage)
struct weston_compositor *compositor = output->compositor;
struct weston_paint_node *pnode;
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
wl_list_for_each_reverse(pnode, &output->paint_node_z_order_list,
z_order_link) {
if (pnode->view->plane == &compositor->primary_plane)