summaryrefslogtreecommitdiff
path: root/Userland/Services/WindowServer/Animation.cpp
AgeCommit message (Collapse)Author
2023-04-13WindowServer: Only register animations when they're runningTom
This allows us to keep Animation objects around, and the compositor will only use them when the animation is actually running.
2023-01-07Userland: Silence warnings from ElapsedTimer::elapsed() type changeAndrew Kaster
We changed elapsed() to return i64 instead of int as that's what AK::Time::to_milliseconds() returns, causing a bunch of implicit lossy conversions in callers. Clean those up with a mix of type changes and casts.
2022-10-27LibGfx+Everywhere: Make DisjointRectSet work for non-int RectsSam Atkins
For convenience, `DisjointIntRectSet` is an alias for `DisjointRectSet<int>`, and is used everywhere for now.
2022-03-18WindowServer: Fix animation crashTom
If an Animation's on_stop handler cleared itself inside the on_stop event handler, it would remove itself from the animation map that was still being iterated, leading to a crash. To solve this, we'll iterate over the animations using the remove_all_matching function, which enables us to delete it by simply returning true when the animation finished. In the event that the Animation is kept alive elsewhere and the on_stop event clears its own reference, we need to temporarily bump the reference count. Another advantage is that we only need to bump the reference count when an animation is finished, whereas before this we bumped it unconditionally.
2021-06-29WindowServer: Fix animations not triggering renderingTom
When starting the first animation and while animations are ongoing we need to make sure we trigger rendering.
2021-06-28WindowServer: Change animation time to durationErik Sommer
The time interval for animations is most often described as `duration` in animation contexts and the `WindowServer::Animation` class should reflect that.
2021-06-27WindowServer: Add a more generic mechanism for animationsAndreas Kling
This patch adds the WindowServer::Animation class, which represents a simple animation driven by the compositor. An animation has a length (in milliseconds) and two hooks: - on_update: called whenever the animation should render something. - on_stop: called when the animation is finished and/or stopped. This patch also ports the window minimization animation to this new mechanism. :^)