1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:07:35 +00:00

WindowServer: Only register animations when they're running

This allows us to keep Animation objects around, and the compositor
will only use them when the animation is actually running.
This commit is contained in:
Tom 2023-04-03 21:29:01 -06:00 committed by Linus Groh
parent fa7f9b0f35
commit 426d1b7410
4 changed files with 36 additions and 26 deletions

View file

@ -33,18 +33,18 @@ public:
void set_duration(int duration_in_ms);
int duration() const { return m_duration; }
bool update(Badge<Compositor>, Gfx::Painter&, Screen&, Gfx::DisjointIntRectSet& flush_rects);
bool update(Gfx::Painter&, Screen&, Gfx::DisjointIntRectSet& flush_rects);
void call_stop_handler(Badge<Compositor>);
Function<void(float progress, Gfx::Painter&, Screen&, Gfx::DisjointIntRectSet& flush_rects)> on_update;
Function<void()> on_stop;
private:
Animation();
Animation() = default;
Core::ElapsedTimer m_timer;
int m_duration { 0 };
bool m_running { false };
bool m_was_removed { false };
};
}