/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use canvas_paint_task::{FillOrStrokeStyle, LineCapStyle, LineJoinStyle}; use geom::matrix2d::Matrix2D; use geom::point::Point2D; use geom::rect::Rect; use geom::size::Size2D; use std::sync::mpsc::{Sender}; #[derive(Clone)] pub enum CanvasMsg { Canvas2d(Canvas2dMsg), Common(CanvasCommonMsg), WebGL(CanvasWebGLMsg), } #[derive(Clone)] pub enum Canvas2dMsg { Arc(Point2D, f32, f32, f32, bool), ArcTo(Point2D, Point2D, f32), DrawImage(Vec, Size2D, Rect, Rect, bool), DrawImageSelf(Size2D, Rect, Rect, bool), BeginPath, BezierCurveTo(Point2D, Point2D, Point2D), ClosePath, ClearRect(Rect), Fill, FillRect(Rect), GetImageData(Rect, Size2D, Sender>), LineTo(Point2D), MoveTo(Point2D), PutImageData(Vec, Rect, Option>), QuadraticCurveTo(Point2D, Point2D), Rect(Rect), RestoreContext, SaveContext, StrokeRect(Rect), Stroke, SetFillStyle(FillOrStrokeStyle), SetStrokeStyle(FillOrStrokeStyle), SetLineWidth(f32), SetLineCap(LineCapStyle), SetLineJoin(LineJoinStyle), SetMiterLimit(f32), SetGlobalAlpha(f32), SetTransform(Matrix2D), } #[derive(Clone)] pub enum CanvasWebGLMsg { Clear(u32), ClearColor(f32, f32, f32, f32), } #[derive(Clone)] pub enum CanvasCommonMsg { Close, Recreate(Size2D), SendPixelContents(Sender>), }