mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-11-09 13:29:54 -05:00
opt: optimize none animation fram draw
This commit is contained in:
parent
03d3f992f2
commit
402ca532b7
2 changed files with 8 additions and 2 deletions
|
|
@ -721,9 +721,12 @@ void client_commit(Client *c) {
|
||||||
// 如果动画没有开始,且被判定为不应该动画,
|
// 如果动画没有开始,且被判定为不应该动画,
|
||||||
// 则设置总帧数为1,不然其他地方一旦获取动画
|
// 则设置总帧数为1,不然其他地方一旦获取动画
|
||||||
// 进度,总帧数作为分母会造成除零
|
// 进度,总帧数作为分母会造成除零
|
||||||
if (!c->animation.running)
|
// 比如动画类型为none的时候
|
||||||
|
if (!c->animation.running) {
|
||||||
|
c->animation.passed_frames = 1;
|
||||||
c->animation.total_frames = 1;
|
c->animation.total_frames = 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// 请求刷新屏幕
|
// 请求刷新屏幕
|
||||||
wlr_output_schedule_frame(c->mon->wlr_output);
|
wlr_output_schedule_frame(c->mon->wlr_output);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -491,9 +491,12 @@ void layer_commit(LayerSurface *l) {
|
||||||
// 如果动画没有开始,且被判定为不应该动画,
|
// 如果动画没有开始,且被判定为不应该动画,
|
||||||
// 则设置总帧数为1,不然其他地方一旦获取动画
|
// 则设置总帧数为1,不然其他地方一旦获取动画
|
||||||
// 进度,总帧数作为分母会造成除零
|
// 进度,总帧数作为分母会造成除零
|
||||||
if (!l->animation.running)
|
// 比如动画类型为none的时候
|
||||||
|
if (!l->animation.running) {
|
||||||
|
l->animation.passed_frames = 1;
|
||||||
l->animation.total_frames = 1;
|
l->animation.total_frames = 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// 请求刷新屏幕
|
// 请求刷新屏幕
|
||||||
wlr_output_schedule_frame(l->mon->wlr_output);
|
wlr_output_schedule_frame(l->mon->wlr_output);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue