diff options
author | emersion <contact@emersion.fr> | 2018-03-26 15:31:08 -0400 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-03-26 15:31:08 -0400 |
commit | 4555fc8a543caed15250a038e979bb24cee03a6c (patch) | |
tree | 44667d21ef6d897206661a3bb597c7a658a4c418 /include/wlr | |
parent | bcb74c2c781405149af99f66ce61b1a8f63771fd (diff) |
Fix damage tracking for rotated surfaces
It was broken because the damage extents were rotated about its
own center, not about the center of the surface.
This adds a new wlr_region_rotated_bounds that rotates regions.
This allows us to have only one code path (for both non-rotated
views and rotated views) and optimizes rendering for rotated
views.
Diffstat (limited to 'include/wlr')
-rw-r--r-- | include/wlr/types/wlr_box.h | 2 | ||||
-rw-r--r-- | include/wlr/util/region.h | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/include/wlr/types/wlr_box.h b/include/wlr/types/wlr_box.h index fc86f0ac..0e586a18 100644 --- a/include/wlr/types/wlr_box.h +++ b/include/wlr/types/wlr_box.h @@ -27,7 +27,7 @@ void wlr_box_transform(const struct wlr_box *box, struct wlr_box *dest); /** - * Creates the smallest box that contains a rotated box. + * Creates the smallest box that contains the box rotated about its center. */ void wlr_box_rotated_bounds(const struct wlr_box *box, float rotation, struct wlr_box *dest); diff --git a/include/wlr/util/region.h b/include/wlr/util/region.h index 7883af97..c0fe6063 100644 --- a/include/wlr/util/region.h +++ b/include/wlr/util/region.h @@ -26,4 +26,11 @@ void wlr_region_transform(pixman_region32_t *dst, pixman_region32_t *src, void wlr_region_expand(pixman_region32_t *dst, pixman_region32_t *src, int distance); +/* + * Builds the smallest possible region that contains the region rotated about + * the point (ox, oy). + */ +void wlr_region_rotated_bounds(pixman_region32_t *dst, pixman_region32_t *src, + float rotation, int ox, int oy); + #endif |