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
|
@ -29,7 +29,7 @@ use crate::dom::bindings::reflector::{DomGlobal, DomObject};
|
|||
use crate::dom::bindings::root::{AsHandleValue, Dom};
|
||||
use crate::dom::bindings::str::DOMString;
|
||||
use crate::dom::csp::CspReporting;
|
||||
use crate::dom::document::{ImageAnimationUpdateCallback, RefreshRedirectDue};
|
||||
use crate::dom::document::RefreshRedirectDue;
|
||||
use crate::dom::eventsource::EventSourceTimeoutCallback;
|
||||
use crate::dom::globalscope::GlobalScope;
|
||||
#[cfg(feature = "testbinding")]
|
||||
|
@ -88,7 +88,6 @@ pub(crate) enum OneshotTimerCallback {
|
|||
#[cfg(feature = "testbinding")]
|
||||
TestBindingCallback(TestBindingCallback),
|
||||
RefreshRedirectDue(RefreshRedirectDue),
|
||||
ImageAnimationUpdate(ImageAnimationUpdateCallback),
|
||||
}
|
||||
|
||||
impl OneshotTimerCallback {
|
||||
|
@ -100,7 +99,6 @@ impl OneshotTimerCallback {
|
|||
#[cfg(feature = "testbinding")]
|
||||
OneshotTimerCallback::TestBindingCallback(callback) => callback.invoke(),
|
||||
OneshotTimerCallback::RefreshRedirectDue(callback) => callback.invoke(can_gc),
|
||||
OneshotTimerCallback::ImageAnimationUpdate(callback) => callback.invoke(can_gc),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue