Commit graph

456 commits

Author SHA1 Message Date
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
99b6091b7a Clean up create_webgl_context 2018-10-02 14:21:06 +02:00
bors-servo
57053e03bb
Auto merge of #21825 - jdm:backtrace-helpers, r=Manishearth
Optional backtraces for JS errors and WebGL errors

This adds two new build-time features to enable useful debugging tools when investigating why JS and WebGL content isn't working. They're optional because they're quite heavyweight.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because they're optional developer features.

<!-- 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/21825)
<!-- Reviewable:end -->
2018-10-02 06:57:38 -04:00
Josh Matthews
26e1001efd
Remove trailing whitespace. 2018-10-01 13:32:34 +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
Josh Matthews
e5892989ca
Warn when using slow WebGL code path. 2018-09-27 18:44:02 -04: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
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
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
Anthony Ramine
6e4bf750a4 Kill WebGLThreadObserver 2018-09-12 23:46: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
Josh Matthews
15e2af0fea webgl: Support DEPTH_STENCIL_ATTACHMENT on osmesa. 2018-09-10 15:56:16 -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
kingdido999
f472d05003 Format components canvas and canvas_traits #21373 2018-08-30 11:24:39 +08:00
Bastien Orivel
71fd4477d6 Dedupe num-traits 2018-08-09 18:26:28 +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
76f23f7d78 Simplify gl.getShaderParameter() (fixes #20562)
The expectation change is due to the shader now using its DOM-side compile status.
It is actually a bug for the shader to think it actually compiled successfully,
but at least it does so consistently now.
2018-07-31 11:12:45 +02:00
Anthony Ramine
5a9ad01145 Cache which capabilities are enabled in the context (fixes #20534)
This is needed for #20555.
2018-07-25 19:58:02 +02:00
Anthony Ramine
3e8c2d659a Implement gl.getUniform() 2018-07-18 21:37:41 +02:00
Anthony Ramine
20714bd08c Update to gleam 0.6 2018-07-18 18:31:51 +02:00
Bastien Orivel
9e446971a8 Update euclid to 0.18 2018-07-18 09:27:24 +02:00
bors-servo
3003e6f897
Auto merge of #21184 - servo:webgl, r=jdm
Use active uniforms data to implement gl.uniform* checks

<!-- 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/21184)
<!-- Reviewable:end -->
2018-07-16 19:46:05 -04:00
Anthony Ramine
476640c3ab Use active uniforms data to implement gl.uniform* checks 2018-07-17 01:26:44 +02:00
Anthony Ramine
e7631cea61 Move ANGLE name shenanigans to WebGL thread 2018-07-16 10:16:30 +02:00
Anthony Ramine
cbac5d05be Store active uniforms on the DOM side 2018-07-16 10:16:29 +02:00
Bastien Orivel
6354cd9a5e WIP: Dedupe dependencies 2018-07-16 08:59:15 +10:00
Anthony Ramine
a5b800970a Remove WebGLCommand::GetActiveAttrib 2018-07-11 11:55:50 +02:00
Anthony Ramine
4e6eea221a Implement instanced WebGL drawing calls (part of #20791) 2018-07-08 10:44:45 +02:00
Anthony Ramine
31774e9203 Implement gl.getParameter(gl.MAX_VIEWPORT_DIMS) 2018-07-08 10:14:10 +02:00
Anthony Ramine
15389586d9 Make gl.useProgram(null) do the right thing 2018-07-05 14:20:47 +02:00
Anthony Ramine
fc593c68c5 Store active attribs in DOM and optimise active attributes APIs 2018-07-05 14:20:47 +02:00
Anthony Ramine
cde6023ed4 Store vertex attribs data in DOM and optimise GetVertexAttrib 2018-07-05 14:20:47 +02:00
Emilio Cobos Álvarez
719209316c
Fix servo build. 2018-07-01 00:54:30 +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
bors-servo
40f7da0aac
Auto merge of #20923 - jdm:canvas-source, r=avadacatavra
Respect the source rectangle when drawing a canvas to another canvas.

This allows us to run the three.js examples without panicking, since they use self-drawing canvases to scroll the FPS graph.

---
- [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

<!-- 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/20923)
<!-- Reviewable:end -->
2018-06-07 17:37:03 -04:00
Anthony Ramine
f1288cc6e0 Implement EXT_texture_filter_anisotropic 2018-06-06 12:24:47 +02:00