mirror of
https://github.com/servo/servo.git
synced 2025-09-30 08:39:16 +01:00
script: Integrate animated image updates into ScriptThread
event loop (#38941)
Instead of manually triggering `ScriptThread::update_the_rendering`, have animated images trigger rendering updates via the `ScriptThread` event loop. This should result in fewer calls to `ScriptThread::update_the_rendering`. Testing: This should not change behavior and is thus covered by existing tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
parent
e7a963cca0
commit
87fe202ded
6 changed files with 90 additions and 74 deletions
|
@ -565,6 +565,12 @@ impl ScriptThread {
|
|||
self.timer_scheduler.borrow_mut().schedule_timer(request)
|
||||
}
|
||||
|
||||
/// Cancel a the [`TimerEventRequest`] for the given [`TimerId`] on this
|
||||
/// [`ScriptThread`]'s [`TimerScheduler`].
|
||||
pub(crate) fn cancel_timer(&self, timer_id: TimerId) {
|
||||
self.timer_scheduler.borrow_mut().cancel_timer(timer_id)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#await-a-stable-state
|
||||
pub(crate) fn await_stable_state(task: Microtask) {
|
||||
with_script_thread(|script_thread| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue