mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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:
parent
886c08c393
commit
bb99b2f3c8
39 changed files with 694 additions and 365 deletions
|
@ -11,15 +11,15 @@ use paint_context::PaintContext;
|
|||
|
||||
use azure::azure_hl::{SurfaceFormat, Color, DrawTarget, BackendType};
|
||||
use azure::AzFloat;
|
||||
use canvas_traits::CanvasMsg;
|
||||
use euclid::Matrix4;
|
||||
use euclid::point::Point2D;
|
||||
use euclid::rect::Rect;
|
||||
use euclid::size::Size2D;
|
||||
use ipc_channel::ipc;
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use ipc_channel::router::ROUTER;
|
||||
use layers::platform::surface::{NativeDisplay, NativeSurface};
|
||||
use layers::layers::{BufferRequest, LayerBuffer, LayerBufferSet};
|
||||
use canvas_traits::CanvasMsg;
|
||||
use msg::compositor_msg::{Epoch, FrameTreeId, LayerId, LayerKind};
|
||||
use msg::compositor_msg::{LayerProperties, PaintListener, ScrollPolicy};
|
||||
use msg::constellation_msg::Msg as ConstellationMsg;
|
||||
|
@ -30,7 +30,7 @@ use profile_traits::time::{self, profile};
|
|||
use rand::{self, Rng};
|
||||
use std::borrow::ToOwned;
|
||||
use std::mem as std_mem;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::sync::Arc;
|
||||
use std::sync::mpsc::{Receiver, Sender, channel};
|
||||
use std::collections::HashMap;
|
||||
use url::Url;
|
||||
|
@ -72,7 +72,7 @@ pub struct PaintRequest {
|
|||
|
||||
pub enum Msg {
|
||||
PaintInit(Epoch, Arc<StackingContext>),
|
||||
CanvasLayer(LayerId, Arc<Mutex<Sender<CanvasMsg>>>),
|
||||
CanvasLayer(LayerId, IpcSender<CanvasMsg>),
|
||||
Paint(Vec<PaintRequest>, FrameTreeId),
|
||||
PaintPermissionGranted,
|
||||
PaintPermissionRevoked,
|
||||
|
@ -122,7 +122,7 @@ pub struct PaintTask<C> {
|
|||
worker_threads: Vec<WorkerThreadProxy>,
|
||||
|
||||
/// 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue