renderer-gl: only flush damage for surfaces used in the next output repaint

Stop flushing surfaces that are put on an overlay plane on the output to
be repainted next, but that have to be painted into another output's
primary_plane.

Now that each output has its own primary_plane, and flush_damage() knows
the output that is going to be repainted, texture_used can be limited to
surfaces that will actually be used by the renderer during the following
repaint_output().

Always upload when called from gl_renderer_surface_copy_content() or
gl_renderer_create_surface() with the output parameter set to NULL.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
This commit is contained in:
Philipp Zabel 2023-07-12 09:44:36 +02:00 committed by Daniel Stone
parent 155fa3a56a
commit a401a1b247

View File

@ -2096,10 +2096,14 @@ gl_renderer_flush_damage(struct weston_surface *surface,
* We still accumulate the damage in texture_damage, and
* hold the reference to the buffer, in case the surface
* migrates back to the primary plane.
*
* When called from gl_renderer_surface_copy_content()
* or gl_renderer_create_surface(), output is NULL.
* In that case, always upload.
*/
texture_used = false;
wl_list_for_each(pnode, &surface->paint_node_list, surface_link) {
if (pnode->plane == &pnode->output->primary_plane) {
if (!output || pnode->plane == &output->primary_plane) {
texture_used = true;
break;
}