Move constellation into its own crate.

This commit is contained in:
Ms2ger 2016-05-18 10:48:31 +02:00
parent aa8c835d3b
commit c057ace251
13 changed files with 197 additions and 47 deletions

View file

@ -19,12 +19,9 @@ profile_traits = {path = "../profile_traits"}
net_traits = {path = "../net_traits"}
util = {path = "../util"}
devtools_traits = {path = "../devtools_traits"}
canvas_traits = {path = "../canvas_traits"}
canvas = {path = "../canvas"}
plugins = {path = "../plugins"}
azure = {git = "https://github.com/servo/rust-azure", features = ["plugins"]}
layers = {git = "https://github.com/servo/rust-layers", features = ["plugins"]}
clipboard = {git = "https://github.com/aweinstock314/rust-clipboard"}
ipc-channel = {git = "https://github.com/servo/ipc-channel"}
webrender_traits = {git = "https://github.com/servo/webrender_traits"}
webrender = {git = "https://github.com/servo/webrender"}
@ -33,8 +30,6 @@ euclid = {version = "0.6.4", features = ["plugins"]}
gleam = "0.2.8"
image = "0.10"
log = "0.3.5"
offscreen_gl_context = "0.1.2"
rand = "0.3"
serde = "0.7"
serde_macros = "0.7"
time = "0.1.17"

View file

@ -4,11 +4,11 @@
use AnimationTickType;
use CompositorMsg as ConstellationMsg;
use SendableFrameTree;
use app_units::Au;
use compositor_layer::{CompositorData, CompositorLayer, RcCompositorLayer, WantsScrollEventsFlag};
use compositor_thread::{CompositorEventListener, CompositorProxy};
use compositor_thread::{CompositorReceiver, InitialCompositorState, Msg, RenderListener};
use constellation::SendableFrameTree;
use delayed_composition::DelayedCompositionTimerProxy;
use euclid::point::TypedPoint2D;
use euclid::rect::TypedRect;

View file

@ -23,7 +23,7 @@ use style_traits::cursor::Cursor;
use style_traits::viewport::ViewportConstraints;
use url::Url;
use windowing::{WindowEvent, WindowMethods};
pub use constellation::SendableFrameTree;
pub use SendableFrameTree;
pub use windowing;
use webrender;
use webrender_traits;

View file

@ -5,7 +5,6 @@
#![feature(box_syntax)]
#![feature(custom_derive)]
#![feature(plugin)]
#![feature(mpsc_select)]
#![feature(plugin)]
#![plugin(plugins)]
@ -15,9 +14,6 @@
extern crate app_units;
extern crate azure;
extern crate canvas;
extern crate canvas_traits;
extern crate clipboard;
extern crate devtools_traits;
extern crate euclid;
#[cfg(not(target_os = "windows"))]
@ -33,10 +29,8 @@ extern crate layout_traits;
extern crate log;
extern crate msg;
extern crate net_traits;
extern crate offscreen_gl_context;
#[macro_use]
extern crate profile_traits;
extern crate rand;
extern crate script_traits;
extern crate serde;
extern crate style_traits;
@ -48,26 +42,25 @@ extern crate webrender;
extern crate webrender_traits;
pub use compositor_thread::{CompositorEventListener, CompositorProxy, CompositorThread};
pub use constellation::Constellation;
use euclid::size::{Size2D};
use euclid::size::{Size2D, TypedSize2D};
use gfx_traits::Epoch;
use ipc_channel::ipc::{IpcSender};
use msg::constellation_msg::{FrameId, Key, KeyState, KeyModifiers, LoadData};
use msg::constellation_msg::{NavigationDirection, PipelineId, SubpageId};
use msg::constellation_msg::{WebDriverCommandMsg, WindowSizeData, WindowSizeType};
use pipeline::CompositionPipeline;
use std::collections::HashMap;
use url::Url;
use util::geometry::PagePx;
mod compositor;
mod compositor_layer;
pub mod compositor_thread;
pub mod constellation;
mod delayed_composition;
pub mod pipeline;
#[cfg(not(target_os = "windows"))]
pub mod sandboxing;
mod surface_map;
mod timer_scheduler;
mod touch;
pub mod windowing;
@ -105,3 +98,9 @@ pub enum CompositorMsg {
/// Dispatch a webdriver command
WebDriverCommand(WebDriverCommandMsg),
}
pub struct SendableFrameTree {
pub pipeline: CompositionPipeline,
pub size: Option<TypedSize2D<PagePx, f32>>,
pub children: Vec<SendableFrameTree>,
}

View file

@ -0,0 +1,37 @@
[package]
name = "constellation"
version = "0.0.1"
authors = ["The Servo Project Developers"]
publish = false
[lib]
name = "constellation"
path = "lib.rs"
[dependencies]
canvas = {path = "../canvas"}
canvas_traits = {path = "../canvas_traits"}
clipboard = {git = "https://github.com/aweinstock314/rust-clipboard"}
compositing = {path = "../compositing"}
devtools_traits = {path = "../devtools_traits"}
euclid = {version = "0.6.4", features = ["plugins"]}
gfx = {path = "../gfx"}
gfx_traits = {path = "../gfx_traits"}
ipc-channel = {git = "https://github.com/servo/ipc-channel"}
layout_traits = {path = "../layout_traits"}
log = "0.3.5"
msg = {path = "../msg"}
net_traits = {path = "../net_traits"}
offscreen_gl_context = "0.1.2"
plugins = {path = "../plugins"}
profile_traits = {path = "../profile_traits"}
rand = "0.3"
script_traits = {path = "../script_traits"}
serde_macros = "0.7"
style_traits = {path = "../style_traits"}
url = {version = "1.0.0", features = ["heap_size"]}
util = {path = "../util"}
webrender_traits = {git = "https://github.com/servo/webrender_traits"}
[target.'cfg(not(target_os = "windows"))'.dependencies]
gaol = {git = "https://github.com/servo/gaol"}

View file

@ -9,14 +9,17 @@
//! navigation context, each `Pipeline` encompassing a `ScriptThread`,
//! `LayoutThread`, and `PaintThread`.
use AnimationTickType;
use CompositorMsg as FromCompositorMsg;
use canvas::canvas_paint_thread::CanvasPaintThread;
use canvas::webgl_paint_thread::WebGLPaintThread;
use canvas_traits::CanvasMsg;
use clipboard::ClipboardContext;
use compositor_thread::CompositorProxy;
use compositor_thread::Msg as ToCompositorMsg;
use compositing::CompositorMsg as FromCompositorMsg;
use compositing::compositor_thread::CompositorProxy;
use compositing::compositor_thread::Msg as ToCompositorMsg;
use compositing::pipeline::{InitialPipelineState, Pipeline, UnprivilegedPipelineContent};
#[cfg(not(target_os = "windows"))]
use compositing::sandboxing;
use compositing::{AnimationTickType, SendableFrameTree};
use devtools_traits::{ChromeToDevtoolsControlMsg, DevtoolsControlMsg};
use euclid::scale_factor::ScaleFactor;
use euclid::size::{Size2D, TypedSize2D};
@ -43,12 +46,9 @@ use net_traits::image_cache_thread::ImageCacheThread;
use net_traits::storage_thread::{StorageThread, StorageThreadMsg};
use net_traits::{self, ResourceThread};
use offscreen_gl_context::{GLContextAttributes, GLLimits};
use pipeline::{CompositionPipeline, InitialPipelineState, Pipeline, UnprivilegedPipelineContent};
use profile_traits::mem;
use profile_traits::time;
use rand::{random, Rng, SeedableRng, StdRng};
#[cfg(not(target_os = "windows"))]
use sandboxing;
use script_traits::{AnimationState, CompositorEvent, ConstellationControlMsg};
use script_traits::{DocumentState, LayoutControlMsg};
use script_traits::{IFrameLoadInfo, IFrameSandboxState, TimerEventRequest};
@ -296,12 +296,6 @@ impl<'a> Iterator for FrameTreeIterator<'a> {
}
}
pub struct SendableFrameTree {
pub pipeline: CompositionPipeline,
pub size: Option<TypedSize2D<PagePx, f32>>,
pub children: Vec<SendableFrameTree>,
}
struct WebDriverData {
load_channel: Option<(PipelineId, IpcSender<webdriver_msg::LoadStatus>)>
}

View file

@ -0,0 +1,45 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![feature(box_syntax)]
#![feature(custom_derive)]
#![feature(plugin)]
#![feature(mpsc_select)]
#![feature(plugin)]
#![plugin(plugins)]
#![deny(unsafe_code)]
#![plugin(serde_macros)]
extern crate canvas;
extern crate canvas_traits;
extern crate clipboard;
extern crate compositing;
extern crate devtools_traits;
extern crate euclid;
#[cfg(not(target_os = "windows"))]
extern crate gaol;
extern crate gfx;
extern crate gfx_traits;
extern crate ipc_channel;
extern crate layout_traits;
#[macro_use]
extern crate log;
extern crate msg;
extern crate net_traits;
extern crate offscreen_gl_context;
#[macro_use]
extern crate profile_traits;
extern crate rand;
extern crate script_traits;
extern crate style_traits;
extern crate url;
#[macro_use]
extern crate util;
extern crate webrender_traits;
mod constellation;
mod timer_scheduler;
pub use constellation::{Constellation, InitialConstellationState};

View file

@ -8,6 +8,7 @@ dependencies = [
"canvas_traits 0.0.1",
"compiletest_helper 0.0.1",
"compositing 0.0.1",
"constellation 0.0.1",
"devtools 0.0.1",
"devtools_traits 0.0.1",
"env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -306,9 +307,6 @@ version = "0.0.1"
dependencies = [
"app_units 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"azure 0.4.5 (git+https://github.com/servo/rust-azure)",
"canvas 0.0.1",
"canvas_traits 0.0.1",
"clipboard 0.1.2 (git+https://github.com/aweinstock314/rust-clipboard)",
"devtools_traits 0.0.1",
"euclid 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"gaol 0.0.1 (git+https://github.com/servo/gaol)",
@ -322,10 +320,8 @@ dependencies = [
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net_traits 0.0.1",
"offscreen_gl_context 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"profile_traits 0.0.1",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"serde 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -337,6 +333,36 @@ dependencies = [
"webrender_traits 0.1.0 (git+https://github.com/servo/webrender_traits)",
]
[[package]]
name = "constellation"
version = "0.0.1"
dependencies = [
"canvas 0.0.1",
"canvas_traits 0.0.1",
"clipboard 0.1.2 (git+https://github.com/aweinstock314/rust-clipboard)",
"compositing 0.0.1",
"devtools_traits 0.0.1",
"euclid 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"gaol 0.0.1 (git+https://github.com/servo/gaol)",
"gfx 0.0.1",
"gfx_traits 0.0.1",
"ipc-channel 0.2.2 (git+https://github.com/servo/ipc-channel)",
"layout_traits 0.0.1",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net_traits 0.0.1",
"offscreen_gl_context 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"profile_traits 0.0.1",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"serde_macros 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
"style_traits 0.0.1",
"url 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
"webrender_traits 0.1.0 (git+https://github.com/servo/webrender_traits)",
]
[[package]]
name = "cookie"
version = "0.2.4"

View file

@ -47,6 +47,7 @@ plugin_compiletest = {path = "../../tests/compiletest/plugin"}
webrender_traits = {git = "https://github.com/servo/webrender_traits"}
webrender = {git = "https://github.com/servo/webrender"}
compositing = {path = "../compositing"}
constellation = {path = "../constellation"}
net = {path = "../net"}
net_traits = {path = "../net_traits"}
msg = {path = "../msg"}

View file

@ -25,6 +25,7 @@ extern crate gleam;
pub extern crate canvas;
pub extern crate canvas_traits;
pub extern crate compositing;
pub extern crate constellation;
pub extern crate devtools;
pub extern crate devtools_traits;
pub extern crate euclid;
@ -59,13 +60,13 @@ fn webdriver(_port: u16, _constellation: Sender<ConstellationMsg>) { }
use compositing::CompositorEventListener;
use compositing::CompositorMsg as ConstellationMsg;
use compositing::compositor_thread::InitialCompositorState;
use compositing::constellation::InitialConstellationState;
use compositing::pipeline::UnprivilegedPipelineContent;
#[cfg(not(target_os = "windows"))]
use compositing::sandboxing;
use compositing::windowing::WindowEvent;
use compositing::windowing::WindowMethods;
use compositing::{CompositorProxy, CompositorThread, Constellation};
use compositing::{CompositorProxy, CompositorThread};
use constellation::{Constellation, InitialConstellationState};
#[cfg(not(target_os = "windows"))]
use gaol::sandbox::{ChildSandbox, ChildSandboxMethods};
use gfx::font_cache_thread::FontCacheThread;

36
ports/cef/Cargo.lock generated
View file

@ -269,9 +269,6 @@ version = "0.0.1"
dependencies = [
"app_units 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"azure 0.4.5 (git+https://github.com/servo/rust-azure)",
"canvas 0.0.1",
"canvas_traits 0.0.1",
"clipboard 0.1.2 (git+https://github.com/aweinstock314/rust-clipboard)",
"devtools_traits 0.0.1",
"euclid 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"gaol 0.0.1 (git+https://github.com/servo/gaol)",
@ -285,10 +282,8 @@ dependencies = [
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net_traits 0.0.1",
"offscreen_gl_context 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"profile_traits 0.0.1",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"serde 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -300,6 +295,36 @@ dependencies = [
"webrender_traits 0.1.0 (git+https://github.com/servo/webrender_traits)",
]
[[package]]
name = "constellation"
version = "0.0.1"
dependencies = [
"canvas 0.0.1",
"canvas_traits 0.0.1",
"clipboard 0.1.2 (git+https://github.com/aweinstock314/rust-clipboard)",
"compositing 0.0.1",
"devtools_traits 0.0.1",
"euclid 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"gaol 0.0.1 (git+https://github.com/servo/gaol)",
"gfx 0.0.1",
"gfx_traits 0.0.1",
"ipc-channel 0.2.2 (git+https://github.com/servo/ipc-channel)",
"layout_traits 0.0.1",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net_traits 0.0.1",
"offscreen_gl_context 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"profile_traits 0.0.1",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"serde_macros 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
"style_traits 0.0.1",
"url 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
"webrender_traits 0.1.0 (git+https://github.com/servo/webrender_traits)",
]
[[package]]
name = "cookie"
version = "0.2.4"
@ -1816,6 +1841,7 @@ dependencies = [
"canvas 0.0.1",
"canvas_traits 0.0.1",
"compositing 0.0.1",
"constellation 0.0.1",
"devtools 0.0.1",
"devtools_traits 0.0.1",
"env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",

36
ports/gonk/Cargo.lock generated
View file

@ -271,9 +271,6 @@ version = "0.0.1"
dependencies = [
"app_units 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"azure 0.4.5 (git+https://github.com/servo/rust-azure)",
"canvas 0.0.1",
"canvas_traits 0.0.1",
"clipboard 0.1.2 (git+https://github.com/aweinstock314/rust-clipboard)",
"devtools_traits 0.0.1",
"euclid 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"gaol 0.0.1 (git+https://github.com/servo/gaol)",
@ -287,10 +284,8 @@ dependencies = [
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net_traits 0.0.1",
"offscreen_gl_context 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"profile_traits 0.0.1",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"serde 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -302,6 +297,36 @@ dependencies = [
"webrender_traits 0.1.0 (git+https://github.com/servo/webrender_traits)",
]
[[package]]
name = "constellation"
version = "0.0.1"
dependencies = [
"canvas 0.0.1",
"canvas_traits 0.0.1",
"clipboard 0.1.2 (git+https://github.com/aweinstock314/rust-clipboard)",
"compositing 0.0.1",
"devtools_traits 0.0.1",
"euclid 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"gaol 0.0.1 (git+https://github.com/servo/gaol)",
"gfx 0.0.1",
"gfx_traits 0.0.1",
"ipc-channel 0.2.2 (git+https://github.com/servo/ipc-channel)",
"layout_traits 0.0.1",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"net_traits 0.0.1",
"offscreen_gl_context 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1",
"profile_traits 0.0.1",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"script_traits 0.0.1",
"serde_macros 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
"style_traits 0.0.1",
"url 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"util 0.0.1",
"webrender_traits 0.1.0 (git+https://github.com/servo/webrender_traits)",
]
[[package]]
name = "cookie"
version = "0.2.4"
@ -1808,6 +1833,7 @@ dependencies = [
"canvas 0.0.1",
"canvas_traits 0.0.1",
"compositing 0.0.1",
"constellation 0.0.1",
"devtools 0.0.1",
"devtools_traits 0.0.1",
"env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",