backend: allocate mask only when necessary

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2022-08-26 10:41:13 +01:00
parent 5d2f8d7456
commit 483aa4347c
No known key found for this signature in database
GPG Key ID: D3A4405BE6CC17F4
1 changed files with 1 additions and 3 deletions

View File

@ -207,9 +207,7 @@ void paint_all_new(session_t *ps, struct managed_win *t, bool ignore_damage) {
auto reg_bound_no_corner =
win_get_bounding_shape_global_without_corners_by_val(w);
if (!w->mask_image) {
// TODO(yshui) only allocate a mask if the window is shaped or has
// rounded corners.
if (!w->mask_image && (w->bounding_shaped || w->corner_radius != 0)) {
win_bind_mask(ps->backend_data, w);
}