surface: fix non-buffer damage handling

This commit fixes the way the damage that doesn't come directly from the
client is handled.
This commit is contained in:
Kirill Primak 2021-12-04 20:05:32 +03:00 committed by Simon Ser
parent df7d280343
commit 7964bdae76
2 changed files with 44 additions and 76 deletions

View file

@ -111,6 +111,11 @@ struct wlr_surface {
* positions need to be damaged.
*/
pixman_region32_t buffer_damage;
/**
* The last commit's damage caused by surface and its subsurfaces'
* movement, in surface-local coordinates.
*/
pixman_region32_t external_damage;
/**
* The current opaque region, in surface-local coordinates. It is clipped to
* the surface bounds. If the surface's buffer is using a fully opaque
@ -273,9 +278,10 @@ void wlr_surface_for_each_surface(struct wlr_surface *surface,
wlr_surface_iterator_func_t iterator, void *user_data);
/**
* Get the effective damage to the surface in terms of surface local
* coordinates. This includes damage induced by resizing and moving the
* surface. The damage is not expected to be bounded by the surface itself.
* Get the effective surface damage in surface-local coordinate space. Besides
* buffer damage, this includes damage induced by resizing and moving the
* surface and its subsurfaces. The resulting damage is not expected to be
* bounded by the surface itself.
*/
void wlr_surface_get_effective_damage(struct wlr_surface *surface,
pixman_region32_t *damage);