Commit graph

255 commits

Author SHA1 Message Date
Anthony Ramine
9a8d03a0f3 Make HTMLCanvasElement::fetch_all_data return a shared memory blob 2018-11-21 12:53:50 +01:00
Anthony Ramine
804d964b7d Send an IpcSharedMemory in tex_image_2d and tex_sub_image_2d
This avoids a copy in the case of textures coming from HTMLImageElement.
2018-11-20 10:14:52 +01:00
Anthony Ramine
cfca906ee2 Call rgba8_byte_swap_colors_inplace on the WebGL thread 2018-11-20 10:14:52 +01:00
Anthony Ramine
87c849c0d6 Move prepare_pixels to the canvas thread
Nothing else uses it in the whole crate graph.
2018-11-20 10:14:51 +01:00
Anthony Ramine
ca62b5c318 Call prepare_pixels on the WebGL thread 2018-11-20 10:14:50 +01:00
Anthony Ramine
5f9e3d8bb9 Move prepare_pixels to canvas_traits::webgl 2018-11-20 10:14:50 +01:00
Anthony Ramine
2a5539caef Use Size2D in TexImage2D and TexSubImage2D messages 2018-11-20 10:14:49 +01:00
Jan Andre Ikenmeyer
1d6fe65401
Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
Anthony Ramine
947e5afa0c Remove some boolean flags in tex_image_2d and tex_sub_image_2d 2018-11-16 12:42:57 +01:00
Anthony Ramine
3f8a3b2887 Simplify define_resource_id 2018-11-16 12:39:21 +01:00
Anthony Ramine
1c89ac90b9 Send alignment info directly in TexImage2D and TexSubImage2d messages 2018-11-16 12:39:20 +01:00
Anthony Ramine
65d1b11929 Make TexImage2D and TexSubImage2D struct variants 2018-11-16 12:38:07 +01:00
Anthony Ramine
a5779ad372 Prefix some pixels functions with rgba8_ 2018-11-16 12:37:34 +01:00
Anthony Ramine
adf363a208 Move prepare_pixels helper functions to canvas_traits 2018-11-16 12:37:31 +01:00
Simon Sapin
9f977c5287 Remove useless use crate_name; imports.
A `crate_name::foo` path always works in 2018
2018-11-08 09:29:52 +01:00
Simon Sapin
2012be4a8b cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Pyfisch
cb07debcb6 Format remaining files 2018-11-06 22:30:31 +01:00
Keith Yeung
8757cf5bc0 Use question mark operator instead of try macro with a raw identifier
Co-Authored-By: SimonSapin <simon.sapin@exyr.org>
2018-11-06 16:12:04 +01:00
Simon Sapin
9f9bf8f6bc Switch most crates to the 2018 edition 2018-11-06 16:12:04 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
Emilio Cobos Álvarez
29f56919e2
Update remaining references to cssparser 0.24. 2018-11-05 12:33:37 +01:00
Alan Jeffrey
05391e27cd Add lots of derived Debug impls 2018-10-29 09:21:37 -05:00
Paul Rouget
cdf22c1493 Exit Canvas paint thread on shutdown 2018-10-29 11:06:06 +01:00
Anthony Ramine
8828925f4f Properly support gl_PointSize and gl_PointCoord
Fixes #21719.
Fixes #20993.
Fixes #20992.
Fixes #21007.
Fixes #20979.
2018-10-18 20:15:23 +02:00
Anthony Ramine
6c469b90b1 Share some code between 2D canvas and WebGL 2018-10-09 14:57:02 +02:00
Anthony Ramine
77c28bdfc9 Abstract some stuff common to ctx.getImageData and ctx.putImageData 2018-10-08 11:39:09 +02:00
Anthony Ramine
241dba064d Align ctx.createImageData and ctx.getImageData with the spec 2018-10-06 11:41:48 +02:00
Anthony Ramine
75e6f5dfaa Avoid copying pixels in ctx.putImageData sometimes 2018-10-06 02:59:25 +02:00
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
784fbb2bc1 Merge some byte swap/premultiply functions in their own crate 2018-10-06 01:11:55 +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
a3392610c3 Make HTMLCanvasElement::get_size return a Size2D<u32>
The changes keep trickling down.
2018-10-02 14:21:06 +02:00
Josh Matthews
5dc80dd07a webgl: Add feature to store backtraces for each WebGL API call for easier debugging. 2018-10-01 10:43:13 +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
f1e8eb640c Don't create 2D canvas contexts arbitrarily
Sometimes, the canvas still has no rendering context, in this case it represents
a transparent black rectangle.
2018-09-16 20:44:41 +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
d5f3b211ba Properly support PACK_ALIGNMENT in WebGL 1 2018-09-12 23:45:49 +02:00
bors-servo
26745b2741
Auto merge of #21461 - jdm:webgltmp2, r=nox
Various webgl fixes for framebuffer attachment test

These changes resolve all panics on macOS when running framebuffer-object-attachment.html in headless and headful testing.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] There are tests for these changes OR
- [x] Fixes #13710. Fixes #20570.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21461)
<!-- Reviewable:end -->
2018-09-12 16:36:08 -04:00
Simon Sapin
2a996fbc8f Replace mpsc with crossbeam/servo channel, update ipc-channel
Co-authored-by: Gregory Terzian <gterzian@users.noreply.github.com>
2018-09-12 13:33:32 +08:00
Josh Matthews
1b08dd5232 webgl: Move framebuffer initialization logic to WebGL thread. 2018-09-10 16:31:29 -04:00
Anthony Ramine
4bd8efa49e Use byte channels to send textures to the WebGL thread 2018-09-08 13:42:06 +02:00
Anthony Ramine
408e540c55 Use ipc::bytes_channel in ReadPixels 2018-09-08 13:42:06 +02:00
Anthony Ramine
9f924013bc Use a bytes channel in BufferData
This means we don't need to copy the input ArrayBuffer at all on the DOM side.
2018-09-07 11:28:59 +02:00
Anthony Ramine
e37856a855 Remove Clone impl for WebGLMsg 2018-09-07 11:28:45 +02:00
kingdido999
f472d05003 Format components canvas and canvas_traits #21373 2018-08-30 11:24:39 +08:00
Anthony Ramine
8b1c753c6c Properly check limit in gl.activeTexture() 2018-08-23 15:15:33 +02:00
Paul Rouget
0d9161dd7b WR update 2018-08-06 07:22:24 +02:00
Anthony Ramine
04c81c5cc3 Merge code from Draw* and Draw*Instanced methods
This made me realise we weren't supporting OES_element_index_uint in the
ANGLE_instanced_arrays extension.
2018-08-02 22:54:39 +02:00
Anthony Ramine
f7124886bc Use the DOM cache for gl.getTexParameter(gl.TEXTURE_*_FILTER)
Part of #20596.
2018-08-02 18:06:58 +02:00