1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-11-11 13:51:02 -05:00

types: add a scoped region_t

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2024-05-16 20:07:25 +01:00
parent cebeb38c1c
commit a320091753
No known key found for this signature in database
GPG key ID: D3A4405BE6CC17F4

View file

@ -17,6 +17,14 @@ typedef pixman_box32_t rect_t;
RC_TYPE(region_t, rc_region, pixman_region32_init, pixman_region32_fini, static inline)
static inline void region_free(region_t *region) {
if (region) {
pixman_region32_fini(region);
}
}
#define scoped_region_t cleanup(region_free) region_t
static inline void dump_region(const region_t *x) {
if (log_get_level_tls() > LOG_LEVEL_TRACE) {
return;