Introduce ImageData::get_rect

We use that to send only the pixels that will be actually drawn to the
canvas thread in CanvasRenderingContext2d::PutImageData.

We also make the canvas thread byte swap and premultiply colours in-place.
This commit is contained in:
Anthony Ramine 2018-10-06 01:10:34 +02:00
parent 784fbb2bc1
commit 19f40cdf0b
5 changed files with 52 additions and 55 deletions

View file

@ -54,7 +54,7 @@ pub enum Canvas2dMsg {
IsPointInPath(f64, f64, FillRule, IpcSender<bool>),
LineTo(Point2D<f32>),
MoveTo(Point2D<f32>),
PutImageData(ByteBuf, Vector2D<i32>, Size2D<i32>, Rect<i32>),
PutImageData(ByteBuf, Vector2D<i32>, Size2D<i32>),
QuadraticCurveTo(Point2D<f32>, Point2D<f32>),
Rect(Rect<f32>),
RestoreContext,