mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
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:
parent
784fbb2bc1
commit
19f40cdf0b
5 changed files with 52 additions and 55 deletions
|
@ -241,18 +241,8 @@ impl<'a> CanvasPaintThread <'a> {
|
|||
Canvas2dMsg::GetImageData(dest_rect, canvas_size, chan) => {
|
||||
self.canvas(canvas_id).image_data(dest_rect, canvas_size, chan)
|
||||
},
|
||||
Canvas2dMsg::PutImageData(
|
||||
imagedata,
|
||||
offset,
|
||||
image_data_size,
|
||||
dirty_rect,
|
||||
) => {
|
||||
self.canvas(canvas_id).put_image_data(
|
||||
imagedata.into(),
|
||||
offset,
|
||||
image_data_size,
|
||||
dirty_rect,
|
||||
)
|
||||
Canvas2dMsg::PutImageData(imagedata, offset, imagedata_size) => {
|
||||
self.canvas(canvas_id).put_image_data(imagedata.into(), offset, imagedata_size)
|
||||
},
|
||||
Canvas2dMsg::SetShadowOffsetX(value) => {
|
||||
self.canvas(canvas_id).set_shadow_offset_x(value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue