aboutsummaryrefslogtreecommitdiffstats
path: root/components/compositing
diff options
context:
space:
mode:
Diffstat (limited to 'components/compositing')
-rw-r--r--components/compositing/compositor.rs4
-rw-r--r--components/compositing/compositor_layer.rs8
-rw-r--r--components/compositing/constellation.rs14
-rw-r--r--components/compositing/pipeline.rs12
4 files changed, 20 insertions, 18 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs
index bec2d3a009c..b4dd37a2915 100644
--- a/components/compositing/compositor.rs
+++ b/components/compositing/compositor.rs
@@ -28,7 +28,7 @@ use layers::scene::Scene;
use png;
use gleam::gl::types::{GLint, GLsizei};
use gleam::gl;
-use script_traits::{ViewportMsg, ScriptControlChan};
+use script_traits::{ConstellationControlMsg, ScriptControlChan};
use servo_msg::compositor_msg::{Blank, Epoch, FinishedLoading, LayerId};
use servo_msg::compositor_msg::{ReadyState, PaintState, Scrollable};
use servo_msg::constellation_msg::{mod, ConstellationChan};
@@ -977,7 +977,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
layer.bounds.borrow().size.to_untyped());
let pipeline = &layer.extra_data.borrow().pipeline;
let ScriptControlChan(ref chan) = pipeline.script_chan;
- chan.send(ViewportMsg(pipeline.id.clone(), layer_rect));
+ chan.send(ConstellationControlMsg::Viewport(pipeline.id.clone(), layer_rect));
}
for kid in layer.children().iter() {
diff --git a/components/compositing/compositor_layer.rs b/components/compositing/compositor_layer.rs
index 9830d66381b..4c13d7fb8a0 100644
--- a/components/compositing/compositor_layer.rs
+++ b/components/compositing/compositor_layer.rs
@@ -17,8 +17,8 @@ use layers::color::Color;
use layers::geometry::LayerPixel;
use layers::layers::{Layer, LayerBufferSet};
use layers::platform::surface::NativeSurfaceMethods;
-use script_traits::{ClickEvent, MouseDownEvent, MouseMoveEvent, MouseUpEvent, SendEventMsg};
-use script_traits::{ScriptControlChan};
+use script_traits::{ClickEvent, MouseDownEvent, MouseMoveEvent, MouseUpEvent};
+use script_traits::{ScriptControlChan, ConstellationControlMsg};
use servo_msg::compositor_msg::{Epoch, FixedPosition, LayerId, ScrollPolicy};
use std::num::Float;
use std::num::FloatMath;
@@ -328,7 +328,7 @@ impl CompositorLayer for Layer<CompositorData> {
};
let pipeline = &self.extra_data.borrow().pipeline;
let ScriptControlChan(ref chan) = pipeline.script_chan;
- let _ = chan.send_opt(SendEventMsg(pipeline.id.clone(), message));
+ let _ = chan.send_opt(ConstellationControlMsg::SendEvent(pipeline.id.clone(), message));
}
fn send_mouse_move_event(&self,
@@ -336,7 +336,7 @@ impl CompositorLayer for Layer<CompositorData> {
let message = MouseMoveEvent(cursor.to_untyped());
let pipeline = &self.extra_data.borrow().pipeline;
let ScriptControlChan(ref chan) = pipeline.script_chan;
- let _ = chan.send_opt(SendEventMsg(pipeline.id.clone(), message));
+ let _ = chan.send_opt(ConstellationControlMsg::SendEvent(pipeline.id.clone(), message));
}
fn scroll_layer_and_all_child_layers(&self,
diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs
index 44f87cce401..9ec8fb9aaa6 100644
--- a/components/compositing/constellation.rs
+++ b/components/compositing/constellation.rs
@@ -14,7 +14,7 @@ use gfx::font_cache_task::FontCacheTask;
use layers::geometry::DevicePixel;
use layout_traits::LayoutTaskFactory;
use libc;
-use script_traits::{mod, GetTitleMsg, ResizeMsg, ResizeInactiveMsg, SendEventMsg};
+use script_traits::{mod, ConstellationControlMsg};
use script_traits::{ScriptControlChan, ScriptTaskFactory};
use servo_msg::compositor_msg::LayerId;
use servo_msg::constellation_msg::{mod, ConstellationChan, Failure};
@@ -672,7 +672,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
if !already_sent.contains(&pipeline.id) {
if is_active {
let ScriptControlChan(ref script_chan) = pipeline.script_chan;
- script_chan.send(ResizeMsg(pipeline.id, WindowSizeData {
+ script_chan.send(ConstellationControlMsg::Resize(pipeline.id, WindowSizeData {
visible_viewport: rect.size,
initial_viewport: rect.size * ScaleFactor(1.0),
device_pixel_ratio: device_pixel_ratio,
@@ -838,7 +838,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
fn handle_key_msg(&self, key: Key, state: KeyState, mods: KeyModifiers) {
self.current_frame().as_ref().map(|frame| {
let ScriptControlChan(ref chan) = frame.pipeline.script_chan;
- chan.send(SendEventMsg(frame.pipeline.id, script_traits::KeyEvent(key, state, mods)));
+ chan.send(ConstellationControlMsg::SendEvent(frame.pipeline.id, script_traits::KeyEvent(key, state, mods)));
});
}
@@ -847,7 +847,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
None => self.compositor_proxy.send(CompositorMsg::ChangePageTitle(pipeline_id, None)),
Some(pipeline) => {
let ScriptControlChan(ref script_channel) = pipeline.script_chan;
- script_channel.send(GetTitleMsg(pipeline_id));
+ script_channel.send(ConstellationControlMsg::GetTitle(pipeline_id));
}
}
}
@@ -945,7 +945,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
debug!("constellation sending resize message to active frame");
let pipeline = &frame_tree.pipeline;
let ScriptControlChan(ref chan) = pipeline.script_chan;
- let _ = chan.send_opt(ResizeMsg(pipeline.id, new_size));
+ let _ = chan.send_opt(ConstellationControlMsg::Resize(pipeline.id, new_size));
already_seen.insert(pipeline.id);
}
for frame_tree in self.navigation_context.previous.iter()
@@ -954,7 +954,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
if !already_seen.contains(&pipeline.id) {
debug!("constellation sending resize message to inactive frame");
let ScriptControlChan(ref chan) = pipeline.script_chan;
- let _ = chan.send_opt(ResizeInactiveMsg(pipeline.id, new_size));
+ let _ = chan.send_opt(ConstellationControlMsg::ResizeInactive(pipeline.id, new_size));
already_seen.insert(pipeline.id);
}
}
@@ -967,7 +967,7 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
debug!("constellation sending resize message to pending outer frame ({})",
frame_tree.pipeline.id);
let ScriptControlChan(ref chan) = frame_tree.pipeline.script_chan;
- let _ = chan.send_opt(ResizeMsg(frame_tree.pipeline.id, new_size));
+ let _ = chan.send_opt(ConstellationControlMsg::Resize(frame_tree.pipeline.id, new_size));
}
}
diff --git a/components/compositing/pipeline.rs b/components/compositing/pipeline.rs
index a8096894257..8c22d7c9ea4 100644
--- a/components/compositing/pipeline.rs
+++ b/components/compositing/pipeline.rs
@@ -5,7 +5,7 @@
use CompositorProxy;
use layout_traits::{ExitNowMsg, LayoutTaskFactory, LayoutControlChan};
use script_traits::{ScriptControlChan, ScriptTaskFactory};
-use script_traits::{AttachLayoutMsg, LoadMsg, NewLayoutInfo, ExitPipelineMsg};
+use script_traits::{NewLayoutInfo, ConstellationControlMsg};
use devtools_traits::DevtoolsControlChan;
use gfx::paint_task::Msg as PaintMsg;
@@ -100,7 +100,7 @@ impl Pipeline {
};
let ScriptControlChan(ref chan) = spipe.script_chan;
- chan.send(AttachLayoutMsg(new_layout_info));
+ chan.send(ConstellationControlMsg::AttachLayout(new_layout_info));
spipe.script_chan.clone()
}
};
@@ -162,7 +162,7 @@ impl Pipeline {
pub fn load(&self) {
let ScriptControlChan(ref chan) = self.script_chan;
- chan.send(LoadMsg(self.id, self.load_data.clone()));
+ chan.send(ConstellationControlMsg::Load(self.id, self.load_data.clone()));
}
pub fn grant_paint_permission(&self) {
@@ -180,7 +180,7 @@ impl Pipeline {
// Script task handles shutting down layout, and layout handles shutting down the painter.
// For now, if the script task has failed, we give up on clean shutdown.
let ScriptControlChan(ref chan) = self.script_chan;
- if chan.send_opt(ExitPipelineMsg(self.id, exit_type)).is_ok() {
+ if chan.send_opt(ConstellationControlMsg::ExitPipeline(self.id, exit_type)).is_ok() {
// Wait until all slave tasks have terminated and run destructors
// NOTE: We don't wait for script task as we don't always own it
let _ = self.paint_shutdown_port.recv_opt();
@@ -191,7 +191,9 @@ impl Pipeline {
pub fn force_exit(&self) {
let ScriptControlChan(ref script_channel) = self.script_chan;
- let _ = script_channel.send_opt( ExitPipelineMsg(self.id, PipelineExitType::PipelineOnly));
+ let _ = script_channel.send_opt(
+ ConstellationControlMsg::ExitPipeline(self.id,
+ PipelineExitType::PipelineOnly));
let _ = self.paint_chan.send_opt(PaintMsg::Exit(None, PipelineExitType::PipelineOnly));
let LayoutControlChan(ref layout_channel) = self.layout_chan;
let _ = layout_channel.send_opt(ExitNowMsg(PipelineExitType::PipelineOnly));