script: Make most of 2D canvas and WebGL run over IPC.

To actually make the multiprocess communication work, we'll need to
reroute the task creation to the pipeline or the compositor. But this
works as a first step.
This commit is contained in:
Patrick Walton 2015-07-13 17:02:35 -07:00
parent 886c08c393
commit bb99b2f3c8
39 changed files with 694 additions and 365 deletions

View file

@ -30,9 +30,13 @@ features = ["texture_surface"]
[dependencies.ipc-channel] [dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel" git = "https://github.com/pcwalton/ipc-channel"
[dependencies.cssparser]
version = "0.3"
features = [ "serde-serialization" ]
[dependencies] [dependencies]
log = "0.3" log = "0.3"
cssparser = "0.3.1"
num = "0.1.24" num = "0.1.24"
gleam = "0.1" gleam = "0.1"
euclid = "0.1" euclid = "0.1"

View file

@ -11,6 +11,8 @@ use euclid::matrix2d::Matrix2D;
use euclid::point::Point2D; use euclid::point::Point2D;
use euclid::rect::Rect; use euclid::rect::Rect;
use euclid::size::Size2D; use euclid::size::Size2D;
use ipc_channel::ipc::{self, IpcSender};
use ipc_channel::router::ROUTER;
use layers::platform::surface::NativeSurface; use layers::platform::surface::NativeSurface;
use gfx_traits::color; use gfx_traits::color;
use ipc_channel::ipc::IpcSharedMemory; use ipc_channel::ipc::IpcSharedMemory;
@ -161,13 +163,19 @@ impl<'a> CanvasPaintTask<'a> {
} }
} }
pub fn start(size: Size2D<i32>) -> Sender<CanvasMsg> { /// Creates a new `CanvasPaintTask` and returns the out-of-process sender and the in-process
let (chan, port) = channel::<CanvasMsg>(); /// sender for it.
pub fn start(size: Size2D<i32>) -> (IpcSender<CanvasMsg>, Sender<CanvasMsg>) {
// TODO(pcwalton): Ask the pipeline to create this for us instead of spawning it directly.
// This will be needed for multiprocess Servo.
let (out_of_process_chan, out_of_process_port) = ipc::channel::<CanvasMsg>().unwrap();
let (in_process_chan, in_process_port) = channel();
ROUTER.route_ipc_receiver_to_mpsc_sender(out_of_process_port, in_process_chan.clone());
spawn_named("CanvasTask".to_owned(), move || { spawn_named("CanvasTask".to_owned(), move || {
let mut painter = CanvasPaintTask::new(size); let mut painter = CanvasPaintTask::new(size);
loop { loop {
match port.recv().unwrap() { let msg = in_process_port.recv();
match msg.unwrap() {
CanvasMsg::Canvas2d(message) => { CanvasMsg::Canvas2d(message) => {
match message { match message {
Canvas2dMsg::FillRect(ref rect) => painter.fill_rect(rect), Canvas2dMsg::FillRect(ref rect) => painter.fill_rect(rect),
@ -225,17 +233,28 @@ impl<'a> CanvasPaintTask<'a> {
match message { match message {
CanvasCommonMsg::Close => break, CanvasCommonMsg::Close => break,
CanvasCommonMsg::Recreate(size) => painter.recreate(size), CanvasCommonMsg::Recreate(size) => painter.recreate(size),
CanvasCommonMsg::SendPixelContents(chan) =>
painter.send_pixel_contents(chan),
CanvasCommonMsg::SendNativeSurface(chan) =>
painter.send_native_surface(chan),
} }
}, },
CanvasMsg::FromLayout(message) => {
match message {
FromLayoutMsg::SendPixelContents(chan) => {
painter.send_pixel_contents(chan)
}
}
}
CanvasMsg::FromPaint(message) => {
match message {
FromPaintMsg::SendNativeSurface(chan) => {
painter.send_native_surface(chan)
}
}
}
CanvasMsg::WebGL(_) => panic!("Wrong message sent to Canvas2D task"), CanvasMsg::WebGL(_) => panic!("Wrong message sent to Canvas2D task"),
} }
} }
}); });
chan
(out_of_process_chan, in_process_chan)
} }
fn save_context_state(&mut self) { fn save_context_state(&mut self) {
@ -516,7 +535,7 @@ impl<'a> CanvasPaintTask<'a> {
self.drawtarget = CanvasPaintTask::create(size); self.drawtarget = CanvasPaintTask::create(size);
} }
fn send_pixel_contents(&mut self, chan: Sender<IpcSharedMemory>) { fn send_pixel_contents(&mut self, chan: IpcSender<IpcSharedMemory>) {
self.drawtarget.snapshot().get_data_surface().with_data(|element| { self.drawtarget.snapshot().get_data_surface().with_data(|element| {
chan.send(IpcSharedMemory::from_bytes(element)).unwrap(); chan.send(IpcSharedMemory::from_bytes(element)).unwrap();
}) })
@ -528,7 +547,10 @@ impl<'a> CanvasPaintTask<'a> {
unimplemented!() unimplemented!()
} }
fn get_image_data(&self, mut dest_rect: Rect<f64>, canvas_size: Size2D<f64>, chan: Sender<Vec<u8>>) { fn get_image_data(&self,
mut dest_rect: Rect<f64>,
canvas_size: Size2D<f64>,
chan: IpcSender<Vec<u8>>) {
if dest_rect.size.width < 0.0 { if dest_rect.size.width < 0.0 {
dest_rect.size.width = -dest_rect.size.width; dest_rect.size.width = -dest_rect.size.width;
dest_rect.origin.x -= dest_rect.size.width; dest_rect.origin.x -= dest_rect.size.width;

View file

@ -13,12 +13,12 @@ extern crate azure;
extern crate cssparser; extern crate cssparser;
extern crate euclid; extern crate euclid;
extern crate gfx_traits; extern crate gfx_traits;
extern crate ipc_channel;
extern crate util; extern crate util;
extern crate gleam; extern crate gleam;
extern crate num; extern crate num;
extern crate layers; extern crate layers;
extern crate offscreen_gl_context; extern crate offscreen_gl_context;
extern crate ipc_channel;
#[macro_use] #[macro_use]
extern crate log; extern crate log;

View file

@ -2,7 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use canvas_traits::{CanvasMsg, CanvasWebGLMsg, CanvasCommonMsg, WebGLShaderParameter, WebGLFramebufferBindingRequest}; use canvas_traits::{CanvasMsg, CanvasWebGLMsg, CanvasCommonMsg, FromLayoutMsg, FromPaintMsg};
use canvas_traits::{WebGLShaderParameter, WebGLFramebufferBindingRequest};
use euclid::size::Size2D; use euclid::size::Size2D;
use core::nonzero::NonZero; use core::nonzero::NonZero;
use gleam::gl; use gleam::gl;
@ -16,7 +17,8 @@ use std::sync::mpsc::{channel, Sender};
use util::vec::byte_swap; use util::vec::byte_swap;
use layers::platform::surface::NativeSurface; use layers::platform::surface::NativeSurface;
use offscreen_gl_context::{GLContext, GLContextAttributes, ColorAttachmentType}; use offscreen_gl_context::{GLContext, GLContextAttributes, ColorAttachmentType};
use ipc_channel::ipc::IpcSharedMemory; use ipc_channel::ipc::{self, IpcSender, IpcSharedMemory};
use ipc_channel::router::ROUTER;
pub struct WebGLPaintTask { pub struct WebGLPaintTask {
size: Size2D<i32>, size: Size2D<i32>,
@ -135,45 +137,58 @@ impl WebGLPaintTask {
} }
} }
pub fn start(size: Size2D<i32>, attrs: GLContextAttributes) -> Result<Sender<CanvasMsg>, &'static str> { /// Creates a new `WebGLPaintTask` and returns the out-of-process sender and the in-process
let (chan, port) = channel::<CanvasMsg>(); /// sender for it.
pub fn start(size: Size2D<i32>, attrs: GLContextAttributes)
-> Result<(IpcSender<CanvasMsg>, Sender<CanvasMsg>), &'static str> {
let (out_of_process_chan, out_of_process_port) = ipc::channel::<CanvasMsg>().unwrap();
let (in_process_chan, in_process_port) = channel();
ROUTER.route_ipc_receiver_to_mpsc_sender(out_of_process_port, in_process_chan.clone());
let mut painter = try!(WebGLPaintTask::new(size, attrs)); let mut painter = try!(WebGLPaintTask::new(size, attrs));
spawn_named("WebGLTask".to_owned(), move || { spawn_named("WebGLTask".to_owned(), move || {
painter.init(); painter.init();
loop { loop {
match port.recv().unwrap() { match in_process_port.recv().unwrap() {
CanvasMsg::WebGL(message) => painter.handle_webgl_message(message), CanvasMsg::WebGL(message) => painter.handle_webgl_message(message),
CanvasMsg::Common(message) => { CanvasMsg::Common(message) => {
match message { match message {
CanvasCommonMsg::Close => break, CanvasCommonMsg::Close => break,
CanvasCommonMsg::SendPixelContents(chan) =>
painter.send_pixel_contents(chan),
CanvasCommonMsg::SendNativeSurface(chan) =>
painter.send_native_surface(chan),
// TODO(ecoal95): handle error nicely // TODO(ecoal95): handle error nicely
CanvasCommonMsg::Recreate(size) => painter.recreate(size).unwrap(), CanvasCommonMsg::Recreate(size) => painter.recreate(size).unwrap(),
} }
}, },
CanvasMsg::FromLayout(message) => {
match message {
FromLayoutMsg::SendPixelContents(chan) =>
painter.send_pixel_contents(chan),
}
}
CanvasMsg::FromPaint(message) => {
match message {
FromPaintMsg::SendNativeSurface(chan) =>
painter.send_native_surface(chan),
}
}
CanvasMsg::Canvas2d(_) => panic!("Wrong message sent to WebGLTask"), CanvasMsg::Canvas2d(_) => panic!("Wrong message sent to WebGLTask"),
} }
} }
}); });
Ok(chan) Ok((out_of_process_chan, in_process_chan))
} }
#[inline] #[inline]
fn get_context_attributes(&self, sender: Sender<GLContextAttributes>) { fn get_context_attributes(&self, sender: IpcSender<GLContextAttributes>) {
sender.send(*self.gl_context.borrow_attributes()).unwrap() sender.send(*self.gl_context.borrow_attributes()).unwrap()
} }
#[inline] #[inline]
fn send_drawing_buffer_width(&self, sender: Sender<i32>) { fn send_drawing_buffer_width(&self, sender: IpcSender<i32>) {
sender.send(self.size.width).unwrap() sender.send(self.size.width).unwrap()
} }
#[inline] #[inline]
fn send_drawing_buffer_height(&self, sender: Sender<i32>) { fn send_drawing_buffer_height(&self, sender: IpcSender<i32>) {
sender.send(self.size.height).unwrap() sender.send(self.size.height).unwrap()
} }
@ -234,7 +249,7 @@ impl WebGLPaintTask {
gl::clear_color(r, g, b, a); gl::clear_color(r, g, b, a);
} }
fn create_buffer(&self, chan: Sender<Option<NonZero<u32>>>) { fn create_buffer(&self, chan: IpcSender<Option<NonZero<u32>>>) {
let buffer = gl::gen_buffers(1)[0]; let buffer = gl::gen_buffers(1)[0];
let buffer = if buffer == 0 { let buffer = if buffer == 0 {
None None
@ -244,7 +259,7 @@ impl WebGLPaintTask {
chan.send(buffer).unwrap(); chan.send(buffer).unwrap();
} }
fn create_framebuffer(&self, chan: Sender<Option<NonZero<u32>>>) { fn create_framebuffer(&self, chan: IpcSender<Option<NonZero<u32>>>) {
let framebuffer = gl::gen_framebuffers(1)[0]; let framebuffer = gl::gen_framebuffers(1)[0];
let framebuffer = if framebuffer == 0 { let framebuffer = if framebuffer == 0 {
None None
@ -254,7 +269,7 @@ impl WebGLPaintTask {
chan.send(framebuffer).unwrap(); chan.send(framebuffer).unwrap();
} }
fn create_renderbuffer(&self, chan: Sender<Option<NonZero<u32>>>) { fn create_renderbuffer(&self, chan: IpcSender<Option<NonZero<u32>>>) {
let renderbuffer = gl::gen_renderbuffers(1)[0]; let renderbuffer = gl::gen_renderbuffers(1)[0];
let renderbuffer = if renderbuffer == 0 { let renderbuffer = if renderbuffer == 0 {
None None
@ -264,7 +279,7 @@ impl WebGLPaintTask {
chan.send(renderbuffer).unwrap(); chan.send(renderbuffer).unwrap();
} }
fn create_texture(&self, chan: Sender<Option<NonZero<u32>>>) { fn create_texture(&self, chan: IpcSender<Option<NonZero<u32>>>) {
let texture = gl::gen_framebuffers(1)[0]; let texture = gl::gen_framebuffers(1)[0];
let texture = if texture == 0 { let texture = if texture == 0 {
None None
@ -274,7 +289,7 @@ impl WebGLPaintTask {
chan.send(texture).unwrap(); chan.send(texture).unwrap();
} }
fn create_program(&self, chan: Sender<Option<NonZero<u32>>>) { fn create_program(&self, chan: IpcSender<Option<NonZero<u32>>>) {
let program = gl::create_program(); let program = gl::create_program();
let program = if program == 0 { let program = if program == 0 {
None None
@ -284,7 +299,7 @@ impl WebGLPaintTask {
chan.send(program).unwrap(); chan.send(program).unwrap();
} }
fn create_shader(&self, shader_type: u32, chan: Sender<Option<NonZero<u32>>>) { fn create_shader(&self, shader_type: u32, chan: IpcSender<Option<NonZero<u32>>>) {
let shader = gl::create_shader(shader_type); let shader = gl::create_shader(shader_type);
let shader = if shader == 0 { let shader = if shader == 0 {
None None
@ -368,7 +383,7 @@ impl WebGLPaintTask {
gl::enable_vertex_attrib_array(attrib_id); gl::enable_vertex_attrib_array(attrib_id);
} }
fn get_attrib_location(&self, program_id: u32, name: String, chan: Sender<Option<i32>> ) { fn get_attrib_location(&self, program_id: u32, name: String, chan: IpcSender<Option<i32>> ) {
let attrib_location = gl::get_attrib_location(program_id, &name); let attrib_location = gl::get_attrib_location(program_id, &name);
let attrib_location = if attrib_location == -1 { let attrib_location = if attrib_location == -1 {
@ -380,14 +395,17 @@ impl WebGLPaintTask {
chan.send(attrib_location).unwrap(); chan.send(attrib_location).unwrap();
} }
fn get_shader_info_log(&self, shader_id: u32, chan: Sender<Option<String>>) { fn get_shader_info_log(&self, shader_id: u32, chan: IpcSender<Option<String>>) {
// TODO(ecoal95): Right now we always return a value, we should // TODO(ecoal95): Right now we always return a value, we should
// check for gl errors and return None there // check for gl errors and return None there
let info = gl::get_shader_info_log(shader_id); let info = gl::get_shader_info_log(shader_id);
chan.send(Some(info)).unwrap(); chan.send(Some(info)).unwrap();
} }
fn get_shader_parameter(&self, shader_id: u32, param_id: u32, chan: Sender<WebGLShaderParameter>) { fn get_shader_parameter(&self,
shader_id: u32,
param_id: u32,
chan: IpcSender<WebGLShaderParameter>) {
let result = match param_id { let result = match param_id {
gl::SHADER_TYPE => gl::SHADER_TYPE =>
WebGLShaderParameter::Int(gl::get_shader_iv(shader_id, param_id)), WebGLShaderParameter::Int(gl::get_shader_iv(shader_id, param_id)),
@ -399,7 +417,7 @@ impl WebGLPaintTask {
chan.send(result).unwrap(); chan.send(result).unwrap();
} }
fn get_uniform_location(&self, program_id: u32, name: String, chan: Sender<Option<i32>>) { fn get_uniform_location(&self, program_id: u32, name: String, chan: IpcSender<Option<i32>>) {
let location = gl::get_uniform_location(program_id, &name); let location = gl::get_uniform_location(program_id, &name);
let location = if location == -1 { let location = if location == -1 {
None None
@ -441,7 +459,7 @@ impl WebGLPaintTask {
gl::viewport(x, y, width, height); gl::viewport(x, y, width, height);
} }
fn send_pixel_contents(&mut self, chan: Sender<IpcSharedMemory>) { fn send_pixel_contents(&mut self, chan: IpcSender<IpcSharedMemory>) {
// FIXME(#5652, dmarcos) Instead of a readback strategy we have // FIXME(#5652, dmarcos) Instead of a readback strategy we have
// to layerize the canvas. // to layerize the canvas.
// TODO(pcwalton): We'd save a copy if we had an `IpcSharedMemoryBuilder` abstraction that // TODO(pcwalton): We'd save a copy if we had an `IpcSharedMemoryBuilder` abstraction that

View file

@ -22,6 +22,15 @@ git = "https://github.com/ecoal95/rust-offscreen-rendering-context"
[dependencies.ipc-channel] [dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel" git = "https://github.com/pcwalton/ipc-channel"
[dependencies.serde]
version = "0.4"
features = [ "nightly" ]
[dependencies.cssparser]
version = "0.3"
features = [ "serde-serialization" ]
[dependencies] [dependencies]
cssparser = "0.3.1"
euclid = "0.1" euclid = "0.1"
serde_macros = "0.4"

View file

@ -5,7 +5,11 @@
#![crate_name = "canvas_traits"] #![crate_name = "canvas_traits"]
#![crate_type = "rlib"] #![crate_type = "rlib"]
#![feature(core)] #![feature(core)]
#![feature(custom_derive)]
#![feature(nonzero)] #![feature(nonzero)]
#![feature(plugin)]
#![plugin(serde_macros)]
extern crate core; extern crate core;
extern crate azure; extern crate azure;
extern crate euclid; extern crate euclid;
@ -14,6 +18,7 @@ extern crate gfx_traits;
extern crate ipc_channel; extern crate ipc_channel;
extern crate layers; extern crate layers;
extern crate offscreen_gl_context; extern crate offscreen_gl_context;
extern crate serde;
use azure::azure::{AzFloat, AzColor}; use azure::azure::{AzFloat, AzColor};
use azure::azure_hl::{DrawTarget, Pattern, ColorPattern}; use azure::azure_hl::{DrawTarget, Pattern, ColorPattern};
@ -26,28 +31,51 @@ use euclid::point::Point2D;
use euclid::rect::Rect; use euclid::rect::Rect;
use euclid::size::Size2D; use euclid::size::Size2D;
use gfx_traits::color; use gfx_traits::color;
use std::sync::mpsc::{Sender}; use ipc_channel::ipc::{IpcSender, IpcSharedMemory};
use std::sync::mpsc::Sender;
use layers::platform::surface::NativeSurface; use layers::platform::surface::NativeSurface;
use offscreen_gl_context::GLContextAttributes; use offscreen_gl_context::GLContextAttributes;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use core::nonzero::NonZero; use core::nonzero::NonZero;
use ipc_channel::ipc::IpcSharedMemory;
#[derive(Clone)] #[derive(Clone, Deserialize, Serialize)]
pub enum CanvasMsg { pub enum CanvasMsg {
Canvas2d(Canvas2dMsg), Canvas2d(Canvas2dMsg),
Common(CanvasCommonMsg), Common(CanvasCommonMsg),
FromLayout(FromLayoutMsg),
FromPaint(FromPaintMsg),
WebGL(CanvasWebGLMsg), WebGL(CanvasWebGLMsg),
} }
#[derive(Clone)] #[derive(Clone, Deserialize, Serialize)]
pub enum CanvasCommonMsg { pub enum CanvasCommonMsg {
Close, Close,
Recreate(Size2D<i32>), Recreate(Size2D<i32>),
SendPixelContents(Sender<IpcSharedMemory>), }
SendNativeSurface(Sender<NativeSurface>),
#[derive(Clone, Deserialize, Serialize)]
pub enum FromLayoutMsg {
SendPixelContents(IpcSender<IpcSharedMemory>),
} }
#[derive(Clone)] #[derive(Clone)]
pub enum FromPaintMsg {
SendNativeSurface(Sender<NativeSurface>),
}
impl Serialize for FromPaintMsg {
fn serialize<S>(&self, _: &mut S) -> Result<(),S::Error> where S: Serializer {
panic!("can't serialize a `FromPaintMsg`!")
}
}
impl Deserialize for FromPaintMsg {
fn deserialize<D>(_: &mut D) -> Result<FromPaintMsg,D::Error> where D: Deserializer {
panic!("can't deserialize a `FromPaintMsg`!")
}
}
#[derive(Clone, Deserialize, Serialize)]
pub enum Canvas2dMsg { pub enum Canvas2dMsg {
Arc(Point2D<f32>, f32, f32, f32, bool), Arc(Point2D<f32>, f32, f32, f32, bool),
ArcTo(Point2D<f32>, Point2D<f32>, f32), ArcTo(Point2D<f32>, Point2D<f32>, f32),
@ -60,7 +88,7 @@ pub enum Canvas2dMsg {
ClosePath, ClosePath,
Fill, Fill,
FillRect(Rect<f32>), FillRect(Rect<f32>),
GetImageData(Rect<f64>, Size2D<f64>, Sender<Vec<u8>>), GetImageData(Rect<f64>, Size2D<f64>, IpcSender<Vec<u8>>),
LineTo(Point2D<f32>), LineTo(Point2D<f32>),
MoveTo(Point2D<f32>), MoveTo(Point2D<f32>),
PutImageData(Vec<u8>, Rect<f64>, Option<Rect<f64>>), PutImageData(Vec<u8>, Rect<f64>, Option<Rect<f64>>),
@ -85,9 +113,9 @@ pub enum Canvas2dMsg {
SetShadowColor(RGBA), SetShadowColor(RGBA),
} }
#[derive(Clone)] #[derive(Clone, Deserialize, Serialize)]
pub enum CanvasWebGLMsg { pub enum CanvasWebGLMsg {
GetContextAttributes(Sender<GLContextAttributes>), GetContextAttributes(IpcSender<GLContextAttributes>),
ActiveTexture(u32), ActiveTexture(u32),
BlendColor(f32, f32, f32, f32), BlendColor(f32, f32, f32, f32),
BlendEquation(u32), BlendEquation(u32),
@ -99,12 +127,12 @@ pub enum CanvasWebGLMsg {
Clear(u32), Clear(u32),
ClearColor(f32, f32, f32, f32), ClearColor(f32, f32, f32, f32),
CompileShader(u32), CompileShader(u32),
CreateBuffer(Sender<Option<NonZero<u32>>>), CreateBuffer(IpcSender<Option<NonZero<u32>>>),
CreateFramebuffer(Sender<Option<NonZero<u32>>>), CreateFramebuffer(IpcSender<Option<NonZero<u32>>>),
CreateRenderbuffer(Sender<Option<NonZero<u32>>>), CreateRenderbuffer(IpcSender<Option<NonZero<u32>>>),
CreateTexture(Sender<Option<NonZero<u32>>>), CreateTexture(IpcSender<Option<NonZero<u32>>>),
CreateProgram(Sender<Option<NonZero<u32>>>), CreateProgram(IpcSender<Option<NonZero<u32>>>),
CreateShader(u32, Sender<Option<NonZero<u32>>>), CreateShader(u32, IpcSender<Option<NonZero<u32>>>),
DeleteBuffer(u32), DeleteBuffer(u32),
DeleteFramebuffer(u32), DeleteFramebuffer(u32),
DeleteRenderbuffer(u32), DeleteRenderbuffer(u32),
@ -117,21 +145,21 @@ pub enum CanvasWebGLMsg {
BindTexture(u32, u32), BindTexture(u32, u32),
DrawArrays(u32, i32, i32), DrawArrays(u32, i32, i32),
EnableVertexAttribArray(u32), EnableVertexAttribArray(u32),
GetShaderInfoLog(u32, Sender<Option<String>>), GetShaderInfoLog(u32, IpcSender<Option<String>>),
GetShaderParameter(u32, u32, Sender<WebGLShaderParameter>), GetShaderParameter(u32, u32, IpcSender<WebGLShaderParameter>),
GetAttribLocation(u32, String, Sender<Option<i32>>), GetAttribLocation(u32, String, IpcSender<Option<i32>>),
GetUniformLocation(u32, String, Sender<Option<i32>>), GetUniformLocation(u32, String, IpcSender<Option<i32>>),
LinkProgram(u32), LinkProgram(u32),
ShaderSource(u32, String), ShaderSource(u32, String),
Uniform4fv(i32, Vec<f32>), Uniform4fv(i32, Vec<f32>),
UseProgram(u32), UseProgram(u32),
VertexAttribPointer2f(u32, i32, bool, i32, i64), VertexAttribPointer2f(u32, i32, bool, i32, i64),
Viewport(i32, i32, i32, i32), Viewport(i32, i32, i32, i32),
DrawingBufferWidth(Sender<i32>), DrawingBufferWidth(IpcSender<i32>),
DrawingBufferHeight(Sender<i32>), DrawingBufferHeight(IpcSender<i32>),
} }
#[derive(Clone, Copy, PartialEq)] #[derive(Clone, Copy, PartialEq, Deserialize, Serialize)]
pub enum WebGLError { pub enum WebGLError {
InvalidEnum, InvalidEnum,
InvalidOperation, InvalidOperation,
@ -142,26 +170,26 @@ pub enum WebGLError {
pub type WebGLResult<T> = Result<T, WebGLError>; pub type WebGLResult<T> = Result<T, WebGLError>;
#[derive(Clone)] #[derive(Clone, Deserialize, Serialize)]
pub enum WebGLFramebufferBindingRequest { pub enum WebGLFramebufferBindingRequest {
Explicit(u32), Explicit(u32),
Default, Default,
} }
#[derive(Clone)] #[derive(Clone, Deserialize, Serialize)]
pub enum WebGLShaderParameter { pub enum WebGLShaderParameter {
Int(i32), Int(i32),
Bool(bool), Bool(bool),
Invalid, Invalid,
} }
#[derive(Clone)] #[derive(Clone, Deserialize, Serialize)]
pub struct CanvasGradientStop { pub struct CanvasGradientStop {
pub offset: f64, pub offset: f64,
pub color: RGBA, pub color: RGBA,
} }
#[derive(Clone)] #[derive(Clone, Deserialize, Serialize)]
pub struct LinearGradientStyle { pub struct LinearGradientStyle {
pub x0: f64, pub x0: f64,
pub y0: f64, pub y0: f64,
@ -183,7 +211,7 @@ impl LinearGradientStyle {
} }
} }
#[derive(Clone)] #[derive(Clone, Deserialize, Serialize)]
pub struct RadialGradientStyle { pub struct RadialGradientStyle {
pub x0: f64, pub x0: f64,
pub y0: f64, pub y0: f64,
@ -209,7 +237,7 @@ impl RadialGradientStyle {
} }
} }
#[derive(Clone)] #[derive(Clone, Deserialize, Serialize)]
pub struct SurfaceStyle { pub struct SurfaceStyle {
pub surface_data: Vec<u8>, pub surface_data: Vec<u8>,
pub surface_size: Size2D<i32>, pub surface_size: Size2D<i32>,
@ -230,7 +258,7 @@ impl SurfaceStyle {
} }
#[derive(Clone)] #[derive(Clone, Deserialize, Serialize)]
pub enum FillOrStrokeStyle { pub enum FillOrStrokeStyle {
Color(RGBA), Color(RGBA),
LinearGradient(LinearGradientStyle), LinearGradient(LinearGradientStyle),
@ -293,7 +321,7 @@ impl FillOrStrokeStyle {
} }
} }
#[derive(Copy, Clone, PartialEq)] #[derive(Copy, Clone, PartialEq, Deserialize, Serialize)]
pub enum LineCapStyle { pub enum LineCapStyle {
Butt = 0, Butt = 0,
Round = 1, Round = 1,
@ -319,7 +347,7 @@ impl LineCapStyle {
} }
} }
#[derive(Copy, Clone, PartialEq)] #[derive(Copy, Clone, PartialEq, Deserialize, Serialize)]
pub enum LineJoinStyle { pub enum LineJoinStyle {
Round = 0, Round = 0,
Bevel = 1, Bevel = 1,
@ -345,7 +373,7 @@ impl LineJoinStyle {
} }
} }
#[derive(Copy, Clone, PartialEq)] #[derive(Copy, Clone, PartialEq, Deserialize, Serialize)]
pub enum RepetitionStyle { pub enum RepetitionStyle {
Repeat, Repeat,
RepeatX, RepeatX,
@ -365,7 +393,7 @@ impl RepetitionStyle {
} }
} }
#[derive(Copy, Clone, PartialEq)] #[derive(Copy, Clone, PartialEq, Deserialize, Serialize)]
pub enum CompositionStyle { pub enum CompositionStyle {
SrcIn, SrcIn,
SrcOut, SrcOut,
@ -431,7 +459,7 @@ impl CompositionStyle {
} }
} }
#[derive(Copy, Clone, PartialEq)] #[derive(Copy, Clone, PartialEq, Deserialize, Serialize)]
pub enum BlendingStyle { pub enum BlendingStyle {
Multiply, Multiply,
Screen, Screen,
@ -513,7 +541,7 @@ impl BlendingStyle {
} }
} }
#[derive(Copy, Clone, PartialEq)] #[derive(Copy, Clone, PartialEq, Deserialize, Serialize)]
pub enum CompositionOrBlending { pub enum CompositionOrBlending {
Composition(CompositionStyle), Composition(CompositionStyle),
Blending(BlendingStyle), Blending(BlendingStyle),

View file

@ -40,6 +40,12 @@ path = "../util"
[dependencies.devtools_traits] [dependencies.devtools_traits]
path = "../devtools_traits" path = "../devtools_traits"
[dependencies.canvas_traits]
path = "../canvas_traits"
[dependencies.canvas]
path = "../canvas"
[dependencies.azure] [dependencies.azure]
git = "https://github.com/servo/rust-azure" git = "https://github.com/servo/rust-azure"
@ -56,6 +62,10 @@ git = "https://github.com/aweinstock314/rust-clipboard"
[dependencies.ipc-channel] [dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel" git = "https://github.com/pcwalton/ipc-channel"
[dependencies.offscreen_gl_context]
git = "https://github.com/ecoal95/rust-offscreen-rendering-context"
features = ["texture_surface"]
[dependencies] [dependencies]
log = "0.3" log = "0.3"
num = "0.1.24" num = "0.1.24"

View file

@ -11,6 +11,9 @@
use pipeline::{Pipeline, CompositionPipeline}; use pipeline::{Pipeline, CompositionPipeline};
use canvas::canvas_paint_task::CanvasPaintTask;
use canvas::webgl_paint_task::WebGLPaintTask;
use canvas_traits::CanvasMsg;
use compositor_task::CompositorProxy; use compositor_task::CompositorProxy;
use compositor_task::Msg as CompositorMsg; use compositor_task::Msg as CompositorMsg;
use devtools_traits::{DevtoolsControlChan, DevtoolsControlMsg}; use devtools_traits::{DevtoolsControlChan, DevtoolsControlMsg};
@ -35,6 +38,7 @@ use msg::webdriver_msg;
use net_traits::{self, ResourceTask}; use net_traits::{self, ResourceTask};
use net_traits::image_cache_task::ImageCacheTask; use net_traits::image_cache_task::ImageCacheTask;
use net_traits::storage_task::{StorageTask, StorageTaskMsg}; use net_traits::storage_task::{StorageTask, StorageTaskMsg};
use offscreen_gl_context::GLContextAttributes;
use profile_traits::mem; use profile_traits::mem;
use profile_traits::time; use profile_traits::time;
use script_traits::{CompositorEvent, ConstellationControlMsg, LayoutControlMsg}; use script_traits::{CompositorEvent, ConstellationControlMsg, LayoutControlMsg};
@ -44,7 +48,7 @@ use std::collections::HashMap;
use std::io::{self, Write}; use std::io::{self, Write};
use std::marker::PhantomData; use std::marker::PhantomData;
use std::mem::replace; use std::mem::replace;
use std::sync::mpsc::{Receiver, channel}; use std::sync::mpsc::{Receiver, Sender, channel};
use style::viewport::ViewportConstraints; use style::viewport::ViewportConstraints;
use url::Url; use url::Url;
use util::cursor::Cursor; use util::cursor::Cursor;
@ -126,7 +130,13 @@ pub struct Constellation<LTF, STF> {
clipboard_ctx: Option<ClipboardContext>, clipboard_ctx: Option<ClipboardContext>,
/// Bits of state used to interact with the webdriver implementation /// Bits of state used to interact with the webdriver implementation
webdriver: WebDriverData webdriver: WebDriverData,
/// A list of in-process senders to `CanvasPaintTask`s.
canvas_paint_tasks: Vec<Sender<CanvasMsg>>,
/// A list of in-process senders to `WebGLPaintTask`s.
webgl_paint_tasks: Vec<Sender<CanvasMsg>>,
} }
/// Stores the navigation context for a single frame in the frame tree. /// Stores the navigation context for a single frame in the frame tree.
@ -255,7 +265,9 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
} else { } else {
None None
}, },
webdriver: WebDriverData::new() webdriver: WebDriverData::new(),
canvas_paint_tasks: Vec::new(),
webgl_paint_tasks: Vec::new(),
}; };
constellation.run(); constellation.run();
}); });
@ -487,6 +499,14 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
debug!("constellation got head parsed message"); debug!("constellation got head parsed message");
self.compositor_proxy.send(CompositorMsg::HeadParsed); self.compositor_proxy.send(CompositorMsg::HeadParsed);
} }
ConstellationMsg::CreateCanvasPaintTask(size, sender) => {
debug!("constellation got create-canvas-paint-task message");
self.handle_create_canvas_paint_task_msg(&size, sender)
}
ConstellationMsg::CreateWebGLPaintTask(size, attributes, sender) => {
debug!("constellation got create-WebGL-paint-task message");
self.handle_create_webgl_paint_task_msg(&size, attributes, sender)
}
} }
true true
} }
@ -907,6 +927,28 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
} }
} }
fn handle_create_canvas_paint_task_msg(
&mut self,
size: &Size2D<i32>,
response_sender: IpcSender<(IpcSender<CanvasMsg>, usize)>) {
let id = self.canvas_paint_tasks.len();
let (out_of_process_sender, in_process_sender) = CanvasPaintTask::start(*size);
self.canvas_paint_tasks.push(in_process_sender);
response_sender.send((out_of_process_sender, id)).unwrap()
}
fn handle_create_webgl_paint_task_msg(
&mut self,
size: &Size2D<i32>,
attributes: GLContextAttributes,
response_sender: IpcSender<(IpcSender<CanvasMsg>, usize)>) {
let id = self.webgl_paint_tasks.len();
let (out_of_process_sender, in_process_sender) =
WebGLPaintTask::start(*size, attributes).unwrap();
self.webgl_paint_tasks.push(in_process_sender);
response_sender.send((out_of_process_sender, id)).unwrap()
}
fn handle_webdriver_msg(&mut self, msg: WebDriverCommandMsg) { fn handle_webdriver_msg(&mut self, msg: WebDriverCommandMsg) {
// Find the script channel for the given parent pipeline, // Find the script channel for the given parent pipeline,
// and pass the event to that script task. // and pass the event to that script task.

View file

@ -11,12 +11,15 @@
extern crate log; extern crate log;
extern crate azure; extern crate azure;
extern crate canvas;
extern crate canvas_traits;
extern crate devtools_traits; extern crate devtools_traits;
extern crate euclid; extern crate euclid;
extern crate gfx; extern crate gfx;
extern crate ipc_channel; extern crate ipc_channel;
extern crate layers; extern crate layers;
extern crate layout_traits; extern crate layout_traits;
extern crate offscreen_gl_context;
extern crate png; extern crate png;
extern crate script_traits; extern crate script_traits;
extern crate msg; extern crate msg;

View file

@ -11,15 +11,15 @@ use paint_context::PaintContext;
use azure::azure_hl::{SurfaceFormat, Color, DrawTarget, BackendType}; use azure::azure_hl::{SurfaceFormat, Color, DrawTarget, BackendType};
use azure::AzFloat; use azure::AzFloat;
use canvas_traits::CanvasMsg;
use euclid::Matrix4; use euclid::Matrix4;
use euclid::point::Point2D; use euclid::point::Point2D;
use euclid::rect::Rect; use euclid::rect::Rect;
use euclid::size::Size2D; use euclid::size::Size2D;
use ipc_channel::ipc; use ipc_channel::ipc::{self, IpcSender};
use ipc_channel::router::ROUTER; use ipc_channel::router::ROUTER;
use layers::platform::surface::{NativeDisplay, NativeSurface}; use layers::platform::surface::{NativeDisplay, NativeSurface};
use layers::layers::{BufferRequest, LayerBuffer, LayerBufferSet}; use layers::layers::{BufferRequest, LayerBuffer, LayerBufferSet};
use canvas_traits::CanvasMsg;
use msg::compositor_msg::{Epoch, FrameTreeId, LayerId, LayerKind}; use msg::compositor_msg::{Epoch, FrameTreeId, LayerId, LayerKind};
use msg::compositor_msg::{LayerProperties, PaintListener, ScrollPolicy}; use msg::compositor_msg::{LayerProperties, PaintListener, ScrollPolicy};
use msg::constellation_msg::Msg as ConstellationMsg; use msg::constellation_msg::Msg as ConstellationMsg;
@ -30,7 +30,7 @@ use profile_traits::time::{self, profile};
use rand::{self, Rng}; use rand::{self, Rng};
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::mem as std_mem; use std::mem as std_mem;
use std::sync::{Arc, Mutex}; use std::sync::Arc;
use std::sync::mpsc::{Receiver, Sender, channel}; use std::sync::mpsc::{Receiver, Sender, channel};
use std::collections::HashMap; use std::collections::HashMap;
use url::Url; use url::Url;
@ -72,7 +72,7 @@ pub struct PaintRequest {
pub enum Msg { pub enum Msg {
PaintInit(Epoch, Arc<StackingContext>), PaintInit(Epoch, Arc<StackingContext>),
CanvasLayer(LayerId, Arc<Mutex<Sender<CanvasMsg>>>), CanvasLayer(LayerId, IpcSender<CanvasMsg>),
Paint(Vec<PaintRequest>, FrameTreeId), Paint(Vec<PaintRequest>, FrameTreeId),
PaintPermissionGranted, PaintPermissionGranted,
PaintPermissionRevoked, PaintPermissionRevoked,
@ -122,7 +122,7 @@ pub struct PaintTask<C> {
worker_threads: Vec<WorkerThreadProxy>, worker_threads: Vec<WorkerThreadProxy>,
/// A map to track the canvas specific layers /// A map to track the canvas specific layers
canvas_map: HashMap<LayerId, Arc<Mutex<Sender<CanvasMsg>>>>, canvas_map: HashMap<LayerId, IpcSender<CanvasMsg>>,
} }
// If we implement this as a function, we get borrowck errors from borrowing // If we implement this as a function, we get borrowck errors from borrowing

View file

@ -55,6 +55,10 @@ git = "https://github.com/servo/rust-selectors"
[dependencies.clock_ticks] [dependencies.clock_ticks]
git = "https://github.com/tomaka/clock_ticks" git = "https://github.com/tomaka/clock_ticks"
[dependencies.cssparser]
version = "0.3"
features = [ "serde-serialization" ]
[dependencies.ipc-channel] [dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel" git = "https://github.com/pcwalton/ipc-channel"
@ -66,7 +70,6 @@ url = "0.2.36"
bitflags = "0.3" bitflags = "0.3"
rustc-serialize = "0.3" rustc-serialize = "0.3"
libc = "0.1" libc = "0.1"
cssparser = "0.3.1"
smallvec = "0.1" smallvec = "0.1"
string_cache = "0.1" string_cache = "0.1"
string_cache_plugin = "0.1" string_cache_plugin = "0.1"

View file

@ -15,6 +15,7 @@ use euclid::{Rect, Size2D};
use gfx::display_list::OpaqueNode; use gfx::display_list::OpaqueNode;
use gfx::font_cache_task::FontCacheTask; use gfx::font_cache_task::FontCacheTask;
use gfx::font_context::FontContext; use gfx::font_context::FontContext;
use ipc_channel::ipc::IpcSender;
use msg::constellation_msg::ConstellationChan; use msg::constellation_msg::ConstellationChan;
use net_traits::image::base::Image; use net_traits::image::base::Image;
use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask, ImageResponse, ImageState}; use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask, ImageResponse, ImageState};
@ -24,7 +25,7 @@ use std::cell::{RefCell, RefMut};
use std::collections::HashMap; use std::collections::HashMap;
use std::collections::hash_state::DefaultState; use std::collections::hash_state::DefaultState;
use std::rc::Rc; use std::rc::Rc;
use std::sync::{Arc, Mutex}; use std::sync::Arc;
use std::sync::mpsc::{channel, Sender}; use std::sync::mpsc::{channel, Sender};
use style::selector_matching::Stylist; use style::selector_matching::Stylist;
use url::Url; use url::Url;
@ -120,7 +121,7 @@ pub struct SharedLayoutContext {
pub new_animations_sender: Sender<Animation>, pub new_animations_sender: Sender<Animation>,
/// A channel to send canvas renderers to paint task, in order to correctly paint the layers /// A channel to send canvas renderers to paint task, in order to correctly paint the layers
pub canvas_layers_sender: Sender<(LayerId, Option<Arc<Mutex<Sender<CanvasMsg>>>>)>, pub canvas_layers_sender: Sender<(LayerId, IpcSender<CanvasMsg>)>,
/// The visible rects for each layer, as reported to us by the compositor. /// The visible rects for each layer, as reported to us by the compositor.
pub visible_rects: Arc<HashMap<LayerId, Rect<Au>, DefaultState<FnvHasher>>>, pub visible_rects: Arc<HashMap<LayerId, Rect<Au>, DefaultState<FnvHasher>>>,

View file

@ -21,6 +21,7 @@ use list_item::ListItemFlow;
use model::{self, MaybeAuto, ToGfxMatrix, ToAu}; use model::{self, MaybeAuto, ToGfxMatrix, ToAu};
use table_cell::CollapsedBordersForCell; use table_cell::CollapsedBordersForCell;
use canvas_traits::{CanvasMsg, FromLayoutMsg};
use euclid::{Point2D, Point3D, Rect, Size2D, SideOffsets2D}; use euclid::{Point2D, Point3D, Rect, Size2D, SideOffsets2D};
use euclid::Matrix4; use euclid::Matrix4;
use gfx_traits::color; use gfx_traits::color;
@ -32,7 +33,7 @@ use gfx::display_list::{GradientStop, ImageDisplayItem, LineDisplayItem};
use gfx::display_list::{OpaqueNode, SolidColorDisplayItem}; use gfx::display_list::{OpaqueNode, SolidColorDisplayItem};
use gfx::display_list::{StackingContext, TextDisplayItem, TextOrientation}; use gfx::display_list::{StackingContext, TextDisplayItem, TextOrientation};
use gfx::paint_task::{PaintLayer, THREAD_TINT_COLORS}; use gfx::paint_task::{PaintLayer, THREAD_TINT_COLORS};
use ipc_channel::ipc::IpcSharedMemory; use ipc_channel::ipc::{self, IpcSharedMemory};
use msg::compositor_msg::{ScrollPolicy, LayerId}; use msg::compositor_msg::{ScrollPolicy, LayerId};
use msg::constellation_msg::ConstellationChan; use msg::constellation_msg::ConstellationChan;
use msg::constellation_msg::Msg as ConstellationMsg; use msg::constellation_msg::Msg as ConstellationMsg;
@ -41,6 +42,7 @@ use net_traits::image::base::{Image, PixelFormat};
use std::cmp; use std::cmp;
use std::default::Default; use std::default::Default;
use std::sync::Arc; use std::sync::Arc;
use std::sync::mpsc::channel;
use std::f32; use std::f32;
use style::computed_values::filter::Filter; use style::computed_values::filter::Filter;
use style::computed_values::{background_attachment, background_clip, background_origin, use style::computed_values::{background_attachment, background_clip, background_origin,
@ -60,9 +62,6 @@ use util::geometry::{Au, ZERO_POINT};
use util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode}; use util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode};
use util::opts; use util::opts;
use canvas_traits::{CanvasMsg, CanvasCommonMsg};
use std::sync::mpsc::channel;
/// A possible `PaintLayer` for an stacking context /// A possible `PaintLayer` for an stacking context
pub enum StackingContextLayer { pub enum StackingContextLayer {
Existing(PaintLayer), Existing(PaintLayer),
@ -1099,11 +1098,11 @@ impl FragmentDisplayListBuilding for Fragment {
.computed_inline_size.map_or(0, |w| w.to_px() as usize); .computed_inline_size.map_or(0, |w| w.to_px() as usize);
let height = canvas_fragment_info.replaced_image_fragment_info let height = canvas_fragment_info.replaced_image_fragment_info
.computed_block_size.map_or(0, |h| h.to_px() as usize); .computed_block_size.map_or(0, |h| h.to_px() as usize);
let (sender, receiver) = channel::<IpcSharedMemory>(); let (sender, receiver) = ipc::channel::<IpcSharedMemory>().unwrap();
let canvas_data = match canvas_fragment_info.renderer { let canvas_data = match canvas_fragment_info.ipc_renderer {
Some(ref renderer) => { Some(ref ipc_renderer) => {
renderer.lock().unwrap().send(CanvasMsg::Common( ipc_renderer.lock().unwrap().send(CanvasMsg::FromLayout(
CanvasCommonMsg::SendPixelContents(sender))).unwrap(); FromLayoutMsg::SendPixelContents(sender))).unwrap();
receiver.recv().unwrap() receiver.recv().unwrap()
}, },
None => IpcSharedMemory::from_byte(0xFFu8, width * height * 4), None => IpcSharedMemory::from_byte(0xFFu8, width * height * 4),
@ -1248,8 +1247,11 @@ impl FragmentDisplayListBuilding for Fragment {
// task // task
if let SpecificFragmentInfo::Canvas(ref fragment_info) = self.specific { if let SpecificFragmentInfo::Canvas(ref fragment_info) = self.specific {
let layer_id = layer.as_ref().unwrap().id; let layer_id = layer.as_ref().unwrap().id;
layout_context.shared.canvas_layers_sender if let Some(ref ipc_renderer) = fragment_info.ipc_renderer {
.send((layer_id, fragment_info.renderer.clone())).unwrap(); layout_context.shared
.canvas_layers_sender
.send((layer_id, (*ipc_renderer.lock().unwrap()).clone())).unwrap();
}
} }
let transform_style = self.style().get_used_transform_style(); let transform_style = self.style().get_used_transform_style();

View file

@ -24,6 +24,7 @@ use euclid::{Point2D, Rect, Size2D};
use gfx::display_list::{BLUR_INFLATION_FACTOR, OpaqueNode}; use gfx::display_list::{BLUR_INFLATION_FACTOR, OpaqueNode};
use gfx::text::glyph::CharIndex; use gfx::text::glyph::CharIndex;
use gfx::text::text_run::{TextRun, TextRunSlice}; use gfx::text::text_run::{TextRun, TextRunSlice};
use ipc_channel::ipc::IpcSender;
use msg::constellation_msg::{ConstellationChan, Msg, PipelineId, SubpageId}; use msg::constellation_msg::{ConstellationChan, Msg, PipelineId, SubpageId};
use net_traits::image::base::Image; use net_traits::image::base::Image;
use net_traits::image_cache_task::UsePlaceholder; use net_traits::image_cache_task::UsePlaceholder;
@ -32,7 +33,6 @@ use std::borrow::ToOwned;
use std::cmp::{max, min}; use std::cmp::{max, min};
use std::collections::LinkedList; use std::collections::LinkedList;
use std::fmt; use std::fmt;
use std::sync::mpsc::Sender;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use string_cache::Atom; use string_cache::Atom;
use style::computed_values::content::ContentItem; use style::computed_values::content::ContentItem;
@ -291,7 +291,8 @@ impl InlineAbsoluteFragmentInfo {
#[derive(Clone)] #[derive(Clone)]
pub struct CanvasFragmentInfo { pub struct CanvasFragmentInfo {
pub replaced_image_fragment_info: ReplacedImageFragmentInfo, pub replaced_image_fragment_info: ReplacedImageFragmentInfo,
pub renderer: Option<Arc<Mutex<Sender<CanvasMsg>>>>, pub renderer_id: Option<usize>,
pub ipc_renderer: Option<Arc<Mutex<IpcSender<CanvasMsg>>>>,
} }
impl CanvasFragmentInfo { impl CanvasFragmentInfo {
@ -300,7 +301,9 @@ impl CanvasFragmentInfo {
replaced_image_fragment_info: ReplacedImageFragmentInfo::new(node, replaced_image_fragment_info: ReplacedImageFragmentInfo::new(node,
Some(Au::from_px(node.canvas_width() as i32)), Some(Au::from_px(node.canvas_width() as i32)),
Some(Au::from_px(node.canvas_height() as i32))), Some(Au::from_px(node.canvas_height() as i32))),
renderer: node.renderer().map(|rec| Arc::new(Mutex::new(rec))), renderer_id: node.canvas_renderer_id(),
ipc_renderer: node.canvas_ipc_renderer()
.map(|renderer| Arc::new(Mutex::new(renderer))),
} }
} }

View file

@ -39,7 +39,7 @@ use gfx::display_list::StackingContext;
use gfx::font_cache_task::FontCacheTask; use gfx::font_cache_task::FontCacheTask;
use gfx::paint_task::Msg as PaintMsg; use gfx::paint_task::Msg as PaintMsg;
use gfx::paint_task::{PaintChan, PaintLayer}; use gfx::paint_task::{PaintChan, PaintLayer};
use ipc_channel::ipc::{self, IpcReceiver}; use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER; use ipc_channel::router::ROUTER;
use layout_traits::LayoutTaskFactory; use layout_traits::LayoutTaskFactory;
use log; use log;
@ -197,8 +197,8 @@ pub struct LayoutTask {
/// To receive a canvas renderer associated to a layer, this message is propagated /// To receive a canvas renderer associated to a layer, this message is propagated
/// to the paint chan /// to the paint chan
pub canvas_layers_receiver: Receiver<(LayerId, Option<Arc<Mutex<Sender<CanvasMsg>>>>)>, pub canvas_layers_receiver: Receiver<(LayerId, IpcSender<CanvasMsg>)>,
pub canvas_layers_sender: Sender<(LayerId, Option<Arc<Mutex<Sender<CanvasMsg>>>>)>, pub canvas_layers_sender: Sender<(LayerId, IpcSender<CanvasMsg>)>,
/// A mutex to allow for fast, read-only RPC of layout's internal data /// A mutex to allow for fast, read-only RPC of layout's internal data
/// structures, while still letting the LayoutTask modify them. /// structures, while still letting the LayoutTask modify them.
@ -1030,9 +1030,7 @@ impl LayoutTask {
// Send new canvas renderers to the paint task // Send new canvas renderers to the paint task
while let Ok((layer_id, renderer)) = self.canvas_layers_receiver.try_recv() { while let Ok((layer_id, renderer)) = self.canvas_layers_receiver.try_recv() {
// Just send if there's an actual renderer // Just send if there's an actual renderer
if let Some(renderer) = renderer { self.paint_chan.send(PaintMsg::CanvasLayer(layer_id, renderer));
self.paint_chan.send(PaintMsg::CanvasLayer(layer_id, renderer));
}
} }
// Perform post-style recalculation layout passes. // Perform post-style recalculation layout passes.

View file

@ -38,6 +38,7 @@ use data::{LayoutDataFlags, LayoutDataWrapper, PrivateLayoutData};
use opaque_node::OpaqueNodeMethods; use opaque_node::OpaqueNodeMethods;
use gfx::display_list::OpaqueNode; use gfx::display_list::OpaqueNode;
use ipc_channel::ipc::IpcSender;
use script::dom::attr::AttrValue; use script::dom::attr::AttrValue;
use script::dom::bindings::codegen::InheritTypes::{CharacterDataCast, ElementCast}; use script::dom::bindings::codegen::InheritTypes::{CharacterDataCast, ElementCast};
use script::dom::bindings::codegen::InheritTypes::{HTMLIFrameElementCast, HTMLCanvasElementCast}; use script::dom::bindings::codegen::InheritTypes::{HTMLIFrameElementCast, HTMLCanvasElementCast};
@ -63,7 +64,6 @@ use std::borrow::ToOwned;
use std::cell::{Ref, RefMut}; use std::cell::{Ref, RefMut};
use std::marker::PhantomData; use std::marker::PhantomData;
use std::mem; use std::mem;
use std::sync::mpsc::Sender;
use string_cache::{Atom, Namespace}; use string_cache::{Atom, Namespace};
use style::computed_values::content::ContentItem; use style::computed_values::content::ContentItem;
use style::computed_values::{content, display, white_space}; use style::computed_values::{content, display, white_space};
@ -904,10 +904,17 @@ impl<'ln> ThreadSafeLayoutNode<'ln> {
} }
} }
pub fn renderer(&self) -> Option<Sender<CanvasMsg>> { pub fn canvas_renderer_id(&self) -> Option<usize> {
unsafe { unsafe {
let canvas_element = HTMLCanvasElementCast::to_layout_js(self.get_jsmanaged()); let canvas_element = HTMLCanvasElementCast::to_layout_js(self.get_jsmanaged());
canvas_element.and_then(|elem| elem.get_renderer()) canvas_element.and_then(|elem| elem.get_renderer_id())
}
}
pub fn canvas_ipc_renderer(&self) -> Option<IpcSender<CanvasMsg>> {
unsafe {
let canvas_element = HTMLCanvasElementCast::to_layout_js(self.get_jsmanaged());
canvas_element.and_then(|elem| elem.get_ipc_renderer())
} }
} }

View file

@ -13,6 +13,9 @@ path = "../style"
[dependencies.util] [dependencies.util]
path = "../util" path = "../util"
[dependencies.canvas_traits]
path = "../canvas_traits"
[dependencies.azure] [dependencies.azure]
git = "https://github.com/servo/rust-azure" git = "https://github.com/servo/rust-azure"
@ -34,6 +37,10 @@ features = [ "serde_serialization" ]
[dependencies.ipc-channel] [dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel" git = "https://github.com/pcwalton/ipc-channel"
[dependencies.offscreen_gl_context]
git = "https://github.com/ecoal95/rust-offscreen-rendering-context"
features = ["texture_surface"]
[dependencies] [dependencies]
bitflags = "0.3" bitflags = "0.3"
rustc-serialize = "0.3.4" rustc-serialize = "0.3.4"

View file

@ -7,13 +7,15 @@
use compositor_msg::Epoch; use compositor_msg::Epoch;
use canvas_traits::CanvasMsg;
use euclid::rect::Rect; use euclid::rect::Rect;
use euclid::size::TypedSize2D; use euclid::size::{Size2D, TypedSize2D};
use euclid::scale_factor::ScaleFactor; use euclid::scale_factor::ScaleFactor;
use hyper::header::Headers; use hyper::header::Headers;
use hyper::method::Method; use hyper::method::Method;
use ipc_channel::ipc::IpcSender; use ipc_channel::ipc::IpcSender;
use layers::geometry::DevicePixel; use layers::geometry::DevicePixel;
use offscreen_gl_context::GLContextAttributes;
use png::Image; use png::Image;
use util::cursor::Cursor; use util::cursor::Cursor;
use util::geometry::{PagePx, ViewportPx}; use util::geometry::{PagePx, ViewportPx};
@ -257,6 +259,14 @@ pub enum Msg {
NewFavicon(Url), NewFavicon(Url),
/// <head> tag finished parsing /// <head> tag finished parsing
HeadParsed, HeadParsed,
/// Requests that a new 2D canvas thread be created. (This is done in the constellation because
/// 2D canvases may use the GPU and we don't want to give untrusted content access to the GPU.)
CreateCanvasPaintTask(Size2D<i32>, IpcSender<(IpcSender<CanvasMsg>, usize)>),
/// Requests that a new WebGL thread be created. (This is done in the constellation because
/// WebGL uses the GPU and we don't want to give untrusted content access to the GPU.)
CreateWebGLPaintTask(Size2D<i32>,
GLContextAttributes,
IpcSender<(IpcSender<CanvasMsg>, usize)>),
} }
#[derive(Clone, Eq, PartialEq, Deserialize, Serialize)] #[derive(Clone, Eq, PartialEq, Deserialize, Serialize)]

View file

@ -7,10 +7,12 @@
extern crate azure; extern crate azure;
#[macro_use] extern crate bitflags; #[macro_use] extern crate bitflags;
extern crate canvas_traits;
extern crate euclid; extern crate euclid;
extern crate hyper; extern crate hyper;
extern crate ipc_channel; extern crate ipc_channel;
extern crate layers; extern crate layers;
extern crate offscreen_gl_context;
extern crate png; extern crate png;
extern crate rustc_serialize; extern crate rustc_serialize;
extern crate serde; extern crate serde;

View file

@ -58,6 +58,10 @@ features = ["query_encoding", "serde_serialization"]
[dependencies.offscreen_gl_context] [dependencies.offscreen_gl_context]
git = "https://github.com/ecoal95/rust-offscreen-rendering-context" git = "https://github.com/ecoal95/rust-offscreen-rendering-context"
[dependencies.cssparser]
version = "0.3"
features = [ "serde-serialization" ]
[dependencies.ipc-channel] [dependencies.ipc-channel]
git = "https://github.com/pcwalton/ipc-channel" git = "https://github.com/pcwalton/ipc-channel"
@ -73,7 +77,6 @@ time = "0.1.12"
bitflags = "0.3" bitflags = "0.3"
rustc-serialize = "0.3" rustc-serialize = "0.3"
libc = "0.1" libc = "0.1"
cssparser = "0.3.1"
unicase = "0.1" unicase = "0.1"
num = "0.1.24" num = "0.1.24"
websocket = "0.12" websocket = "0.12"

View file

@ -17,7 +17,7 @@ use dom::window::{self, WindowHelpers};
use devtools_traits::DevtoolsControlChan; use devtools_traits::DevtoolsControlChan;
use script_task::{ScriptChan, ScriptPort, ScriptMsg, ScriptTask}; use script_task::{ScriptChan, ScriptPort, ScriptMsg, ScriptTask};
use msg::constellation_msg::{PipelineId, WorkerId}; use msg::constellation_msg::{ConstellationChan, PipelineId, WorkerId};
use net_traits::ResourceTask; use net_traits::ResourceTask;
use profile_traits::mem; use profile_traits::mem;
@ -91,6 +91,14 @@ impl<'a> GlobalRef<'a> {
} }
} }
/// Get a `ConstellationChan` to send messages to the constellation channel when available.
pub fn constellation_chan(&self) -> ConstellationChan {
match *self {
GlobalRef::Window(window) => window.constellation_chan(),
GlobalRef::Worker(worker) => worker.constellation_chan(),
}
}
/// Get a `DevtoolsControlChan` to send messages to Devtools /// Get a `DevtoolsControlChan` to send messages to Devtools
/// task when available. /// task when available.
pub fn devtools_chan(&self) -> Option<DevtoolsControlChan> { pub fn devtools_chan(&self) -> Option<DevtoolsControlChan> {

View file

@ -62,8 +62,8 @@ use msg::compositor_msg::ScriptListener;
use msg::constellation_msg::ConstellationChan; use msg::constellation_msg::ConstellationChan;
use net_traits::image::base::Image; use net_traits::image::base::Image;
use profile_traits::mem::ProfilerChan; use profile_traits::mem::ProfilerChan;
use serde::Serialize;
use util::str::{LengthOrPercentageOrAuto}; use util::str::{LengthOrPercentageOrAuto};
use serde::{Deserialize, Serialize};
use std::cell::{Cell, UnsafeCell, RefCell}; use std::cell::{Cell, UnsafeCell, RefCell};
use std::collections::{HashMap, HashSet}; use std::collections::{HashMap, HashSet};
use std::collections::hash_state::HashState; use std::collections::hash_state::HashState;
@ -332,6 +332,13 @@ impl<A,B> JSTraceable for fn(A) -> B {
} }
} }
impl<T> JSTraceable for IpcSender<T> where T: Deserialize + Serialize {
#[inline]
fn trace(&self, _: *mut JSTracer) {
// Do nothing
}
}
impl JSTraceable for ScriptListener { impl JSTraceable for ScriptListener {
#[inline] #[inline]
fn trace(&self, _: *mut JSTracer) { fn trace(&self, _: *mut JSTracer) {
@ -346,13 +353,6 @@ impl JSTraceable for Box<LayoutRPC+'static> {
} }
} }
impl<T> JSTraceable for IpcSender<T> where T: Serialize {
#[inline]
fn trace(&self, _: *mut JSTracer) {
// Do nothing
}
}
impl JSTraceable for () { impl JSTraceable for () {
#[inline] #[inline]
fn trace(&self, _trc: *mut JSTracer) { fn trace(&self, _trc: *mut JSTracer) {

View file

@ -28,20 +28,22 @@ use euclid::matrix2d::Matrix2D;
use euclid::point::Point2D; use euclid::point::Point2D;
use euclid::rect::Rect; use euclid::rect::Rect;
use euclid::size::Size2D; use euclid::size::Size2D;
use ipc_channel::ipc;
use canvas_traits::{CanvasMsg, Canvas2dMsg, CanvasCommonMsg}; use canvas_traits::{CanvasMsg, Canvas2dMsg, CanvasCommonMsg};
use canvas_traits::{FillOrStrokeStyle, LinearGradientStyle, RadialGradientStyle, RepetitionStyle}; use canvas_traits::{FillOrStrokeStyle, LinearGradientStyle, RadialGradientStyle, RepetitionStyle};
use canvas_traits::{LineCapStyle, LineJoinStyle, CompositionOrBlending}; use canvas_traits::{LineCapStyle, LineJoinStyle, CompositionOrBlending};
use canvas::canvas_paint_task::CanvasPaintTask;
use msg::constellation_msg::Msg as ConstellationMsg;
use net_traits::image_cache_task::{ImageCacheChan, ImageResponse}; use net_traits::image_cache_task::{ImageCacheChan, ImageResponse};
use net_traits::image::base::PixelFormat; use net_traits::image::base::PixelFormat;
use ipc_channel::ipc::IpcSender;
use num::{Float, ToPrimitive}; use num::{Float, ToPrimitive};
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::cell::RefCell; use std::cell::RefCell;
use std::fmt; use std::fmt;
use std::sync::mpsc::{channel, Sender}; use std::sync::mpsc::channel;
use util::str::DOMString; use util::str::DOMString;
use url::Url; use url::Url;
@ -60,7 +62,8 @@ pub enum CanvasFillOrStrokeStyle {
pub struct CanvasRenderingContext2D { pub struct CanvasRenderingContext2D {
reflector_: Reflector, reflector_: Reflector,
global: GlobalField, global: GlobalField,
renderer: Sender<CanvasMsg>, renderer_id: usize,
ipc_renderer: IpcSender<CanvasMsg>,
canvas: JS<HTMLCanvasElement>, canvas: JS<HTMLCanvasElement>,
state: RefCell<CanvasContextState>, state: RefCell<CanvasContextState>,
saved_states: RefCell<Vec<CanvasContextState>>, saved_states: RefCell<Vec<CanvasContextState>>,
@ -115,10 +118,15 @@ impl CanvasContextState {
impl CanvasRenderingContext2D { impl CanvasRenderingContext2D {
fn new_inherited(global: GlobalRef, canvas: &HTMLCanvasElement, size: Size2D<i32>) fn new_inherited(global: GlobalRef, canvas: &HTMLCanvasElement, size: Size2D<i32>)
-> CanvasRenderingContext2D { -> CanvasRenderingContext2D {
let (sender, receiver) = ipc::channel().unwrap();
let constellation_chan = global.constellation_chan();
constellation_chan.0.send(ConstellationMsg::CreateCanvasPaintTask(size, sender)).unwrap();
let (ipc_renderer, renderer_id) = receiver.recv().unwrap();
CanvasRenderingContext2D { CanvasRenderingContext2D {
reflector_: Reflector::new(), reflector_: Reflector::new(),
global: GlobalField::from_rooted(&global), global: GlobalField::from_rooted(&global),
renderer: CanvasPaintTask::start(size), renderer_id: renderer_id,
ipc_renderer: ipc_renderer,
canvas: JS::from_ref(canvas), canvas: JS::from_ref(canvas),
state: RefCell::new(CanvasContextState::new()), state: RefCell::new(CanvasContextState::new()),
saved_states: RefCell::new(Vec::new()), saved_states: RefCell::new(Vec::new()),
@ -132,7 +140,9 @@ impl CanvasRenderingContext2D {
} }
pub fn recreate(&self, size: Size2D<i32>) { pub fn recreate(&self, size: Size2D<i32>) {
self.renderer.send(CanvasMsg::Common(CanvasCommonMsg::Recreate(size))).unwrap(); self.ipc_renderer
.send(CanvasMsg::Common(CanvasCommonMsg::Recreate(size)))
.unwrap();
} }
fn mark_as_dirty(&self) { fn mark_as_dirty(&self) {
@ -142,7 +152,9 @@ impl CanvasRenderingContext2D {
} }
fn update_transform(&self) { fn update_transform(&self) {
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetTransform(self.state.borrow().transform))).unwrap() self.ipc_renderer
.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetTransform(self.state.borrow().transform)))
.unwrap()
} }
// It is used by DrawImage to calculate the size of the source and destination rectangles based // It is used by DrawImage to calculate the size of the source and destination rectangles based
@ -237,17 +249,19 @@ impl CanvasRenderingContext2D {
None => return Err(InvalidState), None => return Err(InvalidState),
}; };
let renderer = context.r().get_renderer(); let renderer = context.r().get_ipc_renderer();
let (sender, receiver) = channel::<Vec<u8>>(); let (sender, receiver) = ipc::channel::<Vec<u8>>().unwrap();
// Reads pixels from source image // Reads pixels from source image
renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::GetImageData(source_rect, image_size, sender))).unwrap(); renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::GetImageData(source_rect,
image_size,
sender))).unwrap();
let imagedata = receiver.recv().unwrap(); let imagedata = receiver.recv().unwrap();
// Writes pixels to destination canvas // Writes pixels to destination canvas
CanvasMsg::Canvas2d( CanvasMsg::Canvas2d(
Canvas2dMsg::DrawImage(imagedata, source_rect.size, dest_rect, source_rect, smoothing_enabled)) Canvas2dMsg::DrawImage(imagedata, source_rect.size, dest_rect, source_rect, smoothing_enabled))
}; };
self.renderer.send(msg).unwrap(); self.ipc_renderer.send(msg).unwrap();
self.mark_as_dirty(); self.mark_as_dirty();
Ok(()) Ok(())
} }
@ -265,9 +279,13 @@ impl CanvasRenderingContext2D {
} }
let smoothing_enabled = self.state.borrow().image_smoothing_enabled; let smoothing_enabled = self.state.borrow().image_smoothing_enabled;
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::DrawImage( self.ipc_renderer
image_data, image_size, dest_rect, .send(CanvasMsg::Canvas2d(Canvas2dMsg::DrawImage(image_data,
source_rect, smoothing_enabled))).unwrap(); image_size,
dest_rect,
source_rect,
smoothing_enabled)))
.unwrap();
self.mark_as_dirty(); self.mark_as_dirty();
Ok(()) Ok(())
} }
@ -282,7 +300,9 @@ impl CanvasRenderingContext2D {
let img = match self.request_image_from_cache(url) { let img = match self.request_image_from_cache(url) {
ImageResponse::Loaded(img) => img, ImageResponse::Loaded(img) => img,
ImageResponse::PlaceholderLoaded(_) | ImageResponse::None => return None, ImageResponse::PlaceholderLoaded(_) | ImageResponse::None => {
return None
}
}; };
let image_size = Size2D::new(img.width as f64, img.height as f64); let image_size = Size2D::new(img.width as f64, img.height as f64);
@ -308,8 +328,8 @@ impl CanvasRenderingContext2D {
let canvas_size = canvas_element.get_size(); let canvas_size = canvas_element.get_size();
let image_size = Size2D::new(canvas_size.width as f64, canvas_size.height as f64); let image_size = Size2D::new(canvas_size.width as f64, canvas_size.height as f64);
let renderer = context.r().get_renderer(); let renderer = context.r().get_ipc_renderer();
let (sender, receiver) = channel::<Vec<u8>>(); let (sender, receiver) = ipc::channel::<Vec<u8>>().unwrap();
// Reads pixels from source canvas // Reads pixels from source canvas
renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::GetImageData(source_rect, image_size, sender))).unwrap(); renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::GetImageData(source_rect, image_size, sender))).unwrap();
@ -341,24 +361,34 @@ impl CanvasRenderingContext2D {
} }
pub trait CanvasRenderingContext2DHelpers { pub trait CanvasRenderingContext2DHelpers {
fn get_renderer(self) -> Sender<CanvasMsg>; fn get_renderer_id(self) -> usize;
fn get_ipc_renderer(self) -> IpcSender<CanvasMsg>;
} }
impl<'a> CanvasRenderingContext2DHelpers for &'a CanvasRenderingContext2D { impl<'a> CanvasRenderingContext2DHelpers for &'a CanvasRenderingContext2D {
fn get_renderer(self) -> Sender<CanvasMsg> { fn get_renderer_id(self) -> usize {
self.renderer.clone() self.renderer_id
}
fn get_ipc_renderer(self) -> IpcSender<CanvasMsg> {
self.ipc_renderer.clone()
} }
} }
pub trait LayoutCanvasRenderingContext2DHelpers { pub trait LayoutCanvasRenderingContext2DHelpers {
#[allow(unsafe_code)] #[allow(unsafe_code)]
unsafe fn get_renderer(&self) -> Sender<CanvasMsg>; unsafe fn get_renderer_id(&self) -> usize;
#[allow(unsafe_code)]
unsafe fn get_ipc_renderer(&self) -> IpcSender<CanvasMsg>;
} }
impl LayoutCanvasRenderingContext2DHelpers for LayoutJS<CanvasRenderingContext2D> { impl LayoutCanvasRenderingContext2DHelpers for LayoutJS<CanvasRenderingContext2D> {
#[allow(unsafe_code)] #[allow(unsafe_code)]
unsafe fn get_renderer(&self) -> Sender<CanvasMsg> { unsafe fn get_renderer_id(&self) -> usize {
(*self.unsafe_get()).renderer.clone() (*self.unsafe_get()).renderer_id
}
#[allow(unsafe_code)]
unsafe fn get_ipc_renderer(&self) -> IpcSender<CanvasMsg> {
(*self.unsafe_get()).ipc_renderer.clone()
} }
} }
@ -380,7 +410,7 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
// https://html.spec.whatwg.org/multipage/#dom-context-2d-save // https://html.spec.whatwg.org/multipage/#dom-context-2d-save
fn Save(self) { fn Save(self) {
self.saved_states.borrow_mut().push(self.state.borrow().clone()); self.saved_states.borrow_mut().push(self.state.borrow().clone());
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::SaveContext)).unwrap(); self.ipc_renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::SaveContext)).unwrap();
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-restore // https://html.spec.whatwg.org/multipage/#dom-context-2d-restore
@ -388,7 +418,7 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
let mut saved_states = self.saved_states.borrow_mut(); let mut saved_states = self.saved_states.borrow_mut();
if let Some(state) = saved_states.pop() { if let Some(state) = saved_states.pop() {
self.state.borrow_mut().clone_from(&state); self.state.borrow_mut().clone_from(&state);
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::RestoreContext)).unwrap(); self.ipc_renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::RestoreContext)).unwrap();
} }
} }
@ -480,7 +510,9 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
} }
self.state.borrow_mut().global_alpha = alpha; self.state.borrow_mut().global_alpha = alpha;
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetGlobalAlpha(alpha as f32))).unwrap() self.ipc_renderer
.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetGlobalAlpha(alpha as f32)))
.unwrap()
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-globalcompositeoperation // https://html.spec.whatwg.org/multipage/#dom-context-2d-globalcompositeoperation
@ -496,14 +528,16 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
fn SetGlobalCompositeOperation(self, op_str: DOMString) { fn SetGlobalCompositeOperation(self, op_str: DOMString) {
if let Some(op) = CompositionOrBlending::from_str(&op_str) { if let Some(op) = CompositionOrBlending::from_str(&op_str) {
self.state.borrow_mut().global_composition = op; self.state.borrow_mut().global_composition = op;
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetGlobalComposition(op))).unwrap() self.ipc_renderer
.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetGlobalComposition(op)))
.unwrap()
} }
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-fillrect // https://html.spec.whatwg.org/multipage/#dom-context-2d-fillrect
fn FillRect(self, x: f64, y: f64, width: f64, height: f64) { fn FillRect(self, x: f64, y: f64, width: f64, height: f64) {
if let Some(rect) = self.create_drawable_rect(x, y, width, height) { if let Some(rect) = self.create_drawable_rect(x, y, width, height) {
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::FillRect(rect))).unwrap(); self.ipc_renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::FillRect(rect))).unwrap();
self.mark_as_dirty(); self.mark_as_dirty();
} }
} }
@ -511,7 +545,9 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
// https://html.spec.whatwg.org/multipage/#dom-context-2d-clearrect // https://html.spec.whatwg.org/multipage/#dom-context-2d-clearrect
fn ClearRect(self, x: f64, y: f64, width: f64, height: f64) { fn ClearRect(self, x: f64, y: f64, width: f64, height: f64) {
if let Some(rect) = self.create_drawable_rect(x, y, width, height) { if let Some(rect) = self.create_drawable_rect(x, y, width, height) {
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::ClearRect(rect))).unwrap(); self.ipc_renderer
.send(CanvasMsg::Canvas2d(Canvas2dMsg::ClearRect(rect)))
.unwrap();
self.mark_as_dirty(); self.mark_as_dirty();
} }
} }
@ -519,38 +555,40 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
// https://html.spec.whatwg.org/multipage/#dom-context-2d-strokerect // https://html.spec.whatwg.org/multipage/#dom-context-2d-strokerect
fn StrokeRect(self, x: f64, y: f64, width: f64, height: f64) { fn StrokeRect(self, x: f64, y: f64, width: f64, height: f64) {
if let Some(rect) = self.create_drawable_rect(x, y, width, height) { if let Some(rect) = self.create_drawable_rect(x, y, width, height) {
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::StrokeRect(rect))).unwrap(); self.ipc_renderer
.send(CanvasMsg::Canvas2d(Canvas2dMsg::StrokeRect(rect)))
.unwrap();
self.mark_as_dirty(); self.mark_as_dirty();
} }
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-beginpath // https://html.spec.whatwg.org/multipage/#dom-context-2d-beginpath
fn BeginPath(self) { fn BeginPath(self) {
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::BeginPath)).unwrap(); self.ipc_renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::BeginPath)).unwrap();
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-closepath // https://html.spec.whatwg.org/multipage/#dom-context-2d-closepath
fn ClosePath(self) { fn ClosePath(self) {
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::ClosePath)).unwrap(); self.ipc_renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::ClosePath)).unwrap();
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-fill // https://html.spec.whatwg.org/multipage/#dom-context-2d-fill
fn Fill(self, _: CanvasWindingRule) { fn Fill(self, _: CanvasWindingRule) {
// TODO: Process winding rule // TODO: Process winding rule
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::Fill)).unwrap(); self.ipc_renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::Fill)).unwrap();
self.mark_as_dirty(); self.mark_as_dirty();
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-stroke // https://html.spec.whatwg.org/multipage/#dom-context-2d-stroke
fn Stroke(self) { fn Stroke(self) {
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::Stroke)).unwrap(); self.ipc_renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::Stroke)).unwrap();
self.mark_as_dirty(); self.mark_as_dirty();
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-clip // https://html.spec.whatwg.org/multipage/#dom-context-2d-clip
fn Clip(self, _: CanvasWindingRule) { fn Clip(self, _: CanvasWindingRule) {
// TODO: Process winding rule // TODO: Process winding rule
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::Clip)).unwrap(); self.ipc_renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::Clip)).unwrap();
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-drawimage // https://html.spec.whatwg.org/multipage/#dom-context-2d-drawimage
@ -728,7 +766,7 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
let msg = CanvasMsg::Canvas2d( let msg = CanvasMsg::Canvas2d(
Canvas2dMsg::MoveTo( Canvas2dMsg::MoveTo(
Point2D::new(x as f32, y as f32))); Point2D::new(x as f32, y as f32)));
self.renderer.send(msg).unwrap(); self.ipc_renderer.send(msg).unwrap();
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-lineto // https://html.spec.whatwg.org/multipage/#dom-context-2d-lineto
@ -740,7 +778,7 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
let msg = CanvasMsg::Canvas2d( let msg = CanvasMsg::Canvas2d(
Canvas2dMsg::LineTo( Canvas2dMsg::LineTo(
Point2D::new(x as f32, y as f32))); Point2D::new(x as f32, y as f32)));
self.renderer.send(msg).unwrap(); self.ipc_renderer.send(msg).unwrap();
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-rect // https://html.spec.whatwg.org/multipage/#dom-context-2d-rect
@ -749,7 +787,7 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
let rect = Rect::new(Point2D::new(x as f32, y as f32), let rect = Rect::new(Point2D::new(x as f32, y as f32),
Size2D::new(width as f32, height as f32)); Size2D::new(width as f32, height as f32));
let msg = CanvasMsg::Canvas2d(Canvas2dMsg::Rect(rect)); let msg = CanvasMsg::Canvas2d(Canvas2dMsg::Rect(rect));
self.renderer.send(msg).unwrap(); self.ipc_renderer.send(msg).unwrap();
} }
} }
@ -764,7 +802,7 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
Canvas2dMsg::QuadraticCurveTo( Canvas2dMsg::QuadraticCurveTo(
Point2D::new(cpx as f32, cpy as f32), Point2D::new(cpx as f32, cpy as f32),
Point2D::new(x as f32, y as f32))); Point2D::new(x as f32, y as f32)));
self.renderer.send(msg).unwrap(); self.ipc_renderer.send(msg).unwrap();
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-beziercurveto // https://html.spec.whatwg.org/multipage/#dom-context-2d-beziercurveto
@ -779,7 +817,7 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
Point2D::new(cp1x as f32, cp1y as f32), Point2D::new(cp1x as f32, cp1y as f32),
Point2D::new(cp2x as f32, cp2y as f32), Point2D::new(cp2x as f32, cp2y as f32),
Point2D::new(x as f32, y as f32))); Point2D::new(x as f32, y as f32)));
self.renderer.send(msg).unwrap(); self.ipc_renderer.send(msg).unwrap();
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-arc // https://html.spec.whatwg.org/multipage/#dom-context-2d-arc
@ -800,7 +838,7 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
Point2D::new(x as f32, y as f32), r as f32, Point2D::new(x as f32, y as f32), r as f32,
start as f32, end as f32, ccw)); start as f32, end as f32, ccw));
self.renderer.send(msg).unwrap(); self.ipc_renderer.send(msg).unwrap();
Ok(()) Ok(())
} }
@ -818,7 +856,7 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
Point2D::new(cp1x as f32, cp1y as f32), Point2D::new(cp1x as f32, cp1y as f32),
Point2D::new(cp2x as f32, cp2y as f32), Point2D::new(cp2x as f32, cp2y as f32),
r as f32)); r as f32));
self.renderer.send(msg).unwrap(); self.ipc_renderer.send(msg).unwrap();
Ok(()) Ok(())
} }
@ -854,8 +892,9 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
match parse_color(&string) { match parse_color(&string) {
Ok(rgba) => { Ok(rgba) => {
self.state.borrow_mut().stroke_style = CanvasFillOrStrokeStyle::Color(rgba); self.state.borrow_mut().stroke_style = CanvasFillOrStrokeStyle::Color(rgba);
self.renderer self.ipc_renderer
.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetStrokeStyle(FillOrStrokeStyle::Color(rgba)))) .send(CanvasMsg::Canvas2d(Canvas2dMsg::SetStrokeStyle(
FillOrStrokeStyle::Color(rgba))))
.unwrap(); .unwrap();
} }
_ => {} _ => {}
@ -866,7 +905,7 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
JS::from_ref(gradient.r())); JS::from_ref(gradient.r()));
let msg = CanvasMsg::Canvas2d( let msg = CanvasMsg::Canvas2d(
Canvas2dMsg::SetStrokeStyle(gradient.r().to_fill_or_stroke_style())); Canvas2dMsg::SetStrokeStyle(gradient.r().to_fill_or_stroke_style()));
self.renderer.send(msg).unwrap(); self.ipc_renderer.send(msg).unwrap();
}, },
_ => {} _ => {}
} }
@ -893,8 +932,9 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
match parse_color(&string) { match parse_color(&string) {
Ok(rgba) => { Ok(rgba) => {
self.state.borrow_mut().fill_style = CanvasFillOrStrokeStyle::Color(rgba); self.state.borrow_mut().fill_style = CanvasFillOrStrokeStyle::Color(rgba);
self.renderer self.ipc_renderer
.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetFillStyle(FillOrStrokeStyle::Color(rgba)))) .send(CanvasMsg::Canvas2d(Canvas2dMsg::SetFillStyle(
FillOrStrokeStyle::Color(rgba))))
.unwrap() .unwrap()
} }
_ => {} _ => {}
@ -905,10 +945,10 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
JS::from_rooted(&gradient)); JS::from_rooted(&gradient));
let msg = CanvasMsg::Canvas2d( let msg = CanvasMsg::Canvas2d(
Canvas2dMsg::SetFillStyle(gradient.r().to_fill_or_stroke_style())); Canvas2dMsg::SetFillStyle(gradient.r().to_fill_or_stroke_style()));
self.renderer.send(msg).unwrap(); self.ipc_renderer.send(msg).unwrap();
} }
StringOrCanvasGradientOrCanvasPattern::eCanvasPattern(pattern) => { StringOrCanvasGradientOrCanvasPattern::eCanvasPattern(pattern) => {
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetFillStyle( self.ipc_renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetFillStyle(
pattern.r().to_fill_or_stroke_style()))).unwrap(); pattern.r().to_fill_or_stroke_style()))).unwrap();
} }
} }
@ -947,12 +987,14 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
return Err(IndexSize) return Err(IndexSize)
} }
let (sender, receiver) = channel::<Vec<u8>>(); let (sender, receiver) = ipc::channel::<Vec<u8>>().unwrap();
let dest_rect = Rect::new(Point2D::new(sx as f64, sy as f64), let dest_rect = Rect::new(Point2D::new(sx as f64, sy as f64),
Size2D::new(sw as f64, sh as f64)); Size2D::new(sw as f64, sh as f64));
let canvas_size = self.canvas.root().r().get_size(); let canvas_size = self.canvas.root().r().get_size();
let canvas_size = Size2D::new(canvas_size.width as f64, canvas_size.height as f64); let canvas_size = Size2D::new(canvas_size.width as f64, canvas_size.height as f64);
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::GetImageData(dest_rect, canvas_size, sender))).unwrap(); self.ipc_renderer
.send(CanvasMsg::Canvas2d(Canvas2dMsg::GetImageData(dest_rect, canvas_size, sender)))
.unwrap();
let data = receiver.recv().unwrap(); let data = receiver.recv().unwrap();
Ok(ImageData::new(self.global.root().r(), sw.abs().to_u32().unwrap(), sh.abs().to_u32().unwrap(), Some(data))) Ok(ImageData::new(self.global.root().r(), sw.abs().to_u32().unwrap(), sh.abs().to_u32().unwrap(), Some(data)))
} }
@ -975,7 +1017,7 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
let image_data_rect = Rect::new(Point2D::new(dx, dy), image_data_size); let image_data_rect = Rect::new(Point2D::new(dx, dy), image_data_size);
let dirty_rect = None; let dirty_rect = None;
let msg = CanvasMsg::Canvas2d(Canvas2dMsg::PutImageData(data, image_data_rect, dirty_rect)); let msg = CanvasMsg::Canvas2d(Canvas2dMsg::PutImageData(data, image_data_rect, dirty_rect));
self.renderer.send(msg).unwrap(); self.ipc_renderer.send(msg).unwrap();
self.mark_as_dirty(); self.mark_as_dirty();
} }
@ -1003,7 +1045,7 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
let dirty_rect = Some(Rect::new(Point2D::new(dirtyX, dirtyY), let dirty_rect = Some(Rect::new(Point2D::new(dirtyX, dirtyY),
Size2D::new(dirtyWidth, dirtyHeight))); Size2D::new(dirtyWidth, dirtyHeight)));
let msg = CanvasMsg::Canvas2d(Canvas2dMsg::PutImageData(data, image_data_rect, dirty_rect)); let msg = CanvasMsg::Canvas2d(Canvas2dMsg::PutImageData(data, image_data_rect, dirty_rect));
self.renderer.send(msg).unwrap(); self.ipc_renderer.send(msg).unwrap();
self.mark_as_dirty(); self.mark_as_dirty();
} }
@ -1106,7 +1148,9 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
} }
self.state.borrow_mut().line_width = width; self.state.borrow_mut().line_width = width;
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetLineWidth(width as f32))).unwrap() self.ipc_renderer
.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetLineWidth(width as f32)))
.unwrap()
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-linecap // https://html.spec.whatwg.org/multipage/#dom-context-2d-linecap
@ -1123,7 +1167,7 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
fn SetLineCap(self, cap_str: DOMString) { fn SetLineCap(self, cap_str: DOMString) {
if let Some(cap) = LineCapStyle::from_str(&cap_str) { if let Some(cap) = LineCapStyle::from_str(&cap_str) {
self.state.borrow_mut().line_cap = cap; self.state.borrow_mut().line_cap = cap;
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetLineCap(cap))).unwrap() self.ipc_renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetLineCap(cap))).unwrap()
} }
} }
@ -1141,7 +1185,7 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
fn SetLineJoin(self, join_str: DOMString) { fn SetLineJoin(self, join_str: DOMString) {
if let Some(join) = LineJoinStyle::from_str(&join_str) { if let Some(join) = LineJoinStyle::from_str(&join_str) {
self.state.borrow_mut().line_join = join; self.state.borrow_mut().line_join = join;
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetLineJoin(join))).unwrap() self.ipc_renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetLineJoin(join))).unwrap()
} }
} }
@ -1158,7 +1202,9 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
} }
self.state.borrow_mut().miter_limit = limit; self.state.borrow_mut().miter_limit = limit;
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetMiterLimit(limit as f32))).unwrap() self.ipc_renderer
.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetMiterLimit(limit as f32)))
.unwrap()
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-shadowoffsetx // https://html.spec.whatwg.org/multipage/#dom-context-2d-shadowoffsetx
@ -1172,7 +1218,7 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
return; return;
} }
self.state.borrow_mut().shadow_offset_x = value; self.state.borrow_mut().shadow_offset_x = value;
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetShadowOffsetX(value))).unwrap() self.ipc_renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetShadowOffsetX(value))).unwrap()
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-shadowoffsety // https://html.spec.whatwg.org/multipage/#dom-context-2d-shadowoffsety
@ -1186,7 +1232,7 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
return; return;
} }
self.state.borrow_mut().shadow_offset_y = value; self.state.borrow_mut().shadow_offset_y = value;
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetShadowOffsetY(value))).unwrap() self.ipc_renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetShadowOffsetY(value))).unwrap()
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-shadowblur // https://html.spec.whatwg.org/multipage/#dom-context-2d-shadowblur
@ -1200,7 +1246,7 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
return; return;
} }
self.state.borrow_mut().shadow_blur = value; self.state.borrow_mut().shadow_blur = value;
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetShadowBlur(value))).unwrap() self.ipc_renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetShadowBlur(value))).unwrap()
} }
// https://html.spec.whatwg.org/multipage/#dom-context-2d-shadowcolor // https://html.spec.whatwg.org/multipage/#dom-context-2d-shadowcolor
@ -1214,14 +1260,16 @@ impl<'a> CanvasRenderingContext2DMethods for &'a CanvasRenderingContext2D {
fn SetShadowColor(self, value: DOMString) { fn SetShadowColor(self, value: DOMString) {
if let Ok(color) = parse_color(&value) { if let Ok(color) = parse_color(&value) {
self.state.borrow_mut().shadow_color = color; self.state.borrow_mut().shadow_color = color;
self.renderer.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetShadowColor(color))).unwrap() self.ipc_renderer
.send(CanvasMsg::Canvas2d(Canvas2dMsg::SetShadowColor(color)))
.unwrap()
} }
} }
} }
impl Drop for CanvasRenderingContext2D { impl Drop for CanvasRenderingContext2D {
fn drop(&mut self) { fn drop(&mut self) {
self.renderer.send(CanvasMsg::Common(CanvasCommonMsg::Close)).unwrap(); self.ipc_renderer.send(CanvasMsg::Common(CanvasCommonMsg::Close)).unwrap();
} }
} }

View file

@ -24,7 +24,7 @@ use dom::workerglobalscope::WorkerGlobalScopeTypeId;
use script_task::{ScriptTask, ScriptChan, ScriptMsg, TimerSource, ScriptPort}; use script_task::{ScriptTask, ScriptChan, ScriptMsg, TimerSource, ScriptPort};
use script_task::StackRootTLS; use script_task::StackRootTLS;
use msg::constellation_msg::PipelineId; use msg::constellation_msg::{ConstellationChan, PipelineId};
use devtools_traits::DevtoolsControlChan; use devtools_traits::DevtoolsControlChan;
@ -113,6 +113,7 @@ impl DedicatedWorkerGlobalScope {
devtools_chan: Option<DevtoolsControlChan>, devtools_chan: Option<DevtoolsControlChan>,
runtime: Rc<Runtime>, runtime: Rc<Runtime>,
resource_task: ResourceTask, resource_task: ResourceTask,
constellation_chan: ConstellationChan,
parent_sender: Box<ScriptChan+Send>, parent_sender: Box<ScriptChan+Send>,
own_sender: Sender<(TrustedWorkerAddress, ScriptMsg)>, own_sender: Sender<(TrustedWorkerAddress, ScriptMsg)>,
receiver: Receiver<(TrustedWorkerAddress, ScriptMsg)>) receiver: Receiver<(TrustedWorkerAddress, ScriptMsg)>)
@ -120,7 +121,7 @@ impl DedicatedWorkerGlobalScope {
DedicatedWorkerGlobalScope { DedicatedWorkerGlobalScope {
workerglobalscope: WorkerGlobalScope::new_inherited( workerglobalscope: WorkerGlobalScope::new_inherited(
WorkerGlobalScopeTypeId::DedicatedGlobalScope, worker_url, WorkerGlobalScopeTypeId::DedicatedGlobalScope, worker_url,
runtime, resource_task, mem_profiler_chan, devtools_chan), runtime, resource_task, mem_profiler_chan, devtools_chan, constellation_chan),
id: id, id: id,
receiver: receiver, receiver: receiver,
own_sender: own_sender, own_sender: own_sender,
@ -135,13 +136,14 @@ impl DedicatedWorkerGlobalScope {
devtools_chan: Option<DevtoolsControlChan>, devtools_chan: Option<DevtoolsControlChan>,
runtime: Rc<Runtime>, runtime: Rc<Runtime>,
resource_task: ResourceTask, resource_task: ResourceTask,
constellation_chan: ConstellationChan,
parent_sender: Box<ScriptChan+Send>, parent_sender: Box<ScriptChan+Send>,
own_sender: Sender<(TrustedWorkerAddress, ScriptMsg)>, own_sender: Sender<(TrustedWorkerAddress, ScriptMsg)>,
receiver: Receiver<(TrustedWorkerAddress, ScriptMsg)>) receiver: Receiver<(TrustedWorkerAddress, ScriptMsg)>)
-> Root<DedicatedWorkerGlobalScope> { -> Root<DedicatedWorkerGlobalScope> {
let scope = box DedicatedWorkerGlobalScope::new_inherited( let scope = box DedicatedWorkerGlobalScope::new_inherited(
worker_url, id, mem_profiler_chan, devtools_chan, runtime.clone(), resource_task, worker_url, id, mem_profiler_chan, devtools_chan, runtime.clone(), resource_task,
parent_sender, own_sender, receiver); constellation_chan, parent_sender, own_sender, receiver);
DedicatedWorkerGlobalScopeBinding::Wrap(runtime.cx(), scope) DedicatedWorkerGlobalScopeBinding::Wrap(runtime.cx(), scope)
} }
} }
@ -153,6 +155,7 @@ impl DedicatedWorkerGlobalScope {
devtools_chan: Option<DevtoolsControlChan>, devtools_chan: Option<DevtoolsControlChan>,
worker: TrustedWorkerAddress, worker: TrustedWorkerAddress,
resource_task: ResourceTask, resource_task: ResourceTask,
constellation_chan: ConstellationChan,
parent_sender: Box<ScriptChan+Send>, parent_sender: Box<ScriptChan+Send>,
own_sender: Sender<(TrustedWorkerAddress, ScriptMsg)>, own_sender: Sender<(TrustedWorkerAddress, ScriptMsg)>,
receiver: Receiver<(TrustedWorkerAddress, ScriptMsg)>) { receiver: Receiver<(TrustedWorkerAddress, ScriptMsg)>) {
@ -180,7 +183,7 @@ impl DedicatedWorkerGlobalScope {
let parent_sender_for_reporter = parent_sender.clone(); let parent_sender_for_reporter = parent_sender.clone();
let global = DedicatedWorkerGlobalScope::new( let global = DedicatedWorkerGlobalScope::new(
url, id, mem_profiler_chan.clone(), devtools_chan, runtime.clone(), resource_task, url, id, mem_profiler_chan.clone(), devtools_chan, runtime.clone(), resource_task,
parent_sender, own_sender, receiver); constellation_chan, parent_sender, own_sender, receiver);
// FIXME(njn): workers currently don't have a unique ID suitable for using in reporter // FIXME(njn): workers currently don't have a unique ID suitable for using in reporter
// registration (#6631), so we instead use a random number and cross our fingers. // registration (#6631), so we instead use a random number and cross our fingers.
let reporter_name = format!("worker-reporter-{}", random::<u64>()); let reporter_name = format!("worker-reporter-{}", random::<u64>());

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use canvas_traits::CanvasMsg;
use dom::attr::Attr; use dom::attr::Attr;
use dom::attr::AttrHelpers; use dom::attr::AttrHelpers;
use dom::bindings::codegen::Bindings::HTMLCanvasElementBinding; use dom::bindings::codegen::Bindings::HTMLCanvasElementBinding;
@ -27,12 +26,13 @@ use dom::webglrenderingcontext::{WebGLRenderingContext, LayoutCanvasWebGLRenderi
use util::str::{DOMString, parse_unsigned_integer}; use util::str::{DOMString, parse_unsigned_integer};
use js::jsapi::{JSContext, HandleValue}; use js::jsapi::{JSContext, HandleValue};
use offscreen_gl_context::GLContextAttributes; use offscreen_gl_context::GLContextAttributes;
use canvas_traits::CanvasMsg;
use ipc_channel::ipc::IpcSender;
use euclid::size::Size2D; use euclid::size::Size2D;
use std::cell::Cell; use std::cell::Cell;
use std::default::Default; use std::default::Default;
use std::sync::mpsc::Sender;
const DEFAULT_WIDTH: u32 = 300; const DEFAULT_WIDTH: u32 = 300;
const DEFAULT_HEIGHT: u32 = 150; const DEFAULT_HEIGHT: u32 = 150;
@ -106,7 +106,9 @@ impl HTMLCanvasElement {
pub trait LayoutHTMLCanvasElementHelpers { pub trait LayoutHTMLCanvasElementHelpers {
#[allow(unsafe_code)] #[allow(unsafe_code)]
unsafe fn get_renderer(&self) -> Option<Sender<CanvasMsg>>; unsafe fn get_renderer_id(&self) -> Option<usize>;
#[allow(unsafe_code)]
unsafe fn get_ipc_renderer(&self) -> Option<IpcSender<CanvasMsg>>;
#[allow(unsafe_code)] #[allow(unsafe_code)]
unsafe fn get_canvas_width(&self) -> u32; unsafe fn get_canvas_width(&self) -> u32;
#[allow(unsafe_code)] #[allow(unsafe_code)]
@ -115,14 +117,25 @@ pub trait LayoutHTMLCanvasElementHelpers {
impl LayoutHTMLCanvasElementHelpers for LayoutJS<HTMLCanvasElement> { impl LayoutHTMLCanvasElementHelpers for LayoutJS<HTMLCanvasElement> {
#[allow(unsafe_code)] #[allow(unsafe_code)]
unsafe fn get_renderer(&self) -> Option<Sender<CanvasMsg>> { unsafe fn get_renderer_id(&self) -> Option<usize> {
let ref canvas = *self.unsafe_get(); let ref canvas = *self.unsafe_get();
if let Some(context) = canvas.context.get() { if let Some(context) = canvas.context.get() {
match context { match context {
CanvasContext::Context2d(context) CanvasContext::Context2d(context) => Some(context.to_layout().get_renderer_id()),
=> Some(context.to_layout().get_renderer()), CanvasContext::WebGL(context) => Some(context.to_layout().get_renderer_id()),
CanvasContext::WebGL(context) }
=> Some(context.to_layout().get_renderer()), } else {
None
}
}
#[allow(unsafe_code)]
unsafe fn get_ipc_renderer(&self) -> Option<IpcSender<CanvasMsg>> {
let ref canvas = *self.unsafe_get();
if let Some(context) = canvas.context.get() {
match context {
CanvasContext::Context2d(context) => Some(context.to_layout().get_ipc_renderer()),
CanvasContext::WebGL(context) => Some(context.to_layout().get_ipc_renderer()),
} }
} else { } else {
None None

View file

@ -10,7 +10,7 @@ use dom::bindings::utils::reflect_dom_object;
use dom::webglobject::WebGLObject; use dom::webglobject::WebGLObject;
use canvas_traits::{CanvasMsg, CanvasWebGLMsg}; use canvas_traits::{CanvasMsg, CanvasWebGLMsg};
use std::sync::mpsc::{channel, Sender}; use ipc_channel::ipc::{self, IpcSender};
use std::cell::Cell; use std::cell::Cell;
#[dom_struct] #[dom_struct]
@ -18,11 +18,11 @@ pub struct WebGLBuffer {
webgl_object: WebGLObject, webgl_object: WebGLObject,
id: u32, id: u32,
is_deleted: Cell<bool>, is_deleted: Cell<bool>,
renderer: Sender<CanvasMsg>, renderer: IpcSender<CanvasMsg>,
} }
impl WebGLBuffer { impl WebGLBuffer {
fn new_inherited(renderer: Sender<CanvasMsg>, id: u32) -> WebGLBuffer { fn new_inherited(renderer: IpcSender<CanvasMsg>, id: u32) -> WebGLBuffer {
WebGLBuffer { WebGLBuffer {
webgl_object: WebGLObject::new_inherited(), webgl_object: WebGLObject::new_inherited(),
id: id, id: id,
@ -31,15 +31,16 @@ impl WebGLBuffer {
} }
} }
pub fn maybe_new(global: GlobalRef, renderer: Sender<CanvasMsg>) -> Option<Root<WebGLBuffer>> { pub fn maybe_new(global: GlobalRef, renderer: IpcSender<CanvasMsg>)
let (sender, receiver) = channel(); -> Option<Root<WebGLBuffer>> {
let (sender, receiver) = ipc::channel().unwrap();
renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::CreateBuffer(sender))).unwrap(); renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::CreateBuffer(sender))).unwrap();
let result = receiver.recv().unwrap(); let result = receiver.recv().unwrap();
result.map(|buffer_id| WebGLBuffer::new(global, renderer, *buffer_id)) result.map(|buffer_id| WebGLBuffer::new(global, renderer, *buffer_id))
} }
pub fn new(global: GlobalRef, renderer: Sender<CanvasMsg>, id: u32) -> Root<WebGLBuffer> { pub fn new(global: GlobalRef, renderer: IpcSender<CanvasMsg>, id: u32) -> Root<WebGLBuffer> {
reflect_dom_object(box WebGLBuffer::new_inherited(renderer, id), global, WebGLBufferBinding::Wrap) reflect_dom_object(box WebGLBuffer::new_inherited(renderer, id), global, WebGLBufferBinding::Wrap)
} }
} }

View file

@ -10,7 +10,7 @@ use dom::bindings::utils::reflect_dom_object;
use dom::webglobject::WebGLObject; use dom::webglobject::WebGLObject;
use canvas_traits::{CanvasMsg, CanvasWebGLMsg, WebGLFramebufferBindingRequest}; use canvas_traits::{CanvasMsg, CanvasWebGLMsg, WebGLFramebufferBindingRequest};
use std::sync::mpsc::{channel, Sender}; use ipc_channel::ipc::{self, IpcSender};
use std::cell::Cell; use std::cell::Cell;
#[dom_struct] #[dom_struct]
@ -18,11 +18,11 @@ pub struct WebGLFramebuffer {
webgl_object: WebGLObject, webgl_object: WebGLObject,
id: u32, id: u32,
is_deleted: Cell<bool>, is_deleted: Cell<bool>,
renderer: Sender<CanvasMsg>, renderer: IpcSender<CanvasMsg>,
} }
impl WebGLFramebuffer { impl WebGLFramebuffer {
fn new_inherited(renderer: Sender<CanvasMsg>, id: u32) -> WebGLFramebuffer { fn new_inherited(renderer: IpcSender<CanvasMsg>, id: u32) -> WebGLFramebuffer {
WebGLFramebuffer { WebGLFramebuffer {
webgl_object: WebGLObject::new_inherited(), webgl_object: WebGLObject::new_inherited(),
id: id, id: id,
@ -31,15 +31,17 @@ impl WebGLFramebuffer {
} }
} }
pub fn maybe_new(global: GlobalRef, renderer: Sender<CanvasMsg>) -> Option<Root<WebGLFramebuffer>> { pub fn maybe_new(global: GlobalRef, renderer: IpcSender<CanvasMsg>)
let (sender, receiver) = channel(); -> Option<Root<WebGLFramebuffer>> {
let (sender, receiver) = ipc::channel().unwrap();
renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::CreateFramebuffer(sender))).unwrap(); renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::CreateFramebuffer(sender))).unwrap();
let result = receiver.recv().unwrap(); let result = receiver.recv().unwrap();
result.map(|fb_id| WebGLFramebuffer::new(global, renderer, *fb_id)) result.map(|fb_id| WebGLFramebuffer::new(global, renderer, *fb_id))
} }
pub fn new(global: GlobalRef, renderer: Sender<CanvasMsg>, id: u32) -> Root<WebGLFramebuffer> { pub fn new(global: GlobalRef, renderer: IpcSender<CanvasMsg>, id: u32)
-> Root<WebGLFramebuffer> {
reflect_dom_object(box WebGLFramebuffer::new_inherited(renderer, id), global, WebGLFramebufferBinding::Wrap) reflect_dom_object(box WebGLFramebuffer::new_inherited(renderer, id), global, WebGLFramebufferBinding::Wrap)
} }
} }

View file

@ -14,7 +14,7 @@ use dom::webglrenderingcontext::MAX_UNIFORM_AND_ATTRIBUTE_LEN;
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
use canvas_traits::{CanvasMsg, CanvasWebGLMsg, WebGLResult, WebGLError}; use canvas_traits::{CanvasMsg, CanvasWebGLMsg, WebGLResult, WebGLError};
use std::sync::mpsc::{channel, Sender}; use ipc_channel::ipc::{self, IpcSender};
use std::cell::Cell; use std::cell::Cell;
#[dom_struct] #[dom_struct]
@ -24,11 +24,11 @@ pub struct WebGLProgram {
is_deleted: Cell<bool>, is_deleted: Cell<bool>,
fragment_shader: MutNullableHeap<JS<WebGLShader>>, fragment_shader: MutNullableHeap<JS<WebGLShader>>,
vertex_shader: MutNullableHeap<JS<WebGLShader>>, vertex_shader: MutNullableHeap<JS<WebGLShader>>,
renderer: Sender<CanvasMsg>, renderer: IpcSender<CanvasMsg>,
} }
impl WebGLProgram { impl WebGLProgram {
fn new_inherited(renderer: Sender<CanvasMsg>, id: u32) -> WebGLProgram { fn new_inherited(renderer: IpcSender<CanvasMsg>, id: u32) -> WebGLProgram {
WebGLProgram { WebGLProgram {
webgl_object: WebGLObject::new_inherited(), webgl_object: WebGLObject::new_inherited(),
id: id, id: id,
@ -39,15 +39,16 @@ impl WebGLProgram {
} }
} }
pub fn maybe_new(global: GlobalRef, renderer: Sender<CanvasMsg>) -> Option<Root<WebGLProgram>> { pub fn maybe_new(global: GlobalRef, renderer: IpcSender<CanvasMsg>)
let (sender, receiver) = channel(); -> Option<Root<WebGLProgram>> {
let (sender, receiver) = ipc::channel().unwrap();
renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::CreateProgram(sender))).unwrap(); renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::CreateProgram(sender))).unwrap();
let result = receiver.recv().unwrap(); let result = receiver.recv().unwrap();
result.map(|program_id| WebGLProgram::new(global, renderer, *program_id)) result.map(|program_id| WebGLProgram::new(global, renderer, *program_id))
} }
pub fn new(global: GlobalRef, renderer: Sender<CanvasMsg>, id: u32) -> Root<WebGLProgram> { pub fn new(global: GlobalRef, renderer: IpcSender<CanvasMsg>, id: u32) -> Root<WebGLProgram> {
reflect_dom_object(box WebGLProgram::new_inherited(renderer, id), global, WebGLProgramBinding::Wrap) reflect_dom_object(box WebGLProgram::new_inherited(renderer, id), global, WebGLProgramBinding::Wrap)
} }
} }
@ -112,7 +113,7 @@ impl<'a> WebGLProgramHelpers for &'a WebGLProgram {
return Ok(None); return Ok(None);
} }
let (sender, receiver) = channel(); let (sender, receiver) = ipc::channel().unwrap();
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::GetAttribLocation(self.id, name, sender))).unwrap(); self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::GetAttribLocation(self.id, name, sender))).unwrap();
Ok(receiver.recv().unwrap()) Ok(receiver.recv().unwrap())
} }
@ -128,7 +129,7 @@ impl<'a> WebGLProgramHelpers for &'a WebGLProgram {
return Ok(None); return Ok(None);
} }
let (sender, receiver) = channel(); let (sender, receiver) = ipc::channel().unwrap();
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::GetUniformLocation(self.id, name, sender))).unwrap(); self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::GetUniformLocation(self.id, name, sender))).unwrap();
Ok(receiver.recv().unwrap()) Ok(receiver.recv().unwrap())
} }

View file

@ -10,7 +10,7 @@ use dom::bindings::utils::reflect_dom_object;
use dom::webglobject::WebGLObject; use dom::webglobject::WebGLObject;
use canvas_traits::{CanvasMsg, CanvasWebGLMsg}; use canvas_traits::{CanvasMsg, CanvasWebGLMsg};
use std::sync::mpsc::{channel, Sender}; use ipc_channel::ipc::{self, IpcSender};
use std::cell::Cell; use std::cell::Cell;
#[dom_struct] #[dom_struct]
@ -18,11 +18,11 @@ pub struct WebGLRenderbuffer {
webgl_object: WebGLObject, webgl_object: WebGLObject,
id: u32, id: u32,
is_deleted: Cell<bool>, is_deleted: Cell<bool>,
renderer: Sender<CanvasMsg>, renderer: IpcSender<CanvasMsg>,
} }
impl WebGLRenderbuffer { impl WebGLRenderbuffer {
fn new_inherited(renderer: Sender<CanvasMsg>, id: u32) -> WebGLRenderbuffer { fn new_inherited(renderer: IpcSender<CanvasMsg>, id: u32) -> WebGLRenderbuffer {
WebGLRenderbuffer { WebGLRenderbuffer {
webgl_object: WebGLObject::new_inherited(), webgl_object: WebGLObject::new_inherited(),
id: id, id: id,
@ -31,15 +31,17 @@ impl WebGLRenderbuffer {
} }
} }
pub fn maybe_new(global: GlobalRef, renderer: Sender<CanvasMsg>) -> Option<Root<WebGLRenderbuffer>> { pub fn maybe_new(global: GlobalRef, renderer: IpcSender<CanvasMsg>)
let (sender, receiver) = channel(); -> Option<Root<WebGLRenderbuffer>> {
let (sender, receiver) = ipc::channel().unwrap();
renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::CreateRenderbuffer(sender))).unwrap(); renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::CreateRenderbuffer(sender))).unwrap();
let result = receiver.recv().unwrap(); let result = receiver.recv().unwrap();
result.map(|renderbuffer_id| WebGLRenderbuffer::new(global, renderer, *renderbuffer_id)) result.map(|renderbuffer_id| WebGLRenderbuffer::new(global, renderer, *renderbuffer_id))
} }
pub fn new(global: GlobalRef, renderer: Sender<CanvasMsg>, id: u32) -> Root<WebGLRenderbuffer> { pub fn new(global: GlobalRef, renderer: IpcSender<CanvasMsg>, id: u32)
-> Root<WebGLRenderbuffer> {
reflect_dom_object(box WebGLRenderbuffer::new_inherited(renderer, id), global, WebGLRenderbufferBinding::Wrap) reflect_dom_object(box WebGLRenderbuffer::new_inherited(renderer, id), global, WebGLRenderbufferBinding::Wrap)
} }
} }

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use canvas::webgl_paint_task::WebGLPaintTask;
use canvas_traits:: use canvas_traits::
{CanvasMsg, CanvasWebGLMsg, CanvasCommonMsg, WebGLError, {CanvasMsg, CanvasWebGLMsg, CanvasCommonMsg, WebGLError,
WebGLShaderParameter, WebGLFramebufferBindingRequest}; WebGLShaderParameter, WebGLFramebufferBindingRequest};
@ -23,14 +22,16 @@ use dom::webglshader::{WebGLShader, WebGLShaderHelpers};
use dom::webglprogram::{WebGLProgram, WebGLProgramHelpers}; use dom::webglprogram::{WebGLProgram, WebGLProgramHelpers};
use dom::webgluniformlocation::{WebGLUniformLocation, WebGLUniformLocationHelpers}; use dom::webgluniformlocation::{WebGLUniformLocation, WebGLUniformLocationHelpers};
use euclid::size::Size2D; use euclid::size::Size2D;
use ipc_channel::ipc::{self, IpcSender};
use js::jsapi::{JSContext, JSObject, RootedValue}; use js::jsapi::{JSContext, JSObject, RootedValue};
use js::jsapi::{JS_GetFloat32ArrayData, JS_GetObjectAsArrayBufferView}; use js::jsapi::{JS_GetFloat32ArrayData, JS_GetObjectAsArrayBufferView};
use js::jsval::{JSVal, UndefinedValue, NullValue, Int32Value, BooleanValue}; use js::jsval::{JSVal, UndefinedValue, NullValue, Int32Value, BooleanValue};
use msg::constellation_msg::Msg as ConstellationMsg;
use std::cell::Cell; use std::cell::Cell;
use std::mem; use std::mem;
use std::ptr; use std::ptr;
use std::slice; use std::slice;
use std::sync::mpsc::{channel, Sender}; use std::sync::mpsc::channel;
use util::str::DOMString; use util::str::DOMString;
use offscreen_gl_context::GLContextAttributes; use offscreen_gl_context::GLContextAttributes;
@ -52,7 +53,8 @@ macro_rules! handle_potential_webgl_error {
pub struct WebGLRenderingContext { pub struct WebGLRenderingContext {
reflector_: Reflector, reflector_: Reflector,
global: GlobalField, global: GlobalField,
renderer: Sender<CanvasMsg>, renderer_id: usize,
ipc_renderer: IpcSender<CanvasMsg>,
canvas: JS<HTMLCanvasElement>, canvas: JS<HTMLCanvasElement>,
last_error: Cell<Option<WebGLError>>, last_error: Cell<Option<WebGLError>>,
} }
@ -63,12 +65,17 @@ impl WebGLRenderingContext {
size: Size2D<i32>, size: Size2D<i32>,
attrs: GLContextAttributes) attrs: GLContextAttributes)
-> Result<WebGLRenderingContext, &'static str> { -> Result<WebGLRenderingContext, &'static str> {
let chan = try!(WebGLPaintTask::start(size, attrs)); let (sender, receiver) = ipc::channel().unwrap();
let constellation_chan = global.constellation_chan();
constellation_chan.0
.send(ConstellationMsg::CreateWebGLPaintTask(size, attrs, sender))
.unwrap();
let (ipc_renderer, renderer_id) = receiver.recv().unwrap();
Ok(WebGLRenderingContext { Ok(WebGLRenderingContext {
reflector_: Reflector::new(), reflector_: Reflector::new(),
global: GlobalField::from_rooted(&global), global: GlobalField::from_rooted(&global),
renderer: chan, renderer_id: renderer_id,
ipc_renderer: ipc_renderer,
last_error: Cell::new(None), last_error: Cell::new(None),
canvas: JS::from_ref(canvas), canvas: JS::from_ref(canvas),
}) })
@ -87,13 +94,13 @@ impl WebGLRenderingContext {
} }
pub fn recreate(&self, size: Size2D<i32>) { pub fn recreate(&self, size: Size2D<i32>) {
self.renderer.send(CanvasMsg::Common(CanvasCommonMsg::Recreate(size))).unwrap(); self.ipc_renderer.send(CanvasMsg::Common(CanvasCommonMsg::Recreate(size))).unwrap();
} }
} }
impl Drop for WebGLRenderingContext { impl Drop for WebGLRenderingContext {
fn drop(&mut self) { fn drop(&mut self) {
self.renderer.send(CanvasMsg::Common(CanvasCommonMsg::Close)).unwrap(); self.ipc_renderer.send(CanvasMsg::Common(CanvasCommonMsg::Close)).unwrap();
} }
} }
@ -105,15 +112,19 @@ impl<'a> WebGLRenderingContextMethods for &'a WebGLRenderingContext {
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.1 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.1
fn DrawingBufferWidth(self) -> i32 { fn DrawingBufferWidth(self) -> i32 {
let (sender, receiver) = channel(); let (sender, receiver) = ipc::channel().unwrap();
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::DrawingBufferWidth(sender))).unwrap(); self.ipc_renderer
.send(CanvasMsg::WebGL(CanvasWebGLMsg::DrawingBufferWidth(sender)))
.unwrap();
receiver.recv().unwrap() receiver.recv().unwrap()
} }
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.1 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.1
fn DrawingBufferHeight(self) -> i32 { fn DrawingBufferHeight(self) -> i32 {
let (sender, receiver) = channel(); let (sender, receiver) = ipc::channel().unwrap();
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::DrawingBufferHeight(sender))).unwrap(); self.ipc_renderer
.send(CanvasMsg::WebGL(CanvasWebGLMsg::DrawingBufferHeight(sender)))
.unwrap();
receiver.recv().unwrap() receiver.recv().unwrap()
} }
@ -151,10 +162,11 @@ impl<'a> WebGLRenderingContextMethods for &'a WebGLRenderingContext {
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.2 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.2
fn GetContextAttributes(self) -> Option<WebGLContextAttributes> { fn GetContextAttributes(self) -> Option<WebGLContextAttributes> {
let (sender, receiver) = channel(); let (sender, receiver) = ipc::channel().unwrap();
// If the send does not succeed, assume context lost // If the send does not succeed, assume context lost
if let Err(_) = self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::GetContextAttributes(sender))) { if let Err(_) = self.ipc_renderer
.send(CanvasMsg::WebGL(CanvasWebGLMsg::GetContextAttributes(sender))) {
return None; return None;
} }
let attrs = receiver.recv().unwrap(); let attrs = receiver.recv().unwrap();
@ -180,32 +192,36 @@ impl<'a> WebGLRenderingContextMethods for &'a WebGLRenderingContext {
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3
fn ActiveTexture(self, texture: u32) { fn ActiveTexture(self, texture: u32) {
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::ActiveTexture(texture))).unwrap(); self.ipc_renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::ActiveTexture(texture))).unwrap();
} }
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3
fn BlendColor(self, r: f32, g: f32, b: f32, a: f32) { fn BlendColor(self, r: f32, g: f32, b: f32, a: f32) {
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::BlendColor(r, g, b, a))).unwrap(); self.ipc_renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::BlendColor(r, g, b, a))).unwrap();
} }
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3
fn BlendEquation(self, mode: u32) { fn BlendEquation(self, mode: u32) {
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::BlendEquation(mode))).unwrap(); self.ipc_renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::BlendEquation(mode))).unwrap();
} }
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3
fn BlendEquationSeparate(self, mode_rgb: u32, mode_alpha: u32) { fn BlendEquationSeparate(self, mode_rgb: u32, mode_alpha: u32) {
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::BlendEquationSeparate(mode_rgb, mode_alpha))).unwrap(); self.ipc_renderer
.send(CanvasMsg::WebGL(CanvasWebGLMsg::BlendEquationSeparate(mode_rgb, mode_alpha)))
.unwrap();
} }
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3
fn BlendFunc(self, src_factor: u32, dest_factor: u32) { fn BlendFunc(self, src_factor: u32, dest_factor: u32) {
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::BlendFunc(src_factor, dest_factor))).unwrap(); self.ipc_renderer
.send(CanvasMsg::WebGL(CanvasWebGLMsg::BlendFunc(src_factor, dest_factor)))
.unwrap();
} }
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3
fn BlendFuncSeparate(self, src_rgb: u32, dest_rgb: u32, src_alpha: u32, dest_alpha: u32) { fn BlendFuncSeparate(self, src_rgb: u32, dest_rgb: u32, src_alpha: u32, dest_alpha: u32) {
self.renderer.send( self.ipc_renderer.send(
CanvasMsg::WebGL(CanvasWebGLMsg::BlendFuncSeparate(src_rgb, dest_rgb, src_alpha, dest_alpha))).unwrap(); CanvasMsg::WebGL(CanvasWebGLMsg::BlendFuncSeparate(src_rgb, dest_rgb, src_alpha, dest_alpha))).unwrap();
} }
@ -224,7 +240,9 @@ impl<'a> WebGLRenderingContextMethods for &'a WebGLRenderingContext {
buffer.bind(target) buffer.bind(target)
} else { } else {
// Unbind the current buffer // Unbind the current buffer
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::BindBuffer(target, 0))).unwrap() self.ipc_renderer
.send(CanvasMsg::WebGL(CanvasWebGLMsg::BindBuffer(target, 0)))
.unwrap()
} }
} }
@ -235,7 +253,7 @@ impl<'a> WebGLRenderingContextMethods for &'a WebGLRenderingContext {
} else { } else {
// Bind the default framebuffer // Bind the default framebuffer
let cmd = CanvasWebGLMsg::BindFramebuffer(target, WebGLFramebufferBindingRequest::Default); let cmd = CanvasWebGLMsg::BindFramebuffer(target, WebGLFramebufferBindingRequest::Default);
self.renderer.send(CanvasMsg::WebGL(cmd)).unwrap(); self.ipc_renderer.send(CanvasMsg::WebGL(cmd)).unwrap();
} }
} }
@ -245,7 +263,9 @@ impl<'a> WebGLRenderingContextMethods for &'a WebGLRenderingContext {
renderbuffer.bind(target) renderbuffer.bind(target)
} else { } else {
// Unbind the currently bound renderbuffer // Unbind the currently bound renderbuffer
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::BindRenderbuffer(target, 0))).unwrap() self.ipc_renderer
.send(CanvasMsg::WebGL(CanvasWebGLMsg::BindRenderbuffer(target, 0)))
.unwrap()
} }
} }
@ -274,17 +294,21 @@ impl<'a> WebGLRenderingContextMethods for &'a WebGLRenderingContext {
let data_vec_length = length / mem::size_of::<f32>() as u32; let data_vec_length = length / mem::size_of::<f32>() as u32;
slice::from_raw_parts(data_f32, data_vec_length as usize).to_vec() slice::from_raw_parts(data_f32, data_vec_length as usize).to_vec()
}; };
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::BufferData(target, data_vec, usage))).unwrap() self.ipc_renderer
.send(CanvasMsg::WebGL(CanvasWebGLMsg::BufferData(target, data_vec, usage)))
.unwrap()
} }
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.11 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.11
fn Clear(self, mask: u32) { fn Clear(self, mask: u32) {
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::Clear(mask))).unwrap() self.ipc_renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::Clear(mask))).unwrap()
} }
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3
fn ClearColor(self, red: f32, green: f32, blue: f32, alpha: f32) { fn ClearColor(self, red: f32, green: f32, blue: f32, alpha: f32) {
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::ClearColor(red, green, blue, alpha))).unwrap() self.ipc_renderer
.send(CanvasMsg::WebGL(CanvasWebGLMsg::ClearColor(red, green, blue, alpha)))
.unwrap()
} }
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
@ -298,34 +322,34 @@ impl<'a> WebGLRenderingContextMethods for &'a WebGLRenderingContext {
// generated objects, either here or in the webgl task // generated objects, either here or in the webgl task
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5
fn CreateBuffer(self) -> Option<Root<WebGLBuffer>> { fn CreateBuffer(self) -> Option<Root<WebGLBuffer>> {
WebGLBuffer::maybe_new(self.global.root().r(), self.renderer.clone()) WebGLBuffer::maybe_new(self.global.root().r(), self.ipc_renderer.clone())
} }
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.6 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.6
fn CreateFramebuffer(self) -> Option<Root<WebGLFramebuffer>> { fn CreateFramebuffer(self) -> Option<Root<WebGLFramebuffer>> {
WebGLFramebuffer::maybe_new(self.global.root().r(), self.renderer.clone()) WebGLFramebuffer::maybe_new(self.global.root().r(), self.ipc_renderer.clone())
} }
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.7 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.7
fn CreateRenderbuffer(self) -> Option<Root<WebGLRenderbuffer>> { fn CreateRenderbuffer(self) -> Option<Root<WebGLRenderbuffer>> {
WebGLRenderbuffer::maybe_new(self.global.root().r(), self.renderer.clone()) WebGLRenderbuffer::maybe_new(self.global.root().r(), self.ipc_renderer.clone())
} }
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
fn CreateTexture(self) -> Option<Root<WebGLTexture>> { fn CreateTexture(self) -> Option<Root<WebGLTexture>> {
WebGLTexture::maybe_new(self.global.root().r(), self.renderer.clone()) WebGLTexture::maybe_new(self.global.root().r(), self.ipc_renderer.clone())
} }
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
fn CreateProgram(self) -> Option<Root<WebGLProgram>> { fn CreateProgram(self) -> Option<Root<WebGLProgram>> {
WebGLProgram::maybe_new(self.global.root().r(), self.renderer.clone()) WebGLProgram::maybe_new(self.global.root().r(), self.ipc_renderer.clone())
} }
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
// TODO(ecoal95): Check if constants are cross-platform or if we must make a translation // TODO(ecoal95): Check if constants are cross-platform or if we must make a translation
// between WebGL constants and native ones. // between WebGL constants and native ones.
fn CreateShader(self, shader_type: u32) -> Option<Root<WebGLShader>> { fn CreateShader(self, shader_type: u32) -> Option<Root<WebGLShader>> {
WebGLShader::maybe_new(self.global.root().r(), self.renderer.clone(), shader_type) WebGLShader::maybe_new(self.global.root().r(), self.ipc_renderer.clone(), shader_type)
} }
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5
@ -372,12 +396,16 @@ impl<'a> WebGLRenderingContextMethods for &'a WebGLRenderingContext {
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.11 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.11
fn DrawArrays(self, mode: u32, first: i32, count: i32) { fn DrawArrays(self, mode: u32, first: i32, count: i32) {
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::DrawArrays(mode, first, count))).unwrap() self.ipc_renderer
.send(CanvasMsg::WebGL(CanvasWebGLMsg::DrawArrays(mode, first, count)))
.unwrap()
} }
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
fn EnableVertexAttribArray(self, attrib_id: u32) { fn EnableVertexAttribArray(self, attrib_id: u32) {
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::EnableVertexAttribArray(attrib_id))).unwrap() self.ipc_renderer
.send(CanvasMsg::WebGL(CanvasWebGLMsg::EnableVertexAttribArray(attrib_id)))
.unwrap()
} }
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
@ -466,7 +494,9 @@ impl<'a> WebGLRenderingContextMethods for &'a WebGLRenderingContext {
let data_f32 = JS_GetFloat32ArrayData(data, ptr::null()); let data_f32 = JS_GetFloat32ArrayData(data, ptr::null());
slice::from_raw_parts(data_f32, 4).to_vec() slice::from_raw_parts(data_f32, 4).to_vec()
}; };
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::Uniform4fv(uniform_id, data_vec))).unwrap() self.ipc_renderer
.send(CanvasMsg::WebGL(CanvasWebGLMsg::Uniform4fv(uniform_id, data_vec)))
.unwrap()
} }
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
@ -483,7 +513,7 @@ impl<'a> WebGLRenderingContextMethods for &'a WebGLRenderingContext {
constants::FLOAT => { constants::FLOAT => {
let msg = CanvasMsg::WebGL( let msg = CanvasMsg::WebGL(
CanvasWebGLMsg::VertexAttribPointer2f(attrib_id, size, normalized, stride, offset)); CanvasWebGLMsg::VertexAttribPointer2f(attrib_id, size, normalized, stride, offset));
self.renderer.send(msg).unwrap() self.ipc_renderer.send(msg).unwrap()
} }
_ => panic!("VertexAttribPointer: Data Type not supported") _ => panic!("VertexAttribPointer: Data Type not supported")
} }
@ -492,7 +522,9 @@ impl<'a> WebGLRenderingContextMethods for &'a WebGLRenderingContext {
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.4 // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.4
fn Viewport(self, x: i32, y: i32, width: i32, height: i32) { fn Viewport(self, x: i32, y: i32, width: i32, height: i32) {
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::Viewport(x, y, width, height))).unwrap() self.ipc_renderer
.send(CanvasMsg::WebGL(CanvasWebGLMsg::Viewport(x, y, width, height)))
.unwrap()
} }
} }
@ -512,12 +544,18 @@ impl<'a> WebGLRenderingContextHelpers for &'a WebGLRenderingContext {
pub trait LayoutCanvasWebGLRenderingContextHelpers { pub trait LayoutCanvasWebGLRenderingContextHelpers {
#[allow(unsafe_code)] #[allow(unsafe_code)]
unsafe fn get_renderer(&self) -> Sender<CanvasMsg>; unsafe fn get_renderer_id(&self) -> usize;
#[allow(unsafe_code)]
unsafe fn get_ipc_renderer(&self) -> IpcSender<CanvasMsg>;
} }
impl LayoutCanvasWebGLRenderingContextHelpers for LayoutJS<WebGLRenderingContext> { impl LayoutCanvasWebGLRenderingContextHelpers for LayoutJS<WebGLRenderingContext> {
#[allow(unsafe_code)] #[allow(unsafe_code)]
unsafe fn get_renderer(&self) -> Sender<CanvasMsg> { unsafe fn get_renderer_id(&self) -> usize {
(*self.unsafe_get()).renderer.clone() (*self.unsafe_get()).renderer_id
}
#[allow(unsafe_code)]
unsafe fn get_ipc_renderer(&self) -> IpcSender<CanvasMsg> {
(*self.unsafe_get()).ipc_renderer.clone()
} }
} }

View file

@ -12,7 +12,7 @@ use dom::webglobject::WebGLObject;
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
use canvas_traits::{CanvasMsg, CanvasWebGLMsg, WebGLResult, WebGLError, WebGLShaderParameter}; use canvas_traits::{CanvasMsg, CanvasWebGLMsg, WebGLResult, WebGLError, WebGLShaderParameter};
use std::sync::mpsc::{channel, Sender}; use ipc_channel::ipc::{self, IpcSender};
use std::cell::Cell; use std::cell::Cell;
use std::cell::RefCell; use std::cell::RefCell;
@ -24,11 +24,11 @@ pub struct WebGLShader {
source: RefCell<Option<String>>, source: RefCell<Option<String>>,
is_deleted: Cell<bool>, is_deleted: Cell<bool>,
// TODO(ecoal95): Evaluate moving this to `WebGLObject` // TODO(ecoal95): Evaluate moving this to `WebGLObject`
renderer: Sender<CanvasMsg>, renderer: IpcSender<CanvasMsg>,
} }
impl WebGLShader { impl WebGLShader {
fn new_inherited(renderer: Sender<CanvasMsg>, id: u32, shader_type: u32) -> WebGLShader { fn new_inherited(renderer: IpcSender<CanvasMsg>, id: u32, shader_type: u32) -> WebGLShader {
WebGLShader { WebGLShader {
webgl_object: WebGLObject::new_inherited(), webgl_object: WebGLObject::new_inherited(),
id: id, id: id,
@ -40,9 +40,9 @@ impl WebGLShader {
} }
pub fn maybe_new(global: GlobalRef, pub fn maybe_new(global: GlobalRef,
renderer: Sender<CanvasMsg>, renderer: IpcSender<CanvasMsg>,
shader_type: u32) -> Option<Root<WebGLShader>> { shader_type: u32) -> Option<Root<WebGLShader>> {
let (sender, receiver) = channel(); let (sender, receiver) = ipc::channel().unwrap();
renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::CreateShader(shader_type, sender))).unwrap(); renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::CreateShader(shader_type, sender))).unwrap();
let result = receiver.recv().unwrap(); let result = receiver.recv().unwrap();
@ -50,7 +50,7 @@ impl WebGLShader {
} }
pub fn new(global: GlobalRef, pub fn new(global: GlobalRef,
renderer: Sender<CanvasMsg>, renderer: IpcSender<CanvasMsg>,
id: u32, id: u32,
shader_type: u32) -> Root<WebGLShader> { shader_type: u32) -> Root<WebGLShader> {
reflect_dom_object( reflect_dom_object(
@ -95,7 +95,7 @@ impl<'a> WebGLShaderHelpers for &'a WebGLShader {
/// glGetShaderInfoLog /// glGetShaderInfoLog
fn info_log(self) -> Option<String> { fn info_log(self) -> Option<String> {
let (sender, receiver) = channel(); let (sender, receiver) = ipc::channel().unwrap();
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::GetShaderInfoLog(self.id, sender))).unwrap(); self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::GetShaderInfoLog(self.id, sender))).unwrap();
receiver.recv().unwrap() receiver.recv().unwrap()
} }
@ -107,7 +107,7 @@ impl<'a> WebGLShaderHelpers for &'a WebGLShader {
_ => return Err(WebGLError::InvalidEnum), _ => return Err(WebGLError::InvalidEnum),
} }
let (sender, receiver) = channel(); let (sender, receiver) = ipc::channel().unwrap();
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::GetShaderParameter(self.id, param_id, sender))).unwrap(); self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::GetShaderParameter(self.id, param_id, sender))).unwrap();
Ok(receiver.recv().unwrap()) Ok(receiver.recv().unwrap())
} }

View file

@ -10,7 +10,7 @@ use dom::bindings::utils::reflect_dom_object;
use dom::webglobject::WebGLObject; use dom::webglobject::WebGLObject;
use canvas_traits::{CanvasMsg, CanvasWebGLMsg}; use canvas_traits::{CanvasMsg, CanvasWebGLMsg};
use std::sync::mpsc::{channel, Sender}; use ipc_channel::ipc::{self, IpcSender};
use std::cell::Cell; use std::cell::Cell;
#[dom_struct] #[dom_struct]
@ -18,11 +18,11 @@ pub struct WebGLTexture {
webgl_object: WebGLObject, webgl_object: WebGLObject,
id: u32, id: u32,
is_deleted: Cell<bool>, is_deleted: Cell<bool>,
renderer: Sender<CanvasMsg>, renderer: IpcSender<CanvasMsg>,
} }
impl WebGLTexture { impl WebGLTexture {
fn new_inherited(renderer: Sender<CanvasMsg>, id: u32) -> WebGLTexture { fn new_inherited(renderer: IpcSender<CanvasMsg>, id: u32) -> WebGLTexture {
WebGLTexture { WebGLTexture {
webgl_object: WebGLObject::new_inherited(), webgl_object: WebGLObject::new_inherited(),
id: id, id: id,
@ -31,15 +31,16 @@ impl WebGLTexture {
} }
} }
pub fn maybe_new(global: GlobalRef, renderer: Sender<CanvasMsg>) -> Option<Root<WebGLTexture>> { pub fn maybe_new(global: GlobalRef, renderer: IpcSender<CanvasMsg>)
let (sender, receiver) = channel(); -> Option<Root<WebGLTexture>> {
let (sender, receiver) = ipc::channel().unwrap();
renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::CreateTexture(sender))).unwrap(); renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::CreateTexture(sender))).unwrap();
let result = receiver.recv().unwrap(); let result = receiver.recv().unwrap();
result.map(|texture_id| WebGLTexture::new(global, renderer, *texture_id)) result.map(|texture_id| WebGLTexture::new(global, renderer, *texture_id))
} }
pub fn new(global: GlobalRef, renderer: Sender<CanvasMsg>, id: u32) -> Root<WebGLTexture> { pub fn new(global: GlobalRef, renderer: IpcSender<CanvasMsg>, id: u32) -> Root<WebGLTexture> {
reflect_dom_object(box WebGLTexture::new_inherited(renderer, id), global, WebGLTextureBinding::Wrap) reflect_dom_object(box WebGLTexture::new_inherited(renderer, id), global, WebGLTextureBinding::Wrap)
} }
} }

View file

@ -70,6 +70,7 @@ impl Worker {
}; };
let resource_task = global.resource_task(); let resource_task = global.resource_task();
let constellation_chan = global.constellation_chan();
let (sender, receiver) = channel(); let (sender, receiver) = channel();
let worker = Worker::new(global, sender.clone()); let worker = Worker::new(global, sender.clone());
@ -91,7 +92,7 @@ impl Worker {
DedicatedWorkerGlobalScope::run_worker_scope( DedicatedWorkerGlobalScope::run_worker_scope(
worker_url, global.pipeline(), global.mem_profiler_chan(), global.devtools_chan(), worker_url, global.pipeline(), global.mem_profiler_chan(), global.devtools_chan(),
worker_ref, resource_task, global.script_chan(), sender, receiver); worker_ref, resource_task, constellation_chan, global.script_chan(), sender, receiver);
Ok(worker) Ok(worker)
} }

View file

@ -22,7 +22,7 @@ use timers::{IsInterval, TimerId, TimerManager, TimerCallback};
use devtools_traits::DevtoolsControlChan; use devtools_traits::DevtoolsControlChan;
use msg::constellation_msg::{PipelineId, WorkerId}; use msg::constellation_msg::{ConstellationChan, PipelineId, WorkerId};
use profile_traits::mem; use profile_traits::mem;
use net_traits::{load_whole_resource, ResourceTask}; use net_traits::{load_whole_resource, ResourceTask};
use util::str::DOMString; use util::str::DOMString;
@ -55,6 +55,7 @@ pub struct WorkerGlobalScope {
timers: TimerManager, timers: TimerManager,
mem_profiler_chan: mem::ProfilerChan, mem_profiler_chan: mem::ProfilerChan,
devtools_chan: Option<DevtoolsControlChan>, devtools_chan: Option<DevtoolsControlChan>,
constellation_chan: ConstellationChan,
} }
impl WorkerGlobalScope { impl WorkerGlobalScope {
@ -63,7 +64,8 @@ impl WorkerGlobalScope {
runtime: Rc<Runtime>, runtime: Rc<Runtime>,
resource_task: ResourceTask, resource_task: ResourceTask,
mem_profiler_chan: mem::ProfilerChan, mem_profiler_chan: mem::ProfilerChan,
devtools_chan: Option<DevtoolsControlChan>) -> WorkerGlobalScope { devtools_chan: Option<DevtoolsControlChan>,
constellation_chan: ConstellationChan) -> WorkerGlobalScope {
WorkerGlobalScope { WorkerGlobalScope {
eventtarget: EventTarget::new_inherited(EventTargetTypeId::WorkerGlobalScope(type_id)), eventtarget: EventTarget::new_inherited(EventTargetTypeId::WorkerGlobalScope(type_id)),
next_worker_id: Cell::new(WorkerId(0)), next_worker_id: Cell::new(WorkerId(0)),
@ -77,6 +79,7 @@ impl WorkerGlobalScope {
timers: TimerManager::new(), timers: TimerManager::new(),
mem_profiler_chan: mem_profiler_chan, mem_profiler_chan: mem_profiler_chan,
devtools_chan: devtools_chan, devtools_chan: devtools_chan,
constellation_chan: constellation_chan,
} }
} }
@ -88,6 +91,10 @@ impl WorkerGlobalScope {
self.devtools_chan.clone() self.devtools_chan.clone()
} }
pub fn constellation_chan(&self) -> ConstellationChan {
self.constellation_chan.clone()
}
#[inline] #[inline]
pub fn eventtarget<'a>(&'a self) -> &'a EventTarget { pub fn eventtarget<'a>(&'a self) -> &'a EventTarget {
&self.eventtarget &self.eventtarget

View file

@ -61,7 +61,7 @@ dependencies = [
"core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-text 0.1.0 (git+https://github.com/servo/core-text-rs)", "core-text 0.1.0 (git+https://github.com/servo/core-text-rs)",
"egl 0.1.0 (git+https://github.com/servo/rust-egl)", "egl 0.1.0 (git+https://github.com/servo/rust-egl)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"freetype 0.1.0 (git+https://github.com/servo/rust-freetype)", "freetype 0.1.0 (git+https://github.com/servo/rust-freetype)",
"freetype-sys 2.4.11 (git+https://github.com/servo/libfreetype2)", "freetype-sys 2.4.11 (git+https://github.com/servo/libfreetype2)",
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -92,8 +92,8 @@ version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"canvas_traits 0.0.1", "canvas_traits 0.0.1",
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx_traits 0.0.1", "gfx_traits 0.0.1",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
@ -109,12 +109,14 @@ name = "canvas_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx_traits 0.0.1", "gfx_traits 0.0.1",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)", "offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"serde 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -158,11 +160,13 @@ name = "compositing"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"canvas 0.0.1",
"canvas_traits 0.0.1",
"clipboard 0.0.1 (git+https://github.com/aweinstock314/rust-clipboard)", "clipboard 0.0.1 (git+https://github.com/aweinstock314/rust-clipboard)",
"core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-text 0.1.0 (git+https://github.com/servo/core-text-rs)", "core-text 0.1.0 (git+https://github.com/servo/core-text-rs)",
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx 0.0.1", "gfx 0.0.1",
"gfx_traits 0.0.1", "gfx_traits 0.0.1",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -175,6 +179,7 @@ dependencies = [
"net 0.0.1", "net 0.0.1",
"net_traits 0.0.1", "net_traits 0.0.1",
"num 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"profile_traits 0.0.1", "profile_traits 0.0.1",
"script_traits 0.0.1", "script_traits 0.0.1",
@ -224,11 +229,13 @@ dependencies = [
[[package]] [[package]]
name = "cssparser" name = "cssparser"
version = "0.3.2" version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -339,7 +346,7 @@ dependencies = [
[[package]] [[package]]
name = "euclid" name = "euclid"
version = "0.1.2" version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -431,7 +438,7 @@ dependencies = [
"core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-text 0.1.0 (git+https://github.com/servo/core-text-rs)", "core-text 0.1.0 (git+https://github.com/servo/core-text-rs)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"fontconfig 0.1.0 (git+https://github.com/servo/rust-fontconfig)", "fontconfig 0.1.0 (git+https://github.com/servo/rust-fontconfig)",
"freetype 0.1.0 (git+https://github.com/servo/rust-freetype)", "freetype 0.1.0 (git+https://github.com/servo/rust-freetype)",
@ -533,7 +540,7 @@ dependencies = [
"cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"compositing 0.0.1", "compositing 0.0.1",
"egl 0.1.0 (git+https://github.com/servo/rust-egl)", "egl 0.1.0 (git+https://github.com/servo/rust-egl)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin 0.0.26 (git+https://github.com/servo/glutin?branch=servo)", "glutin 0.0.26 (git+https://github.com/servo/glutin?branch=servo)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)",
@ -633,7 +640,7 @@ source = "git+https://github.com/servo/io-surface-rs#f772aa79f487d1722ec6ad3d3c3
dependencies = [ dependencies = [
"cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -690,7 +697,7 @@ dependencies = [
"cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"egl 0.1.0 (git+https://github.com/servo/rust-egl)", "egl 0.1.0 (git+https://github.com/servo/rust-egl)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"glx 0.0.1 (git+https://github.com/servo/rust-glx)", "glx 0.0.1 (git+https://github.com/servo/rust-glx)",
"io-surface 0.1.0 (git+https://github.com/servo/io-surface-rs)", "io-surface 0.1.0 (git+https://github.com/servo/io-surface-rs)",
@ -710,9 +717,9 @@ dependencies = [
"canvas 0.0.1", "canvas 0.0.1",
"canvas_traits 0.0.1", "canvas_traits 0.0.1",
"clock_ticks 0.0.6 (git+https://github.com/tomaka/clock_ticks)", "clock_ticks 0.0.6 (git+https://github.com/tomaka/clock_ticks)",
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx 0.0.1", "gfx 0.0.1",
"gfx_traits 0.0.1", "gfx_traits 0.0.1",
@ -743,7 +750,7 @@ dependencies = [
name = "layout_traits" name = "layout_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx 0.0.1", "gfx 0.0.1",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"msg 0.0.1", "msg 0.0.1",
@ -836,12 +843,14 @@ version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas_traits 0.0.1",
"core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"io-surface 0.1.0 (git+https://github.com/servo/io-surface-rs)", "io-surface 0.1.0 (git+https://github.com/servo/io-surface-rs)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"rustc-serialize 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -857,7 +866,7 @@ version = "0.0.1"
dependencies = [ dependencies = [
"cookie 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "cookie 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"flate2 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -890,7 +899,7 @@ dependencies = [
name = "net_traits" name = "net_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -936,7 +945,7 @@ source = "git+https://github.com/ecoal95/rust-offscreen-rendering-context#724d47
dependencies = [ dependencies = [
"cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gl_generator 0.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "gl_generator 0.0.26 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1142,10 +1151,10 @@ dependencies = [
"bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1", "canvas 0.0.1",
"canvas_traits 0.0.1", "canvas_traits 0.0.1",
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1191,7 +1200,7 @@ name = "script_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1", "msg 0.0.1",
@ -1209,7 +1218,7 @@ version = "0.1.0"
source = "git+https://github.com/servo/rust-selectors#625734e1e8d70c012672b248adca302d0276fe08" source = "git+https://github.com/servo/rust-selectors#625734e1e8d70c012672b248adca302d0276fe08"
dependencies = [ dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"quicksort 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "quicksort 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1260,7 +1269,7 @@ source = "git+https://github.com/servo/skia#62a452b39294d94e60f279eacbb71a0b3296
dependencies = [ dependencies = [
"cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"egl 0.1.0 (git+https://github.com/servo/rust-egl)", "egl 0.1.0 (git+https://github.com/servo/rust-egl)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"expat-sys 2.1.0 (git+https://github.com/servo/libexpat)", "expat-sys 2.1.0 (git+https://github.com/servo/libexpat)",
"freetype-sys 2.4.11 (git+https://github.com/servo/libfreetype2)", "freetype-sys 2.4.11 (git+https://github.com/servo/libfreetype2)",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1326,9 +1335,9 @@ name = "style"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1350,8 +1359,8 @@ dependencies = [
name = "style_tests" name = "style_tests"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"selectors 0.1.0 (git+https://github.com/servo/rust-selectors)", "selectors 0.1.0 (git+https://github.com/servo/rust-selectors)",
"string_cache 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"string_cache_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache_plugin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1448,8 +1457,8 @@ version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1468,7 +1477,7 @@ dependencies = [
name = "util_tests" name = "util_tests"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"plugins 0.0.1", "plugins 0.0.1",
"util 0.0.1", "util 0.0.1",

View file

@ -15,10 +15,13 @@ path = "../plugins"
[dependencies.util] [dependencies.util]
path = "../util" path = "../util"
[dependencies.selectors] [dependencies.selectors]
git = "https://github.com/servo/rust-selectors" git = "https://github.com/servo/rust-selectors"
[dependencies.cssparser]
version = "0.3"
features = [ "serde-serialization" ]
[dependencies] [dependencies]
log = "0.3" log = "0.3"
encoding = "0.2" encoding = "0.2"
@ -27,7 +30,6 @@ rustc-serialize = "0.3"
matches = "0.1" matches = "0.1"
url = "0.2.36" url = "0.2.36"
bitflags = "0.3" bitflags = "0.3"
cssparser = "0.3.2"
num = "0.1.24" num = "0.1.24"
lazy_static = "0.1.10" lazy_static = "0.1.10"
smallvec = "0.1" smallvec = "0.1"

View file

@ -21,6 +21,10 @@ path = "../plugins"
[dependencies.azure] [dependencies.azure]
git = "https://github.com/servo/rust-azure" git = "https://github.com/servo/rust-azure"
[dependencies.cssparser]
version = "0.3"
features = [ "serde-serialization" ]
[dependencies] [dependencies]
log = "0.3" log = "0.3"
bitflags = "0.3" bitflags = "0.3"
@ -29,7 +33,6 @@ rand = "0.3"
rustc-serialize = "0.3" rustc-serialize = "0.3"
smallvec = "0.1" smallvec = "0.1"
num_cpus = "0.2.2" num_cpus = "0.2.2"
cssparser = "0.3.1"
num = "0.1.24" num = "0.1.24"
url = "0.2.36" url = "0.2.36"
euclid = "0.1" euclid = "0.1"

67
ports/cef/Cargo.lock generated
View file

@ -10,7 +10,7 @@ dependencies = [
"core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-text 0.1.0 (git+https://github.com/servo/core-text-rs)", "core-text 0.1.0 (git+https://github.com/servo/core-text-rs)",
"devtools 0.0.1", "devtools 0.0.1",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx 0.0.1", "gfx 0.0.1",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin_app 0.0.1", "glutin_app 0.0.1",
@ -60,7 +60,7 @@ dependencies = [
"core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-text 0.1.0 (git+https://github.com/servo/core-text-rs)", "core-text 0.1.0 (git+https://github.com/servo/core-text-rs)",
"egl 0.1.0 (git+https://github.com/servo/rust-egl)", "egl 0.1.0 (git+https://github.com/servo/rust-egl)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"freetype 0.1.0 (git+https://github.com/servo/rust-freetype)", "freetype 0.1.0 (git+https://github.com/servo/rust-freetype)",
"freetype-sys 2.4.11 (git+https://github.com/servo/libfreetype2)", "freetype-sys 2.4.11 (git+https://github.com/servo/libfreetype2)",
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -91,8 +91,8 @@ version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"canvas_traits 0.0.1", "canvas_traits 0.0.1",
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx_traits 0.0.1", "gfx_traits 0.0.1",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
@ -108,12 +108,14 @@ name = "canvas_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx_traits 0.0.1", "gfx_traits 0.0.1",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)", "offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"serde 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -157,11 +159,13 @@ name = "compositing"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"canvas 0.0.1",
"canvas_traits 0.0.1",
"clipboard 0.0.1 (git+https://github.com/aweinstock314/rust-clipboard)", "clipboard 0.0.1 (git+https://github.com/aweinstock314/rust-clipboard)",
"core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-text 0.1.0 (git+https://github.com/servo/core-text-rs)", "core-text 0.1.0 (git+https://github.com/servo/core-text-rs)",
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx 0.0.1", "gfx 0.0.1",
"gfx_traits 0.0.1", "gfx_traits 0.0.1",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -174,6 +178,7 @@ dependencies = [
"net 0.0.1", "net 0.0.1",
"net_traits 0.0.1", "net_traits 0.0.1",
"num 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"profile_traits 0.0.1", "profile_traits 0.0.1",
"script_traits 0.0.1", "script_traits 0.0.1",
@ -223,11 +228,13 @@ dependencies = [
[[package]] [[package]]
name = "cssparser" name = "cssparser"
version = "0.3.2" version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -338,7 +345,7 @@ dependencies = [
[[package]] [[package]]
name = "euclid" name = "euclid"
version = "0.1.2" version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -430,7 +437,7 @@ dependencies = [
"core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-text 0.1.0 (git+https://github.com/servo/core-text-rs)", "core-text 0.1.0 (git+https://github.com/servo/core-text-rs)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"fontconfig 0.1.0 (git+https://github.com/servo/rust-fontconfig)", "fontconfig 0.1.0 (git+https://github.com/servo/rust-fontconfig)",
"freetype 0.1.0 (git+https://github.com/servo/rust-freetype)", "freetype 0.1.0 (git+https://github.com/servo/rust-freetype)",
@ -525,7 +532,7 @@ dependencies = [
"cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"compositing 0.0.1", "compositing 0.0.1",
"egl 0.1.0 (git+https://github.com/servo/rust-egl)", "egl 0.1.0 (git+https://github.com/servo/rust-egl)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin 0.0.26 (git+https://github.com/servo/glutin?branch=servo)", "glutin 0.0.26 (git+https://github.com/servo/glutin?branch=servo)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)",
@ -625,7 +632,7 @@ source = "git+https://github.com/servo/io-surface-rs#f772aa79f487d1722ec6ad3d3c3
dependencies = [ dependencies = [
"cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -682,7 +689,7 @@ dependencies = [
"cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"egl 0.1.0 (git+https://github.com/servo/rust-egl)", "egl 0.1.0 (git+https://github.com/servo/rust-egl)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"glx 0.0.1 (git+https://github.com/servo/rust-glx)", "glx 0.0.1 (git+https://github.com/servo/rust-glx)",
"io-surface 0.1.0 (git+https://github.com/servo/io-surface-rs)", "io-surface 0.1.0 (git+https://github.com/servo/io-surface-rs)",
@ -702,9 +709,9 @@ dependencies = [
"canvas 0.0.1", "canvas 0.0.1",
"canvas_traits 0.0.1", "canvas_traits 0.0.1",
"clock_ticks 0.0.6 (git+https://github.com/tomaka/clock_ticks)", "clock_ticks 0.0.6 (git+https://github.com/tomaka/clock_ticks)",
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx 0.0.1", "gfx 0.0.1",
"gfx_traits 0.0.1", "gfx_traits 0.0.1",
@ -735,7 +742,7 @@ dependencies = [
name = "layout_traits" name = "layout_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx 0.0.1", "gfx 0.0.1",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"msg 0.0.1", "msg 0.0.1",
@ -828,12 +835,14 @@ version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas_traits 0.0.1",
"core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"io-surface 0.1.0 (git+https://github.com/servo/io-surface-rs)", "io-surface 0.1.0 (git+https://github.com/servo/io-surface-rs)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"rustc-serialize 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -849,7 +858,7 @@ version = "0.0.1"
dependencies = [ dependencies = [
"cookie 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "cookie 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"flate2 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -869,7 +878,7 @@ dependencies = [
name = "net_traits" name = "net_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -915,7 +924,7 @@ source = "git+https://github.com/ecoal95/rust-offscreen-rendering-context#724d47
dependencies = [ dependencies = [
"cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gl_generator 0.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "gl_generator 0.0.26 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1121,10 +1130,10 @@ dependencies = [
"bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1", "canvas 0.0.1",
"canvas_traits 0.0.1", "canvas_traits 0.0.1",
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1162,7 +1171,7 @@ name = "script_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1", "msg 0.0.1",
@ -1180,7 +1189,7 @@ version = "0.1.0"
source = "git+https://github.com/servo/rust-selectors#625734e1e8d70c012672b248adca302d0276fe08" source = "git+https://github.com/servo/rust-selectors#625734e1e8d70c012672b248adca302d0276fe08"
dependencies = [ dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"quicksort 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "quicksort 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1257,7 +1266,7 @@ source = "git+https://github.com/servo/skia#62a452b39294d94e60f279eacbb71a0b3296
dependencies = [ dependencies = [
"cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"egl 0.1.0 (git+https://github.com/servo/rust-egl)", "egl 0.1.0 (git+https://github.com/servo/rust-egl)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"expat-sys 2.1.0 (git+https://github.com/servo/libexpat)", "expat-sys 2.1.0 (git+https://github.com/servo/libexpat)",
"freetype-sys 2.4.11 (git+https://github.com/servo/libfreetype2)", "freetype-sys 2.4.11 (git+https://github.com/servo/libfreetype2)",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1323,9 +1332,9 @@ name = "style"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1431,8 +1440,8 @@ version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",

65
ports/gonk/Cargo.lock generated
View file

@ -7,7 +7,7 @@ dependencies = [
"egl 0.1.0 (git+https://github.com/servo/rust-egl)", "egl 0.1.0 (git+https://github.com/servo/rust-egl)",
"env_logger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"errno 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "errno 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx 0.0.1", "gfx 0.0.1",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)",
@ -47,7 +47,7 @@ dependencies = [
"core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-text 0.1.0 (git+https://github.com/servo/core-text-rs)", "core-text 0.1.0 (git+https://github.com/servo/core-text-rs)",
"egl 0.1.0 (git+https://github.com/servo/rust-egl)", "egl 0.1.0 (git+https://github.com/servo/rust-egl)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"freetype 0.1.0 (git+https://github.com/servo/rust-freetype)", "freetype 0.1.0 (git+https://github.com/servo/rust-freetype)",
"freetype-sys 2.4.11 (git+https://github.com/servo/libfreetype2)", "freetype-sys 2.4.11 (git+https://github.com/servo/libfreetype2)",
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -78,8 +78,8 @@ version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"canvas_traits 0.0.1", "canvas_traits 0.0.1",
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx_traits 0.0.1", "gfx_traits 0.0.1",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
@ -95,12 +95,14 @@ name = "canvas_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx_traits 0.0.1", "gfx_traits 0.0.1",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)", "offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"serde 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -134,11 +136,13 @@ name = "compositing"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"canvas 0.0.1",
"canvas_traits 0.0.1",
"clipboard 0.0.1 (git+https://github.com/aweinstock314/rust-clipboard)", "clipboard 0.0.1 (git+https://github.com/aweinstock314/rust-clipboard)",
"core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-text 0.1.0 (git+https://github.com/servo/core-text-rs)", "core-text 0.1.0 (git+https://github.com/servo/core-text-rs)",
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx 0.0.1", "gfx 0.0.1",
"gfx_traits 0.0.1", "gfx_traits 0.0.1",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -151,6 +155,7 @@ dependencies = [
"net 0.0.1", "net 0.0.1",
"net_traits 0.0.1", "net_traits 0.0.1",
"num 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"profile_traits 0.0.1", "profile_traits 0.0.1",
"script_traits 0.0.1", "script_traits 0.0.1",
@ -200,11 +205,13 @@ dependencies = [
[[package]] [[package]]
name = "cssparser" name = "cssparser"
version = "0.3.2" version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_macros 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
@ -325,7 +332,7 @@ dependencies = [
[[package]] [[package]]
name = "euclid" name = "euclid"
version = "0.1.2" version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -409,7 +416,7 @@ dependencies = [
"core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-text 0.1.0 (git+https://github.com/servo/core-text-rs)", "core-text 0.1.0 (git+https://github.com/servo/core-text-rs)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"fontconfig 0.1.0 (git+https://github.com/servo/rust-fontconfig)", "fontconfig 0.1.0 (git+https://github.com/servo/rust-fontconfig)",
"freetype 0.1.0 (git+https://github.com/servo/rust-freetype)", "freetype 0.1.0 (git+https://github.com/servo/rust-freetype)",
@ -559,7 +566,7 @@ source = "git+https://github.com/servo/io-surface-rs#f772aa79f487d1722ec6ad3d3c3
dependencies = [ dependencies = [
"cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -616,7 +623,7 @@ dependencies = [
"cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"egl 0.1.0 (git+https://github.com/servo/rust-egl)", "egl 0.1.0 (git+https://github.com/servo/rust-egl)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"glx 0.0.1 (git+https://github.com/servo/rust-glx)", "glx 0.0.1 (git+https://github.com/servo/rust-glx)",
"io-surface 0.1.0 (git+https://github.com/servo/io-surface-rs)", "io-surface 0.1.0 (git+https://github.com/servo/io-surface-rs)",
@ -636,9 +643,9 @@ dependencies = [
"canvas 0.0.1", "canvas 0.0.1",
"canvas_traits 0.0.1", "canvas_traits 0.0.1",
"clock_ticks 0.0.6 (git+https://github.com/tomaka/clock_ticks)", "clock_ticks 0.0.6 (git+https://github.com/tomaka/clock_ticks)",
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx 0.0.1", "gfx 0.0.1",
"gfx_traits 0.0.1", "gfx_traits 0.0.1",
@ -669,7 +676,7 @@ dependencies = [
name = "layout_traits" name = "layout_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx 0.0.1", "gfx 0.0.1",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"msg 0.0.1", "msg 0.0.1",
@ -754,12 +761,14 @@ version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas_traits 0.0.1",
"core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"io-surface 0.1.0 (git+https://github.com/servo/io-surface-rs)", "io-surface 0.1.0 (git+https://github.com/servo/io-surface-rs)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)", "layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"offscreen_gl_context 0.1.0 (git+https://github.com/ecoal95/rust-offscreen-rendering-context)",
"png 0.1.0 (git+https://github.com/servo/rust-png)", "png 0.1.0 (git+https://github.com/servo/rust-png)",
"rustc-serialize 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -775,7 +784,7 @@ version = "0.0.1"
dependencies = [ dependencies = [
"cookie 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "cookie 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"flate2 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -795,7 +804,7 @@ dependencies = [
name = "net_traits" name = "net_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -832,7 +841,7 @@ source = "git+https://github.com/ecoal95/rust-offscreen-rendering-context#724d47
dependencies = [ dependencies = [
"cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gl_generator 0.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "gl_generator 0.0.26 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1029,10 +1038,10 @@ dependencies = [
"bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas 0.0.1", "canvas 0.0.1",
"canvas_traits 0.0.1", "canvas_traits 0.0.1",
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "html5ever 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1070,7 +1079,7 @@ name = "script_traits"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"devtools_traits 0.0.1", "devtools_traits 0.0.1",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)", "ipc-channel 0.1.0 (git+https://github.com/pcwalton/ipc-channel)",
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1", "msg 0.0.1",
@ -1088,7 +1097,7 @@ version = "0.1.0"
source = "git+https://github.com/servo/rust-selectors#625734e1e8d70c012672b248adca302d0276fe08" source = "git+https://github.com/servo/rust-selectors#625734e1e8d70c012672b248adca302d0276fe08"
dependencies = [ dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"quicksort 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "quicksort 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1155,7 +1164,7 @@ source = "git+https://github.com/servo/skia#62a452b39294d94e60f279eacbb71a0b3296
dependencies = [ dependencies = [
"cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "cgl 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"egl 0.1.0 (git+https://github.com/servo/rust-egl)", "egl 0.1.0 (git+https://github.com/servo/rust-egl)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"expat-sys 2.1.0 (git+https://github.com/servo/libexpat)", "expat-sys 2.1.0 (git+https://github.com/servo/libexpat)",
"freetype-sys 2.4.11 (git+https://github.com/servo/libfreetype2)", "freetype-sys 2.4.11 (git+https://github.com/servo/libfreetype2)",
"gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1221,9 +1230,9 @@ name = "style"
version = "0.0.1" version = "0.0.1"
dependencies = [ dependencies = [
"bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1320,8 +1329,8 @@ version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure)", "azure 0.1.0 (git+https://github.com/servo/rust-azure)",
"bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",