workspace: Don't do checks in animateAllocation()

These checks aren't needed since Clutter should enforce this for us
already and skip the implicit transition when possible. This gets our
time spent in vfunc_allocate() down to 2.0 ms with 20 windows

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1743>
This commit is contained in:
Jonas Dreßler 2021-02-25 11:57:22 +01:00 committed by Marge Bot
parent 3e9a08a2e1
commit ec4b9b8894

View File

@ -382,13 +382,6 @@ var UnalignedLayoutStrategy = class extends LayoutStrategy {
}; };
function animateAllocation(actor, box) { function animateAllocation(actor, box) {
if (actor.allocation.equal(box) ||
actor.allocation.get_width() === 0 ||
actor.allocation.get_height() === 0) {
actor.allocate(box);
return null;
}
actor.save_easing_state(); actor.save_easing_state();
actor.set_easing_mode(Clutter.AnimationMode.EASE_OUT_QUAD); actor.set_easing_mode(Clutter.AnimationMode.EASE_OUT_QUAD);
actor.set_easing_duration(200); actor.set_easing_duration(200);