aboutsummaryrefslogtreecommitdiffstats
path: root/components/compositing
diff options
context:
space:
mode:
Diffstat (limited to 'components/compositing')
-rw-r--r--components/compositing/constellation.rs5
-rw-r--r--components/compositing/pipeline.rs10
2 files changed, 15 insertions, 0 deletions
diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs
index dedf6e07b5e..daf2cb2503d 100644
--- a/components/compositing/constellation.rs
+++ b/components/compositing/constellation.rs
@@ -834,6 +834,8 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
pipeline.clone(),
parent.borrow().clone())),
NavigationType::Load);
+ // Send message to ScriptTask that will suspend all timers
+ source_frame.pipeline.borrow().freeze();
self.pipelines.insert(pipeline.id, pipeline);
}
@@ -853,6 +855,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
let old = self.current_frame().as_ref().unwrap();
for frame in old.iter() {
frame.pipeline.borrow().revoke_paint_permission();
+ frame.pipeline.borrow().freeze();
}
}
self.navigation_context.forward(&mut *self.compositor_proxy)
@@ -865,6 +868,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
let old = self.current_frame().as_ref().unwrap();
for frame in old.iter() {
frame.pipeline.borrow().revoke_paint_permission();
+ frame.pipeline.borrow().freeze();
}
}
self.navigation_context.back(&mut *self.compositor_proxy)
@@ -873,6 +877,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
for frame in destination_frame.iter() {
frame.pipeline.borrow().load();
+ frame.pipeline.borrow().thaw();
}
self.send_frame_tree_and_grant_paint_permission(destination_frame);
diff --git a/components/compositing/pipeline.rs b/components/compositing/pipeline.rs
index 9bb29db622f..27ee5eba150 100644
--- a/components/compositing/pipeline.rs
+++ b/components/compositing/pipeline.rs
@@ -191,6 +191,16 @@ impl Pipeline {
}
+ pub fn freeze(&self) {
+ let ScriptControlChan(ref script_channel) = self.script_chan;
+ let _ = script_channel.send(ConstellationControlMsg::Freeze(self.id)).unwrap();
+ }
+
+ pub fn thaw(&self) {
+ let ScriptControlChan(ref script_channel) = self.script_chan;
+ let _ = script_channel.send(ConstellationControlMsg::Thaw(self.id)).unwrap();
+ }
+
pub fn force_exit(&self) {
let ScriptControlChan(ref script_channel) = self.script_chan;
let _ = script_channel.send(