compositor: Move clearing of primary plane damage to the backends
Backends may move surfaces to different planes, in which case damage is
generated in the primary plane. This damage is usually passed to the
renderer, but in some cases the backend may decide to not render
anything (that's the case when drm compositor scans out a client
buffer). In that case the damage on the primary plane would be
discarded, leading to artifacts later.
This patch makes the backend's responsibility to clear the damage on
the primary plane, so that unrendered damage is kept for as long as
necessary.
diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 1ecd93c..417b67f 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -357,6 +357,9 @@
c->base.renderer->repaint_output(&output->base, damage);
+ pixman_region32_subtract(&c->base.primary_plane.damage,
+ &c->base.primary_plane.damage, damage);
+
bo = gbm_surface_lock_front_buffer(output->surface);
if (!bo) {
weston_log("failed to lock front buffer: %m\n");