mirror of
https://github.com/servo/servo.git
synced 2025-06-10 01:23:13 +00:00
canvas: Cleanup CanvasData and layout and script messages.
This commit is contained in:
parent
1c26f44cbb
commit
2e69143f6b
5 changed files with 49 additions and 24 deletions
|
@ -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,
|
||||
}
|
||||
|
||||
|
@ -73,6 +73,11 @@ pub enum FromLayoutMsg {
|
|||
SendData(IpcSender<CanvasData>),
|
||||
}
|
||||
|
||||
#[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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue