Commit graph

7158 commits

Author SHA1 Message Date
Anthony Ramine
d6ebbd3e17 Implement gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE) 2018-03-24 16:36:19 +01:00
Anthony Ramine
20a309f037 Implement missing WebGLShader checks
Methods compileShader and getShaderParameter should emit an error when
the shader has been deleted.
2018-03-24 15:24:54 +01:00
Anthony Ramine
a62bed82e4 Implement WebGLRenderingContextBase.getAttachedShaders 2018-03-24 13:58:07 +01:00
Anthony Ramine
2befe47384 Implement missing checks in WebGLRenderingContext::GetBufferParameter 2018-03-24 11:44:29 +01:00
bors-servo
72f326b22b
Auto merge of #20400 - servo:webgl, r=emilio
Implement HTMLCanvasElement.toDataURL for WebGL canvas (fixes #19147)

<!-- 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/20400)
<!-- Reviewable:end -->
2018-03-24 00:18:28 -04:00
bors-servo
5a432eaad3
Auto merge of #20404 - MaximilianDauner:issue_20392, r=jdm
GamepadButtonList::sync_from_vr should use more iterators #20392

<!-- Please describe your changes on the following line: -->
Used the zip function instead of iterating over both vectors with an indexing variable and using unwrap.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #20392(github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because it says in the issue description no need for tests
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/20404)
<!-- Reviewable:end -->
2018-03-23 23:15:51 -04:00
MaximilianDauner
b42e54f13f Used the zip function to iterate over both vectors simultaneously instead of an
index variable and unwrapping the result.
2018-03-23 20:13:13 +01:00
Igor Matuszewski
80c6891f33 Use safe to_vec() for typed arrays in WebGL bindings 2018-03-23 19:37:25 +01:00
Igor Matuszewski
fbfcc762e1 Add codegen test for function overloads taking typed array args 2018-03-23 19:25:20 +01:00
Igor Matuszewski
2437a8472e Unify argument auto rooting in codegen 2018-03-23 19:25:20 +01:00
Igor Matuszewski
c42127b683 Fix indentation 2018-03-23 19:25:19 +01:00
Igor Matuszewski
cb85a95478 Fix sanity check in vertex attrib 2018-03-23 19:25:19 +01:00
Igor Matuszewski
daceeb4002 Appease test-tidy 2018-03-23 19:25:19 +01:00
Igor Matuszewski
20f21cb5f8 Adapt uniform[fv] and similar to accept typed array args 2018-03-23 19:25:19 +01:00
Igor Matuszewski
c1c74ed96c Adapt function bodies for usage with typed array args 2018-03-23 19:25:19 +01:00
Igor Matuszewski
36f39ce27a Change WebGL function signatures accepting typed arrays 2018-03-23 19:25:19 +01:00
bors-servo
18ef5874dd
Auto merge of #20399 - Xanewok:remove-heap-handle-mut, r=jdm
Sanitize Heap::handle(_mut) functions

<!-- Please describe your changes on the following line: -->
Complementary to https://github.com/servo/rust-mozjs/pull/404.

Removing `Heap::handle_mut` didn't warrant any changes on Servo side, and so the changes here are only to fix compilation with `Heap::handle` being now marked as `unsafe`.

The main idea is that we can't hand out handles to heap values themselves, since they're not guaranteed to be rooted, but it's safe to do when we are - hence why the safe impl on `RootedTraceableBox<Heap<T>>` and why it's safe to use inside structs that hold a Heap and are `#[must_root]`.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because the compiler forces correctness here.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/20399)
<!-- Reviewable:end -->
2018-03-23 13:06:01 -04:00
Anthony Ramine
a77d35b60c Implement HTMLCanvasElement.toDataURL for WebGL canvas (fixes #19147) 2018-03-23 17:32:42 +01:00
Igor Matuszewski
f7c039516c Use unsafe Heap::handle wherever needed 2018-03-23 17:31:34 +01:00
Igor Matuszewski
ed0091f86f Add safe handle function for rooted heap values 2018-03-23 17:31:34 +01:00
Igor Matuszewski
8aa2ebef0c Use mozjs 0.4 2018-03-23 17:31:29 +01:00
Anthony Ramine
838d1305ca Implement OES_element_index_uint (fixes #20384) 2018-03-23 02:47:39 +01:00
Anthony Ramine
8061d8c3d2 Fix some more WebGL methods 2018-03-23 01:23:39 +01:00
bors-servo
e5b606f6a4
Auto merge of #20389 - christianpoveda:issue_20350, r=jdm
getRandomValues uses ArrayBufferView now

<!-- Please describe your changes on the following line: -->

- Changed the `Crypto.webidl` file to allow getRandomValues to recieve an ArrayBufferView as input
- Removed unnecesary checks from `crypto.rs` and did the necessary changes to match the `webidl` changes.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #20350 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/20389)
<!-- Reviewable:end -->
2018-03-22 17:28:54 -04:00
bors-servo
f467bdce1b
Auto merge of #20132 - nakul02:issue_19223, r=jdm
Profiler for blocked IpcReceiver::recv()

<!-- Please describe your changes on the following line: -->

Implements feature #19223

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #19223 (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

WIP.
@jdm - this is the new profiler : "Blocked at IPC Receive"
Should I dig through all the calls to `ipc::channel` and replace them with this profiled `IpcReceiver`?

![screenshot from 2018-02-27 01-35-37](https://user-images.githubusercontent.com/5394361/36721061-b46edea4-1b5e-11e8-91d6-7faba742f237.png)

<!-- 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/20132)
<!-- Reviewable:end -->
2018-03-22 16:38:32 -04:00
Nakul Jindal
7d4e2b11e9 Implements profiler for blocked recv 2018-03-22 11:48:27 -07:00
Anthony Ramine
e34b19c42c Implement gl.getParameter(gl.VIEWPORT) 2018-03-22 19:17:36 +01:00
Anthony Ramine
cb6fa6e6b0 Implement gl.getParameter(gl.CURRENT_PROGRAM) 2018-03-22 19:17:35 +01:00
Anthony Ramine
f532e79dc1 Make some WebGL parameters non-optional (fixes #8753)
Those parameters aren't optional in the current spec.

The test element-array-buffer-delete-recreate.html now fails because we don't
actually implement gl.getParameter(gl.CURRENT_PROGRAM).
2018-03-22 19:17:35 +01:00
Anthony Ramine
3229c62282 Implement a missing INVALID_OPERATION check in DrawArrays 2018-03-22 18:51:58 +01:00
Anthony Ramine
2a9c2bc8fd Fix an off-by-one error with limits.max_vertex_attribs 2018-03-22 18:51:58 +01:00
Christian Poveda
723e03ef01 getRandomValues uses ArrayBufferView now 2018-03-22 12:12:16 -05:00
bors-servo
4aaac61a87
Auto merge of #20317 - gootorov:webgl-getFramebufferAttachmentParameter, r=jdm
Implement WebGL getFrameBufferAttachmentParameter API

<!-- Please describe your changes on the following line: -->
Implementation of `getFramebufferAttachmentParameter` as in WebGL1 specification.

Part of https://github.com/servo/servo/issues/10209.

r? emilio or jdm.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/20317)
<!-- Reviewable:end -->
2018-03-22 12:28:30 -04:00
Igor Gutorov
ee5bdbbd8b Implement WebGL getFramebufferAttachmentParameter API 2018-03-22 18:26:18 +02:00
bors-servo
1c2bed5a69
Auto merge of #20378 - Eijebong:parking_lot, r=jdm
Bump parking_lot to 0.5

<!-- 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/20378)
<!-- Reviewable:end -->
2018-03-21 14:16:57 -04:00
Bastien Orivel
f71e34ccab Bump parking_lot to 0.5 2018-03-21 18:19:29 +01:00
bors-servo
de04783fd9
Auto merge of #20370 - christianpoveda:issue_20348, r=jdm
Blobs support typed arrays now

<!-- Please describe your changes on the following line: -->
Blobs support typed arrays now, the relevant test were modified

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #20348 (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/20370)
<!-- Reviewable:end -->
2018-03-21 11:10:27 -04:00
Christian Poveda
3df9492dcf Blobs support typed arrays now 2018-03-21 09:29:24 -05:00
Bastien Orivel
570d865065 Bump ipc-channel and bincode
This required bumping uuid too which unfortunately duplicated rand.
2018-03-21 13:05:47 +01:00
Igor Gutorov
bdd53f35af Simplify GetShaderPrecisionFormat 2018-03-21 01:57:44 +02:00
Igor Gutorov
7e5160b79e Simplify BufferParameter 2018-03-20 21:24:10 +02:00
Igor Gutorov
0747853ad0 Simplify VertexAttribOffset 2018-03-20 21:08:28 +02:00
Igor Gutorov
431e3ddf8d Simplify GetTexParameter 2018-03-20 21:00:46 +02:00
CYBAI
aad6efa8f3 Update steps with new spec 2018-03-20 22:24:52 +08:00
CYBAI
65da9b5acb Make type argument as optional and ignore it in open method 2018-03-20 21:59:32 +08:00
bors-servo
23b6f569d0
Auto merge of #20314 - Xanewok:remove-heap-constructor, r=jdm
Don't use unsafe Heap::new constructor

<!-- Please describe your changes on the following line: -->
Pulls https://github.com/servo/rust-mozjs/pull/398 and aims to close https://github.com/servo/rust-mozjs/issues/343.

We can't convert from `JSVal` to `Heap<JSVal>` safely (due to GC barriers we can't move Heap value after changing its underlying value to something meaningful, e.g. non-null or non-undefined), so I decided to also wrap the Heap values in a Box (and in dictionaries in RootedTraceableBox, see https://github.com/servo/servo/pull/20265#issuecomment-372838379 and the issue for more details) in dictionaries.

Since we allocate more to be safe, I think it'd be good to also do some sort of a JS perf run, if there is any to see if there's any significant overhead.

r? @jdm

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because checking for not moving Heap after setting a value would require encoding a lot more info in type system (Heap) and I'm not sure how to do that and end up with an ergonomic and consistent API

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/20314)
<!-- Reviewable:end -->
2018-03-18 15:22:23 -04:00
Igor Matuszewski
64dc0c4b9e Root any members in dictionaries 2018-03-16 16:53:38 +01:00
Igor Matuszewski
760e0a5b57 Root JS object members in dictionaries 2018-03-16 16:53:30 +01:00
Igor Matuszewski
b49acf40ba Use mozjs 0.3 fork without Heap::new 2018-03-16 16:53:18 +01:00
Paul Rouget
e25dd45139 alias some euclid types 2018-03-16 14:34:29 +08:00