canvas: Move to shared memory for images and canvas backing stores.

The idea here is to land this before making images and canvas IPC-safe,
because this will shake out bugs relating to the shared memory. There
are currently test timeouts that are preventing multiprocess images and
canvas from landing, and I believe those are due to the inefficiency of
sending large amounts of data in the unoptimized builds we test with. By
moving to shared memory, this should drastically reduce the number of
copies and `serde` serialization.

Under the hood, this uses Mach OOL messages on Mac and temporary
memory-mapped files on Linux.
This commit is contained in:
Patrick Walton 2015-07-22 22:53:52 -07:00
parent 135ef35f6d
commit 626974994a
13 changed files with 54 additions and 20 deletions

View file

@ -11,6 +11,7 @@ extern crate azure;
extern crate euclid;
extern crate cssparser;
extern crate gfx_traits;
extern crate ipc_channel;
extern crate layers;
extern crate offscreen_gl_context;
@ -29,6 +30,7 @@ use std::sync::mpsc::{Sender};
use layers::platform::surface::NativeSurface;
use offscreen_gl_context::GLContextAttributes;
use core::nonzero::NonZero;
use ipc_channel::ipc::IpcSharedMemory;
#[derive(Clone)]
pub enum CanvasMsg {
@ -41,7 +43,7 @@ pub enum CanvasMsg {
pub enum CanvasCommonMsg {
Close,
Recreate(Size2D<i32>),
SendPixelContents(Sender<Vec<u8>>),
SendPixelContents(Sender<IpcSharedMemory>),
SendNativeSurface(Sender<NativeSurface>),
}