Commit graph

67 commits

Author SHA1 Message Date
Anthony Ramine
19f40cdf0b 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.
2018-10-06 01:12:05 +02:00
Anthony Ramine
82c7d71811 Improve gl.putImageData
This commit should allow us to send smaller blobs to the canvas thread,
I made it into its own commit just to try=wpt.
2018-10-05 17:07:58 +02:00
Anthony Ramine
3d910feb3a Align canvas.putImageData with spec
The arguments are supposed to be long values, not floats.
2018-10-05 17:07:56 +02:00
Anthony Ramine
62ea3c093a Move canvas.putImageData checks to the DOM side 2018-10-05 00:35:39 +02:00
Anthony Ramine
a3392610c3 Make HTMLCanvasElement::get_size return a Size2D<u32>
The changes keep trickling down.
2018-10-02 14:21:06 +02:00
Anthony Ramine
426067069c Clean up ToAzurePattern for FillOrStrokeStyle 2018-10-02 14:21:06 +02:00
Anthony Ramine
36c8cd229e Remove Canvas2dMsg::DrawImageSelf
Now that all canvas share the same thread, it's useless to have a separate message
for that.
2018-09-17 16:24:01 +02:00
Anthony Ramine
9f7b746430 Specify capacity in CanvasData::read_pixels 2018-09-17 10:01:13 +02:00
Anthony Ramine
21e992bf40 Update azure
https://github.com/servo/rust-azure/pull/293
2018-09-16 20:53:38 +02:00
Anthony Ramine
fef04c65f6 Avoid a byte swap roundtrip 2018-09-14 14:48:39 +02:00
Anthony Ramine
2f2331f149 Use a byte channel to retrieve pixels of 2D canvas 2018-09-13 22:04:30 +02:00
Anthony Ramine
b5c469d52e Merge byte swap and unmultiplying loops in ctx.getImageData() 2018-09-13 22:04:30 +02:00
Bastien Orivel
9e446971a8 Update euclid to 0.18 2018-07-18 09:27:24 +02:00
Glenn Watson
823f3e2eb1 Update WR (transaction API change) 2018-06-20 09:15:31 +10:00
cadubentzen
3a6679b3b5 Refactor draw_image and make draw_image_self call draw_image in canvas. 2018-06-08 00:15:10 -03:00
Josh Matthews
57440549d8 Respect the source rectangle when drawing a canvas to another canvas. 2018-06-05 19:17:31 -04:00
Brody-Eastwood
f3065f3707 Moved Canvas rendering to a single thread. 2018-04-23 20:50:05 -04:00