Commit graph

451 commits

Author SHA1 Message Date
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
Imanol Fernandez
b9710a59b5 Associate bound WebGLTextures with texture units. 2017-09-28 18:52:29 +02:00
Anthony Ramine
f87c2a8d76 Rename Root<T> to DomRoot<T>
In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>,
where Root<T> will be able to handle all the things that need to be
rooted that have a stable traceable address that doesn't move for the
whole lifetime of the root. Stay tuned.
2017-09-26 09:49:10 +02:00
Anthony Ramine
577370746e Rename DOMRefCell<T> to DomRefCell<T>
I don't want to do such a gratuitous rename, but with all the other types
now having "Dom" as part of their name, and especially with "DomOnceCell",
I feel like the other cell type that we already have should also follow
the convention. That argument loses weight though when we realise there
is still DOMString and other things.
2017-09-26 09:49:08 +02:00
Anthony Ramine
e2dac78d36 Rename LayoutJS<T> to LayoutDom<T> 2017-09-26 09:49:04 +02:00
Anthony Ramine
c52fd0a780 Rename MutNullableJS<T> to MutNullableDom<T> 2017-09-26 09:49:02 +02:00
Anthony Ramine
7be32fb237 Rename JS<T> to Dom<T> 2017-09-26 09:48:55 +02:00
Anthony Ramine
0e3c54c191 Rename dom::bindings::js to dom::bindings::root 2017-09-26 02:19:05 +02:00
Imanol Fernandez
21f8b519c3 Reuse WebGL ImageKeys after a resize. 2017-08-31 22:54:33 +02:00
Imanol Fernandez
0a64455c71 Use FnvHashMap in WebGL implementation. 2017-08-24 22:18:34 +02:00
Imanol Fernandez
1dd3899c37 Implement WebGL OES_standard_derivatives extension. 2017-08-22 15:01:26 +02:00
Imanol Fernandez
712998b086 Fix bound textures and framebuffers when a WebGL Canvas is resized 2017-08-17 16:50:02 +02:00
Anthony Ramine
676f2c8acf Revert "Auto merge of #18114 - emilio:revert-webgl-refactor, r=nox"
This reverts commit 4d10d39e8f, reversing
changes made to ee94e2b7c0.
2017-08-16 23:23:18 +02:00
Emilio Cobos Álvarez
cfe22e3979
Revert "Auto merge of #17891 - MortimerGoro:webgl_move, r=glennw,emilio"
This reverts commit 90f55ea458, reversing
changes made to 2e60b27a21.
2017-08-16 16:42:13 +02:00
Imanol Fernandez
703962fe61 Improve WebGL architecture. 2017-08-15 22:14:32 +02:00
Simon Sapin
b5a4b8d6a0 Upgrade to rustc 1.21.0-nightly (13d94d5fa 2017-08-10) 2017-08-15 14:10:44 +02:00
Paul Rouget
d241389129 make use of ScriptToConstellationChan 2017-08-15 08:22:09 +02:00
Martin Robinson
e58e8ab42e Upgrade to the latest version of WebRender 2017-07-13 07:44:08 +10:00
Simon Sapin
7af5a7fd54 Untry script 2017-06-18 13:21:49 +02:00
Glenn Watson
e7b1e041c8 Update WR (CPU text optimizations, image format renames). 2017-06-16 15:27:22 +10:00
Nicolas Silva
8617320500 Bump euclid to 0.14. 2017-06-14 16:00:59 +02:00