Commit graph

90 commits

Author SHA1 Message Date
Oluwatobi Sofela
2789e98876
clippy: Fix redundant field names warnings (#31793) 2024-03-20 23:05:29 +00:00
Richard Dushime
01ca220f83
clippy: Fix many warnings in components/script (#31717)
* Fix Several clippy warnings

* Fix Build errors

* Fix Unused import

* Fix requested changes

* Fix rustfmt

* Minor fixes

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-19 16:05:56 +00:00
Samson
aad2dccc9c
Strict import formatting (grouping and granularity) (#30325)
* strict imports formatting

* Reformat all imports
2023-09-11 19:16:54 +00:00
Samson
9514f670d1
No tracing of nop traceable fields (#29926)
* Add `no_trace` option to JSTraceable derive

* NoTrace wrapper

* Port some types to no_trace schematics

* Fixing my unsafe mistakes (not tracing traceables)

* Add docs & safety guards for no_trace

Safety guards (trait shenanigans) guarantees safety usage of `no_trace`

* Port canvas_traits to no_trace

* Port servo_media to no_trace

* Port net_traits to no_trace

* Port style to no_trace

* Port webgpu to no_trace

* Port script_traits to no_trace

* Port canvas_traits, devtools_traits, embedder_traits, profile_traits to no_trace

* unrooted_must_root lint in seperate file

* Add trace_in_no_trace_lint as script_plugin

* Composable types in must_not_have_traceable

* Introduced HashMapTracedValues wrapper

* `HashMap<NoTrace<K>,V>`->`HashMapTracedValues<K,V>`

* Port rest of servo's types to no_trace

* Port html5ever, euclid, mime and http to no_trace

* Port remaining externals to no_trace

* Port webxr and Arc<Mutex<_>>

* Fix spelling in notrace doc
2023-08-04 10:17:43 +00:00
Tobias Tschinkowitz
9c343fcc96 Replaced failible boolean with an enum 2020-04-23 18:23:01 +02:00
Josh Matthews
66b2b3293d webgl: Fix active uniform block length check. 2020-04-07 16:16:05 -04:00
Istvan
bfa43fbeba Add support for DrawRangeElements in WebGL2
Adds initial support for the WebGL2 `DrawRangeElements` call.
2020-03-30 13:55:01 +02:00
YUAN LYU
3ea6d87bcc
Add trait DomObjectWrap to provide WRAP function 2020-03-20 22:16:56 -04:00
Mátyás Mustoha
ced67af6b2 Add support for WebGL2 GetFragDataLocation
Adds support for the `GetFragDataLocation` WebGL2 call.

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.7
2020-03-09 12:59:30 +01:00
Mátyás Mustoha
da94f8d0e7 Add initial support for WebGL2 uniform buffer functions
Adds initial support for the following WebGL2 calls:

- bindBufferBase
- bindBufferRange
- getUniformIndices
- getUniformBlockIndex
- getActiveUniforms
- getActiveUniformBlockParameter
- getActiveUniformBlockName
- uniformBlockBinding

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.16
2020-01-09 11:17:50 +01:00
Kunal Mohan
02c1612cb0
Add accountable-refcell as optional build time feature 2020-01-08 09:44:41 +05:30
Istvan Miklos
4f112b1705 Add Support for WebGL Transormfeedback
Reference: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.15
2019-11-08 15:22:52 +01:00
Patrick Walton
a358bca766 Use surfman for managing GL surfaces
Co-authored-by: Alan Jeffrey <ajeffrey@mozilla.com>
Co-authored-by: Zakor Gyula <gyula.zakor@h-lab.eu>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2019-11-01 08:47:11 -05:00
Josh Matthews
8f5c37c0b5 Don't panic if WebGL thread can't be reached during finalization. 2019-07-29 10:09:24 -04:00
Christopher Burgos
bae975258d update link_called when link function called. 2019-07-23 12:03:24 -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
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
Anthony Ramine
60c93cfabe Validate GLSL names (fixes #21287) 2018-09-20 15:00:47 +02:00
Anthony Ramine
a3d8b5d2d3 Fix the error when calling getProgramInfoLog on a deleted program (#20561) 2018-09-20 11:31:54 +02:00
chansuke
c37a345dc9 Format script component 2018-09-19 17:40:47 -04:00
Anthony Ramine
a0fc4c9832 Fix program and shader lifetime cycle 2018-07-31 11:12:40 +02:00
Anthony Ramine
6af2ce79a2 Remove an obsolete todo in gl.attachShader()
Attaching the same shader twice should indeed emit an InvalidOperation error.
2018-07-31 00:28:14 +02:00
Anthony Ramine
661e258b28 Store a reference to the WebGLRenderingContext in WebGLObject 2018-07-24 13:27:33 +02:00
Anthony Ramine
b64232d77b Invalidate all WebGLUniformLocation values on program relink 2018-07-19 11:34:04 +02:00
Anthony Ramine
8fabc6660a Correctly reset active uniforms on link 2018-07-19 11:34:04 +02: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
Anthony Ramine
fc0e403fb0 Implement attribute aliasing check (fixes #21136) 2018-07-09 15:27:49 +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
0f91712800 Update to gleam 0.5 2018-05-05 13:08:36 +02:00
Anthony Ramine
f837354cb7 Do not emit a WebGL error for "gl_" prefixed names in gl.getAttribLocation 2018-04-09 15:52:56 +02:00
Anthony Ramine
561c41097f Fix filtering of reserved WebGL names in gl.getAttribLocation 2018-04-09 14:44:02 +02:00
Anthony Ramine
a62bed82e4 Implement WebGLRenderingContextBase.getAttachedShaders 2018-03-24 13:58:07 +01:00
Simon Sapin
67d983cb12 Switch from servo/angle to the mozangle crate
https://github.com/servo/mozangle
2018-03-12 14:23:20 +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
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
c52fd0a780 Rename MutNullableJS<T> to MutNullableDom<T> 2017-09-26 09:49:02 +02:00
Anthony Ramine
0e3c54c191 Rename dom::bindings::js to dom::bindings::root 2017-09-26 02:19:05 +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
Martin Robinson
e58e8ab42e Upgrade to the latest version of WebRender 2017-07-13 07:44:08 +10:00
Anthony Ramine
31e9d81c0f Make #[dom_struct] a proc_macro attribute 2017-02-24 01:50:51 +01:00
Anthony Ramine
1327ebd52f Remove HeapGCValue
It could be used to have mutable JSVal fields without GC barriers.
With the removal of that trait, MutHeap and MutNullableHeap can respectively
be replaced by MutJS and MutNullableJS.
2016-12-12 10:47:54 -10:00
Corey Farwell
449f6337d4 Rename Reflectable to DomObject.
Fixes https://github.com/servo/servo/issues/8473.
2016-12-08 08:50:35 -10:00