Age | Commit message (Collapse) | Author |
|
This allows us to keep Animation objects around, and the compositor
will only use them when the animation is actually running.
|
|
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.
|
|
For convenience, `DisjointIntRectSet` is an alias for
`DisjointRectSet<int>`, and is used everywhere for now.
|
|
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.
|
|
When starting the first animation and while animations are ongoing we
need to make sure we trigger rendering.
|
|
The time interval for animations is most often described as `duration`
in animation contexts and the `WindowServer::Animation` class
should reflect that.
|
|
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. :^)
|