mirror of
https://github.com/yshui/picom.git
synced 2025-04-28 18:07:55 -04:00
types: add a scoped region_t
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
cebeb38c1c
commit
a320091753
1 changed files with 8 additions and 0 deletions
|
@ -17,6 +17,14 @@ typedef pixman_box32_t rect_t;
|
||||||
|
|
||||||
RC_TYPE(region_t, rc_region, pixman_region32_init, pixman_region32_fini, static inline)
|
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) {
|
static inline void dump_region(const region_t *x) {
|
||||||
if (log_get_level_tls() > LOG_LEVEL_TRACE) {
|
if (log_get_level_tls() > LOG_LEVEL_TRACE) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue