Commit graph

471 commits

Author SHA1 Message Date
Anthony Ramine
e7f716de12 Fix the emitted error for invalid targets in WebGLRenderingContext::BufferData_ 2018-04-04 13:12:41 +02:00
Anthony Ramine
235a7b80c9 Introduce WebGLRenderingContext::bound_buffer 2018-04-04 13:12:40 +02:00
Anthony Ramine
605da95076 Improve WebGLBuffer::buffer_data
It now checks the usage argument itself and use generics for the data vector.
2018-04-04 13:12:39 +02:00
Anthony Ramine
866a523914 Properly use Float32List and Int32List for WebGL uniform methods 2018-04-03 12:22:32 +02:00
Anthony Ramine
088ebcb095 Remove obsolete BufferDataSource 2018-04-03 11:15:54 +02:00
Anthony Ramine
a82164d8a5 Clean up signature of some fallible WebGL methods 2018-04-03 10:51:26 +02:00
Anthony Ramine
ce81420bef Use ByteBuf for the canvas messages
The type Vec<u8> is super unefficient to work with in Serde if all you want
to represent is a simple blob.
2018-03-26 20:48:02 +02:00
Emilio Cobos Álvarez
c2f8b0468a
Update mozjs. 2018-03-25 00:04:43 +01:00
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
Igor Matuszewski
80c6891f33 Use safe to_vec() for typed arrays in WebGL bindings 2018-03-23 19:37:25 +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
Anthony Ramine
a77d35b60c Implement HTMLCanvasElement.toDataURL for WebGL canvas (fixes #19147) 2018-03-23 17:32:42 +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
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
Igor Gutorov
ee5bdbbd8b Implement WebGL getFramebufferAttachmentParameter API 2018-03-22 18:26:18 +02: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
Igor Matuszewski
e025bbb079 WIP: Accept typed array arguments in codegen 2018-03-14 18:43:26 +01:00
Emilio Cobos Álvarez
21df4014db
constellation: Make setting up the WebGL state fallible.
This fixes a regression caused by the glutin update.

We now are creating EGL contexts in Linux Wayland, instead of X context, so the
GLContextFactory assumption of one GL back-end per platform is broken.

This just works around it, for now, but in general I think not relying on
available WebGL state is a good thing, and we do that already for WebVR anyway.
2018-03-09 23:27:29 +01:00
Martina Kollarova
288ef50fb7 Add WebGL function glGetTexParameter
Set the expected result of the test `tex-input-validation.html` to CRASH, since
that is caused by unrelated problems. The test was previously not executing
completely, because it stopped when it didn't find the implementation of
getTexParameter.
2018-03-06 15:28:10 +02:00
Simon Sapin
52eda6082f Replace NonNullJSObjectPtr with std::ptr::NonNull<JSObject> 2018-01-22 17:41:25 +01:00
Imanol Fernandez
c22674481b Set the correct Angle GLSL output when using WebGL 2 2017-11-13 14:58:06 +01:00
bors-servo
63af764fc5 Auto merge of #19040 - MortimerGoro:webgl2_extensions, r=emilio
Add support for filtering WebGL extensions based on WebGL version

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

Add support for filtering WebGL extensions based on WebGL version

---
<!-- 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 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/19040)
<!-- Reviewable:end -->
2017-10-31 16:14:59 -05:00
Imanol Fernandez
f2f5817f56 Add support for filtering WebGL extensions based on WebGL version 2017-10-31 21:38:39 +01:00
Bastien Orivel
29b4eec141 Bump bitflags to 1.0 in every servo crate 2017-10-30 23:36:06 +01:00
Imanol Fernandez
ddd6c86e99 Kick off WebGL 2.0 implementation 2017-10-27 12:53:11 +02:00
Gecko Backout
11c64178d8 Backed out changeset e64e659c077d: servo PR #18809 and revendor for reftest failures, e.g. in layout/reftests/bugs/392435-1.html. r=backout on a CLOSED TREE
Backs out https://github.com/servo/servo/pull/18809
2017-10-19 21:26:51 +00:00
Bastien Orivel
e8e2d0a4b2 Update bitflags to 1.0 in every servo crate
It still needs dependencies update to remove all the other bitflags
versions.
2017-10-19 15:01:17 +02:00
Nicholas Nethercote
4506f0d30c Replace all uses of the heapsize crate with malloc_size_of.
Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`.
`malloc_size_of` is better -- it handles various cases that `heapsize` does not
-- so this patch changes Servo to use `malloc_size_of`.

This patch makes the following changes to the `malloc_size_of` crate.

- Adds `MallocSizeOf` trait implementations for numerous types, some built-in
  (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`).

- Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't
  support that operation.

- For `HashSet`/`HashMap`, falls back to a computed estimate when
  `enclosing_size_of_op` isn't available.

- Adds an extern "C" `malloc_size_of` function that does the actual heap
  measurement; this is based on the same functions from the `heapsize` crate.

This patch makes the following changes elsewhere.

- Converts all the uses of `heapsize` to instead use `malloc_size_of`.

- Disables the "heapsize"/"heap_size" feature for the external crates that
  provide it.

- Removes the `HeapSizeOf` implementation from `hashglobe`.

- Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of`
  doesn't derive those types, unlike `heapsize`.
2017-10-18 22:20:37 +11:00
bors-servo
e8a6f2862c Auto merge of #18875 - servo:stable-js, r=nox,jdm
Remove the need for rust-mozjs to use unstable Rust 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/18875)
<!-- Reviewable:end -->
2017-10-16 17:07:50 -05:00
Imanol Fernandez
8ae0739bab Implement DOM to texture 2017-10-16 20:56:53 +02:00
Simon Sapin
a819cfb0fa Replace uses of libcore with libstd in components/script 2017-10-16 20:19:59 +02:00
Simon Sapin
e2fafd2dfc Replace NonZero<*mut JSObject> with a wrapper to enable local trait impls. 2017-10-16 20:19:56 +02:00
Simon Sapin
aa15dc269f Remove use of unstable box syntax.
http://www.robohornet.org gives a score of 101.36 on master,
and 102.68 with this PR. The latter is slightly better,
but probably within noise level.
So it looks like this PR does not affect DOM performance.

This is expected since `Box::new` is defined as:

```rust
impl<T> Box<T> {
    #[inline(always)]
    pub fn new(x: T) -> Box<T> {
        box x
    }
}
```

With inlining, it should compile to the same as box syntax.
2017-10-16 17:16:20 +02:00