Commit graph

54 commits

Author SHA1 Message Date
YUAN LYU
3ea6d87bcc
Add trait DomObjectWrap to provide WRAP function 2020-03-20 22:16:56 -04:00
Simon Sapin
bea73951db Use #![register_tool] instead of #![register_attr]
CC https://github.com/rust-lang/rust/issues/66079
2019-11-15 17:24:42 +01:00
Josh Matthews
c312646c24 webgl: Always convert float/half-float-based types to internal texture types. 2019-10-29 18:29:07 -04:00
Josh Matthews
1cefae7181 Replace use of gleam in webgl with sparkle. 2019-09-11 11:40:04 -04:00
Josh Matthews
dbaed5ed92 Make GL/GLES decisions based on the API in use. 2019-07-12 13:36:44 -04:00
Mátyás Mustoha
7f0b820d4e Add initial support for WebGL compressed textures 2019-05-21 16:56:40 -04:00
Simon Sapin
be69f9c3e6 Rustfmt has changed its default style :/ 2018-12-28 13:17:47 +01:00
Jan Andre Ikenmeyer
a1a14459c1
Update MPL license to https (part 3) 2018-11-19 14:47:12 +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
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
Josh Matthews
e31462c37c Implement WEBGL_color_buffer_float and EXT_color_buffer_half_float (fixes #22113) 2018-11-05 14:13:46 +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
chansuke
c37a345dc9 Format script component 2018-09-19 17:40:47 -04:00
Anthony Ramine
0579fbe4fa Use WebGLResult for returns of instanced draw methods 2018-09-06 10:41:58 +02:00
bors-servo
bde8a1e239
Auto merge of #21313 - jdm:glstuff, r=nox
Framebuffer and renderbuffer fixes

This commits address two separate panics that occur when running the framebuffer-object-attachment.html test. The test still panics due to another framebuffer completion status problem, so the overall test results don't demonstrate any improvement.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #21252
- [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/21313)
<!-- Reviewable:end -->
2018-08-02 09:26:35 -04:00
Anthony Ramine
fba6d801a1 Always use a WebGLVertexArrayObject to handle vertex attribs
This lets us clean up how buffers are reference-counted.
2018-08-02 12:46:19 +02:00
Josh Matthews
03eb7e4dd2 webgl: Emulate some renderbuffer formats in non-GLES. 2018-08-02 02:05:53 -04:00
Anthony Ramine
661e258b28 Store a reference to the WebGLRenderingContext in WebGLObject 2018-07-24 13:27:33 +02:00
Anthony Ramine
4e6eea221a Implement instanced WebGL drawing calls (part of #20791) 2018-07-08 10:44:45 +02:00
Anthony Ramine
0814bd6699 Rename VertexAttribs::set_from to VertexAttribs::clone_from 2018-07-05 14:20:47 +02:00
Anthony Ramine
f108a3e797 Introduce VertexAttribData 2018-07-05 14:20:47 +02:00
Anthony Ramine
5d43f1c9bd Rename BoundAttribBuffers to VertexAttribs and make it store a slice 2018-07-05 14:20:44 +02:00
Anthony Ramine
02b8766e75 Implement EXT_blend_minmax 2018-06-22 14:10:56 +02:00
Anthony Ramine
124fe69818 Properly enable EXT_shader_texture_lod 2018-06-22 12:20:22 +02:00
Anthony Ramine
fc3dd7cefc Implement checks for vertex attribs enabled as arrays without a bound buffer 2018-06-20 15:59:06 +02:00
Anthony Ramine
c7603bd4ca Don't check for GL_OES_element_index_unit with desktop GL (fixes #20921) 2018-06-12 12:33:32 +02:00
Anthony Ramine
f1288cc6e0 Implement EXT_texture_filter_anisotropic 2018-06-06 12:24:47 +02:00
Anthony Ramine
4e5e1e6c33 Implement EXT_shader_texture_lod 2018-06-04 16:33:05 +02:00
Anthony Ramine
b523267349 Move WebGLVertexArrayObjectOES to script::dom
It's not a WebGL extension itself, it's just used by one.
2018-05-24 12:12:23 +02:00
Anthony Ramine
54f88b5eaf Add OESElementIndexUint to WebGLExtensions::register_all_extensions 2018-05-24 12:09:58 +02:00
Anthony Ramine
838d1305ca Implement OES_element_index_uint (fixes #20384) 2018-03-23 02:47:39 +01:00
Simon Sapin
52eda6082f Replace NonNullJSObjectPtr with std::ptr::NonNull<JSObject> 2018-01-22 17:41:25 +01:00
Imanol Fernandez
f2f5817f56 Add support for filtering WebGL extensions based on WebGL version 2017-10-31 21:38:39 +01: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
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
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
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
4f35e82cf5 Fix texture_float and texture_half_float detection on some GPUs 2017-09-05 18:24:59 +02:00
Imanol Fernandez
0a64455c71 Use FnvHashMap in WebGL implementation. 2017-08-24 22:18:34 +02:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Imanol Fernandez
1dd3899c37 Implement WebGL OES_standard_derivatives extension. 2017-08-22 15:01:26 +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