From 4555fc8a543caed15250a038e979bb24cee03a6c Mon Sep 17 00:00:00 2001 From: emersion Date: Mon, 26 Mar 2018 15:31:08 -0400 Subject: 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. --- include/wlr/util/region.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/wlr/util/region.h') 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 -- cgit v1.2.3