aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2019-04-25 19:49:59 +0300
committerDrew DeVault <sir@cmpwn.com>2019-04-26 10:08:08 -0600
commit1dbece74fb9f903f9c1bbfc14380c66e85ccc1ec (patch)
treeb940f903554831c5be2fa8dbcdcc2a8285bb882c
parent57d32d03a87ab4a74230294cefc5fa8b1e28c96d (diff)
output: disambiguate the two types of damage
See https://github.com/swaywm/wlroots/issues/1665
-rw-r--r--include/wlr/types/wlr_output.h7
-rw-r--r--include/wlr/types/wlr_output_damage.h6
2 files changed, 11 insertions, 2 deletions
diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h
index fb21e913..a526b0cf 100644
--- a/include/wlr/types/wlr_output.h
+++ b/include/wlr/types/wlr_output.h
@@ -222,11 +222,16 @@ bool wlr_output_attach_render(struct wlr_output *output, int *buffer_age);
bool wlr_output_preferred_read_format(struct wlr_output *output,
enum wl_shm_format *fmt);
/**
- * Set the damage region for the frame to be submitted.
+ * Set the damage region for the frame to be submitted. This is the region of
+ * the screen that has changed since the last frame.
*
* Compositors implementing damage tracking should call this function with the
* damaged region in output-buffer-local coordinates (ie. scaled and
* transformed).
+ *
+ * This region is not to be confused with the renderer's buffer damage, ie. the
+ * region compositors need to repaint. Compositors usually need to repaint more
+ * than what changed since last frame since multiple render buffers are used.
*/
void wlr_output_set_damage(struct wlr_output *output,
pixman_region32_t *damage);
diff --git a/include/wlr/types/wlr_output_damage.h b/include/wlr/types/wlr_output_damage.h
index 43db717b..708ee9b6 100644
--- a/include/wlr/types/wlr_output_damage.h
+++ b/include/wlr/types/wlr_output_damage.h
@@ -66,9 +66,13 @@ void wlr_output_damage_destroy(struct wlr_output_damage *output_damage);
* `needs_frame` will be set to true if a frame should be submitted. `damage`
* will be set to the region of the output that needs to be repainted, in
* output-buffer-local coordinates.
+ *
+ * The buffer damage region accumulates all damage since the buffer has last
+ * been swapped. This is not to be confused with the output surface damage,
+ * which only contains the changes between two frames.
*/
bool wlr_output_damage_attach_render(struct wlr_output_damage *output_damage,
- bool *needs_frame, pixman_region32_t *damage);
+ bool *needs_frame, pixman_region32_t *buffer_damage);
/**
* Accumulates damage and schedules a `frame` event.
*/