opt: optimize shadow node and blur node enable
This commit is contained in:
@@ -259,8 +259,12 @@ void client_draw_shadow(Client *c) {
|
||||
return;
|
||||
|
||||
if (!shadows || (!c->isfloating && shadow_only_floating)) {
|
||||
wlr_scene_shadow_set_size(c->shadow, 0, 0);
|
||||
if (c->shadow->node.enabled)
|
||||
wlr_scene_node_set_enabled(&c->shadow->node, false);
|
||||
return;
|
||||
} else {
|
||||
if (c->scene_surface->node.enabled && !c->shadow->node.enabled)
|
||||
wlr_scene_node_set_enabled(&c->shadow->node, true);
|
||||
}
|
||||
|
||||
bool hit_no_border = check_hit_no_border(c);
|
||||
@@ -351,9 +355,14 @@ void client_draw_shadow(Client *c) {
|
||||
|
||||
void client_draw_blur(Client *c, struct wlr_box clip_box, struct ivec2 offset) {
|
||||
if (blur && !c->noblur) {
|
||||
if (c->scene_surface->node.enabled && !c->blur->node.enabled)
|
||||
wlr_scene_node_set_enabled(&c->blur->node, true);
|
||||
wlr_scene_node_set_position(&c->blur->node, offset.x, offset.y);
|
||||
wlr_scene_blur_set_size(c->blur, clip_box.width - c->bw,
|
||||
clip_box.height - c->bw);
|
||||
} else {
|
||||
if (c->blur->node.enabled)
|
||||
wlr_scene_node_set_enabled(&c->blur->node, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user