mirror of
https://github.com/servo/servo.git
synced 2025-08-08 23:15:33 +01:00
Send idle messages as part of messaging loop
This commit is contained in:
parent
f5472c1295
commit
31096e1a0f
3 changed files with 18 additions and 6 deletions
|
@ -3723,12 +3723,7 @@ impl Document {
|
||||||
receiver.recv().unwrap();
|
receiver.recv().unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
let result = self.window().reflow(ReflowGoal::UpdateTheRendering, can_gc);
|
self.window().reflow(ReflowGoal::UpdateTheRendering, can_gc)
|
||||||
|
|
||||||
self.window()
|
|
||||||
.maybe_send_idle_document_state_to_constellation();
|
|
||||||
|
|
||||||
result
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn id_map(&self) -> Ref<HashMapTracedValues<Atom, Vec<Dom<Element>>>> {
|
pub(crate) fn id_map(&self) -> Ref<HashMapTracedValues<Atom, Vec<Dom<Element>>>> {
|
||||||
|
|
|
@ -2345,6 +2345,10 @@ impl Window {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if self.Document().needs_rendering_update() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// When all these conditions are met, notify the constellation
|
// When all these conditions are met, notify the constellation
|
||||||
// that this pipeline is ready to write the image (from the script thread
|
// that this pipeline is ready to write the image (from the script thread
|
||||||
// perspective at least).
|
// perspective at least).
|
||||||
|
|
|
@ -1437,6 +1437,18 @@ impl ScriptThread {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn maybe_send_idle_document_state_to_constellation(&self) {
|
||||||
|
if !opts::get().wait_for_stable_image {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (_, document) in self.documents.borrow().iter() {
|
||||||
|
document
|
||||||
|
.window()
|
||||||
|
.maybe_send_idle_document_state_to_constellation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Handle incoming messages from other tasks and the task queue.
|
/// Handle incoming messages from other tasks and the task queue.
|
||||||
fn handle_msgs(&self, can_gc: CanGc) -> bool {
|
fn handle_msgs(&self, can_gc: CanGc) -> bool {
|
||||||
// Proritize rendering tasks and others, and gather all other events as `sequential`.
|
// Proritize rendering tasks and others, and gather all other events as `sequential`.
|
||||||
|
@ -1647,6 +1659,7 @@ impl ScriptThread {
|
||||||
}
|
}
|
||||||
|
|
||||||
self.maybe_schedule_rendering_opportunity_after_ipc_message(can_gc);
|
self.maybe_schedule_rendering_opportunity_after_ipc_message(can_gc);
|
||||||
|
self.maybe_send_idle_document_state_to_constellation();
|
||||||
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue