Add unique canvas IDs to all canvas operations.

This commit is contained in:
Brody Eastwood 2018-03-20 15:04:15 -04:00 committed by Brody-Eastwood
parent a69eceefc9
commit 8a1590efc6
13 changed files with 334 additions and 155 deletions

View file

@ -16,13 +16,16 @@ pub enum FillRule {
Evenodd,
}
#[derive(Clone, Deserialize, MallocSizeOf, PartialEq, Serialize)]
pub struct CanvasId(pub u64);
#[derive(Clone, Deserialize, Serialize)]
pub enum CanvasMsg {
Canvas2d(Canvas2dMsg),
FromLayout(FromLayoutMsg),
FromScript(FromScriptMsg),
Recreate(Size2D<i32>),
Close,
Canvas2d(Canvas2dMsg, CanvasId),
FromLayout(FromLayoutMsg, CanvasId),
FromScript(FromScriptMsg, CanvasId),
Recreate(Size2D<i32>, CanvasId),
Close(CanvasId),
}
#[derive(Clone, Deserialize, Serialize)]
@ -37,7 +40,7 @@ pub enum Canvas2dMsg {
DrawImage(ByteBuf, Size2D<f64>, Rect<f64>, Rect<f64>, bool),
DrawImageSelf(Size2D<f64>, Rect<f64>, Rect<f64>, bool),
DrawImageInOther(
IpcSender<CanvasMsg>, Size2D<f64>, Rect<f64>, Rect<f64>, bool, IpcSender<()>),
IpcSender<CanvasMsg>, CanvasId, Size2D<f64>, Rect<f64>, Rect<f64>, bool, IpcSender<()>),
BeginPath,
BezierCurveTo(Point2D<f32>, Point2D<f32>, Point2D<f32>),
ClearRect(Rect<f32>),