diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-02-09 09:38:48 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-09 09:38:48 -0500 |
commit | 34489dca16ef9e7fd05c161b8b4f2fd5ce5e4ef0 (patch) | |
tree | 2a90beb98aacd85bbc5bd30df998b4e7c92ec3e7 /include/wlr/util | |
parent | 09c2626e32fd0eadc4b95a4f36b34f6bde79f6f4 (diff) | |
parent | cdd55b5d19470981ad71f8e6d31bd8152e44364b (diff) |
Merge pull request #571 from emersion/output-damage
Output damage tracking
Diffstat (limited to 'include/wlr/util')
-rw-r--r-- | include/wlr/util/region.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/wlr/util/region.h b/include/wlr/util/region.h new file mode 100644 index 00000000..7883af97 --- /dev/null +++ b/include/wlr/util/region.h @@ -0,0 +1,29 @@ +#ifndef WLR_UTIL_REGION_H +#define WLR_UTIL_REGION_H + +#include <pixman.h> +#include <wayland-server.h> + +/** + * Scales a region, ie. multiplies all its coordinates by `scale`. + * + * The resulting coordinates are rounded up or down so that the new region is + * at least as big as the original one. + */ +void wlr_region_scale(pixman_region32_t *dst, pixman_region32_t *src, + float scale); + +/** + * Applies a transform to a region inside a box of size `width` x `height`. + */ +void wlr_region_transform(pixman_region32_t *dst, pixman_region32_t *src, + enum wl_output_transform transform, int width, int height); + +/** + * Expands the region of `distance`. If `distance` is negative, it shrinks the + * region. + */ +void wlr_region_expand(pixman_region32_t *dst, pixman_region32_t *src, + int distance); + +#endif |