aboutsummaryrefslogtreecommitdiffstats
path: root/components/canvas_traits/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/canvas_traits/lib.rs')
-rw-r--r--components/canvas_traits/lib.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/components/canvas_traits/lib.rs b/components/canvas_traits/lib.rs
index 5a1acc710d5..8269664cd46 100644
--- a/components/canvas_traits/lib.rs
+++ b/components/canvas_traits/lib.rs
@@ -31,7 +31,7 @@ use euclid::matrix2d::Matrix2D;
use euclid::point::Point2D;
use euclid::rect::Rect;
use euclid::size::Size2D;
-use ipc_channel::ipc::{IpcSender, IpcSharedMemory};
+use ipc_channel::ipc::IpcSender;
use std::default::Default;
use std::str::FromStr;
use webrender_traits::{WebGLCommand, WebGLContextId};
@@ -47,6 +47,7 @@ pub enum CanvasMsg {
Canvas2d(Canvas2dMsg),
Common(CanvasCommonMsg),
FromLayout(FromLayoutMsg),
+ FromScript(FromScriptMsg),
WebGL(WebGLCommand),
}
@@ -58,13 +59,12 @@ pub enum CanvasCommonMsg {
#[derive(Clone, Deserialize, Serialize)]
pub enum CanvasData {
- Pixels(CanvasPixelData),
+ Image(CanvasImageData),
WebGL(WebGLContextId),
}
#[derive(Clone, Deserialize, Serialize)]
-pub struct CanvasPixelData {
- pub image_data: IpcSharedMemory,
+pub struct CanvasImageData {
pub image_key: webrender_traits::ImageKey,
}
@@ -74,6 +74,11 @@ pub enum FromLayoutMsg {
}
#[derive(Clone, Deserialize, Serialize)]
+pub enum FromScriptMsg {
+ SendPixels(IpcSender<Option<Vec<u8>>>),
+}
+
+#[derive(Clone, Deserialize, Serialize)]
pub enum Canvas2dMsg {
Arc(Point2D<f32>, f32, f32, f32, bool),
ArcTo(Point2D<f32>, Point2D<f32>, f32),