aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webgl2renderingcontext.rs
Commit message (Collapse)AuthorAgeFilesLines
* Move various reflector types and traits to script_bindings (#35279)Josh Matthews2025-02-041-1/+1
| | | | | | | | | | | | | * script: Move Reflector to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Extract global() helper from DomObject into new trait. Move DomObject and related traits to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* script: Feature-gate all crown support. (#35055)Josh Matthews2025-01-181-2/+2
| | | | | | | | | | | | | * script: Feature-gate all crown support. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Use cfg(crown) instead of a cargo feature. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Remove typedarray_elem_siz (#35022)Taym Haddadi2025-01-161-19/+6
| | | Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
* api: Flatten and simplify Servo preferences (#34966)Martin Robinson2025-01-141-1/+1
| | | | | | | | | | | | | | | | | | | Flatten and simplify Servo's preferences code. In addition, have both preferences and options passed in as arguments to `Servo::new()` and make sure not to use the globally set preferences in `servoshell` (as much as possible now). Instead of a complex procedural macro to generate preferences, just expose a very simple derive macro that adds string based getters and setters. - All command-line parsing is moved to servoshell. - There is no longer the concept of a missing preference. - Preferences no longer have to be part of the resources bundle because they now have reasonable default values. - servoshell specific preferences are no longer part of the preferences exposed by the Servo API. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* script: Limit public exports. (#34915)Josh Matthews2025-01-101-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Restrict reexport visibility of DOM types. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Mass pub->pub(crate) conversion. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Hide existing dead code warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix unit tests. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * More formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Add initial support for WebGL 2 BlitFramebuffer (#26389)Josh Matthews2025-01-061-0/+102
| | | | | | Add initial support for the WebGL2 BlitFramebuffer call. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Istvan <istvan.miklos@h-lab.eu>
* Add CanGc argument to reflect_dom_object (#34606)Domenico Rizzo2024-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | * applied mach fmt Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com> Refinements Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com> Modified reflect_dom_object signature and all its calls Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com> * fix function calls when parameter is passed up Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com> --------- Signed-off-by: Domenico Rizzo <domenico.rizzo@gmail.com>
* Filter out webidl files based on special comments, and feature-gate webxr ↵Josh Matthews2024-11-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | interfaces. (#34348) * Filter out webidl files based on skip-if directives. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Don't build XR functionality without webxr feature. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix tidy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Adjust imports for file movement. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Clean up webxr module import. Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com> Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net> Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
* Generate a trait abstracting over all known DOM interfaces (#34357)Josh Matthews2024-11-241-1/+1
| | | | | | | | | | | | | | | | | * script: Generate trait for all DOM interfaces and parameterize generated Methods traits over it. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Update trait implementations with new generic type. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Replace `sparkle` with `glow` in `components/canvas` (#33918)Samson2024-11-201-3/+7
| | | | | | | | | | | | | * Replace sparkle with glow in components/canvas Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Replace safe_gl with #34300 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Use out parameter for generated methods returning JSVal (#34087)Josh Matthews2024-11-051-145/+231
| | | | | | | | | | | | | | | | | | | | | * Make generated bindings that return a WebIDL `any` value use out parameters. Returning raw JSVal values makes it easier to create GC hazards in code that calls these methods. Accepting a MutableHandle argument instead ensures that the values are rooted by the caller. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Update mozjs. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Mark promise creation methods with CanGc (#33928)Josh Matthews2024-10-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add CanGc annotations to promise constructor. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Propagate CanGc arguments for Promise::new_in_current_realm. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix out-of-order entries. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Propagate CanGc from Promise::new. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Suppress clippy warning. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* More files with CanGc fixes (#33892)chickenleaf2024-10-181-3/+6
| | | | | | | | | | | | | * More files with CanGc fixes Signed-off-by: L Ashwin B <lashwinib@gmail.com> * removed the can_gc inside !task Signed-off-by: L Ashwin B <lashwinib@gmail.com> --------- Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* webgl: Update IDL exposed members (#33509)Daniel Adams2024-09-221-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update IDLs to expose on Workers Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update usage of Canvas/OffscreenCanvas union, add label Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update WPT expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> * Fix match arm Signed-off-by: Daniel Adams <msub2official@gmail.com> * Add missing spec links Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update interfaces.worker.js Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Replace .map_or(false with Option::is_some_and (#33468)Simon Wülker2024-09-161-4/+4
| | | Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Add makeXRCompatible for WebGL2, update WebXR WPT expectations (#33097)Daniel Adams2024-08-181-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add makeXRCompatible to WebGLRenderContextBase Signed-off-by: Daniel Adams <msub2official@gmail.com> * Activate webgl2 for webxr wpt, update meta expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update meta legacy layout expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> * Remove no longer existing expectations from meta files Signed-off-by: Daniel Adams <msub2official@gmail.com> * Remove files for fully passing tests Signed-off-by: Daniel Adams <msub2official@gmail.com> * Remove out-of-date expectations from meta legacy layout Signed-off-by: Daniel Adams <msub2official@gmail.com> * Update webgl conformance expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> * Fix test numbering in expectations Signed-off-by: Daniel Adams <msub2official@gmail.com> --------- Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Update mozjs (SpiderMonkey) to 128.0 (#32769)Samson2024-07-291-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update mozjs Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Fix changed readTransfer callback https://bugzilla.mozilla.org/show_bug.cgi?id=1842713 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Use NewExternalArrayBuffer from glue https://github.com/servo/mozjs/pull/474/commits/d33454be74ec5b8d8faf51fab3ed477b8913898b Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Fix columnorigin and filename being in latin1 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fixup newexternalarray Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Float16 (this might require more work for codegen support) https://bugzilla.mozilla.org/show_bug.cgi?id=1833647 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * js.strict is removed https://bugzilla.mozilla.org/show_bug.cgi?id=1621603 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * asm options are now somewhere else https://hg.mozilla.org/mozilla-central/rev/26045c88e3972957087d535e7f259e08857bd2a2 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Comment out offthread compilation Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Set NDK to 26 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Fix 1-origin handling Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Expect `FinalizationRegistry` interface Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Good expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * more expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Add `WeakRef` to interfaces expectation Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * mozjs upgrade: fixes for Android Android NDK's layout has changed in r26 and 'lib64' no longer exists under `toolchain/llvm/prebuilt/linux-x86_64`. The libraries that used to be it are now present in `lib` folder itself. This patch updates the build configuration to use the `lib` folder instead when configuring the LIBCLANG_PATH environment variable. This patch also updates to a newer mozjs version that includes fixes for linker errors faced on Android (see #32769). Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * Patch libz-sys & update mozjs Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * update NDK version in README Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * Use servo/mozjs Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Update mozjs again Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Fix more clippy (#32740)石蕊 (Pi-Cla)2024-07-091-12/+10
|
* Fixed some clippy warnings in components (#32107)komuhangi2024-04-191-2/+3
| | | | | | | * Fixed some clippy warnings in components * Updated handling of NaN values in comparison * Updated formatting using ./mach fmt
* script: Reduce the use of `unsafe` in LayoutDom (#31979)Martin Robinson2024-04-031-2/+2
| | | | | | | | | | | | | Remove the use of unsafe code in the layout wrappers of the DOM. The main change here is that `unsafe_get()` no longer needs to be an unsafe method, which allows us to transitively remove or reduce unsafe blocks from callers. The function itself is not renamed, because it's still a bit dangerous to start removing the layers of abstraction from actual DOM nodes. In addition `init_style_and_opaque_layout_data` can be merged into `initialize_data`, which removes one more unsafe method. Finally, a "Safety" section is added to some unsafe methods.
* clippy: Allow `too_many_arguments` for existing functions (#31974)eri2024-04-021-2/+1
| | | | | * Allow `too_many_arguments` for existing functions * fix: Surround ASCII with code block in rustdoc
* clippy: Fix let_and_return warnings (#31964)Oluwatobi Sofela2024-04-011-9/+6
|
* clippy: Allow `too_many_arguments` for all functions (#31962)komuhangi2024-04-011-0/+2
| | | | | This is the start of preventing this in the future. Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* fix: omitted the `let` bindings (#31908)Azhar Ismagulova2024-03-271-3/+2
|
* fixes dereferencing on an immutable reference (#31864)Aarya Khandelwal2024-03-261-1/+1
|
* clippy: Fix redundant field names warnings (#31793)Oluwatobi Sofela2024-03-201-1/+1
|
* clippy: Fix unneeded return statement warnings (#31776)Oluwatobi Sofela2024-03-201-4/+2
|
* clippy: Fix many warnings in `components/script` (#31717)Richard Dushime2024-03-191-27/+36
| | | | | | | | | | | | | | | | | * 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>
* clippy: Fix several warnings (#31710)RustAndMetal2024-03-181-5/+5
| | | Signed-off-by: RustAndMetal <111676747+RustAndMetal@users.noreply.github.com>
* rustdoc: Fix many rustdoc errors (#31147)Martin Robinson2024-01-221-222/+222
| | | | This fixes many rustdoc errors that occur due to raw URLs in rustdoc comments as well as unescaped Rust code that should be in backticks.
* Replace script_plugins with a clippy like rustc driver (named crown) (#30508)Samson2023-12-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove script_plugins * Use crown instead of script_plugins * crown_is_not_used * Use crown in command base * bootstrap crown * tidy happy * disable sccache * Bring crown in tree * Install crown from tree * fix windows ci * fix warning * fix mac libscript_plugins.dylib is not available anymore * Update components/script/lib.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> * Update for nightly-2023-03-18 Mostly just based off https://github.com/servo/servo/pull/30630 * Always install crown it's slow only when there is new version * Run crown test with `mach test-unit` * Small fixups; better trace_in_no_trace tests * Better doc * crown in config.toml * Fix tidy for real * no sccache on rustc_wrapper * document rustc overrides * fixup of compiletest * Make a few minor comment adjustments * Fix a typo in python/servo/platform/base.py Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com> * Proper test types * Ignore tidy on crown/tests --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-30/+35
| | | | | * strict imports formatting * Reformat all imports
* Update mozjs.Josh Matthews2021-02-181-1/+1
|
* webgl: Add stub isContextLost API.Josh Matthews2020-07-031-0/+5
|
* Add support for WebGL2 TexImage2DIstvan Miklos2020-06-181-4/+82
| | | | Adds initial support for one of the WebGL2 `TexImage2D` call.
* Implement GPUSwapChain and GPUCanvasContext and interface with WebrenderKunal Mohan2020-06-131-4/+3
|
* Add support for WebGL2 TexImage2DIstvan Miklos2020-05-261-1/+67
| | | | Adds initial support for one of the WebGL2 `TexImage2D` call.
* Add support for WebGL2 TexImage2DIstvan Miklos2020-05-211-4/+100
| | | | Adds initial support for one of the WebGL2 `TexImage2D` call.
* Auto merge of #26336 - szeged:mmatyas__webgl_fns_getparam4, r=jdmbors-servo2020-05-011-0/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for WebGL2 MIN_PROGRAM_TEXEL_OFFSET Improves the support of the WebGL2 `MIN_PROGRAM_TEXEL_OFFSET` property (ie. stores it as a signed integer) and adds support for querying it using GetParameter. See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2 <!-- Please describe your changes on the following line: --> cc @jdm @zakorgy Depends on #26333 because they touch the same test files. --- <!-- 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] 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. -->
| * Add support for WebGL2 MIN_PROGRAM_TEXEL_OFFSETMátyás Mustoha2020-04-301-0/+3
| | | | | | | | | | | | | | | | Improves the support of the WebGL2 `MIN_PROGRAM_TEXEL_OFFSET` property (ie. stores it as a signed integer) and adds support for querying it using GetParameter. See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2
* | Add support for WebGL2 TexStorage2DMátyás Mustoha2020-04-301-0/+76
|/ | | | | | | | Adds initial support for the WebGL2 `TexStorage2D` call, adds support for the related texture enums and enables some of the texture tests. See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.6
* Auto merge of #26354 - jdm:mmatyas__webgl_fns_getparam2, r=jdmbors-servo2020-04-291-17/+49
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for some more WebGL2 limit parameters Adds support for the following new WebGL2 GetParameter values: - `MAX_ELEMENT_INDEX` - `MAX_ELEMENTS_INDICES` - `MAX_ELEMENTS_VERTICES` - `MAX_FRAGMENT_INPUT_COMPONENTS` - `MAX_SAMPLES` - `MAX_SERVER_WAIT_TIMEOUT` - `MAX_TEXTURE_LOD_BIAS` - `MAX_VARYING_COMPONENTS` - `MAX_VERTEX_OUTPUT_COMPONENTS` See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2
| * Add support for some more WebGL2 limit parametersMátyás Mustoha2020-04-291-17/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds support for the following new WebGL2 GetParameter values: - `MAX_ELEMENT_INDEX` - `MAX_ELEMENTS_INDICES` - `MAX_ELEMENTS_VERTICES` - `MAX_FRAGMENT_INPUT_COMPONENTS` - `MAX_SAMPLES` - `MAX_SERVER_WAIT_TIMEOUT` - `MAX_TEXTURE_LOD_BIAS` - `MAX_VARYING_COMPONENTS` - `MAX_VERTEX_OUTPUT_COMPONENTS` See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2
* | Add support for WebGL2 buffer types in GetBufferParameterMátyás Mustoha2020-04-281-2/+4
| | | | | | | | | | This makes the new buffer types introduced in WebGL2 usable by the GetBufferParameter call.
* | Auto merge of #26289 - he4d:master, r=jdmbors-servo2020-04-241-9/+9
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced failible boolean with an enum <!-- Please describe your changes on the following line: --> Replaced the boolean `fallible` argument of some WebGL object methods with the new `enum Operation { Fallible, Infallible }` that was added to the `webglrenderingcontext`. This improves the readability of that methods. --- <!-- 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 #26047 (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because the issue says so <!-- 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. -->
| * | Replaced failible boolean with an enumTobias Tschinkowitz2020-04-231-9/+9
| | |
* | | webgl: Update IDL from upstream to avoid overloading issues.Josh Matthews2020-04-231-45/+46
|/ /
* / Fix InvalidateSubFramebuffer error handlingMátyás Mustoha2020-04-221-1/+1
|/ | | | | The WebGL2 InvalidateSubFramebuffer function should generate INVALID_VALUE when width or height is negative.
* Automatically enable WebGL 2 for specific domains.Josh Matthews2020-04-151-1/+22
|
* webgl: Only error when beginning transform feedback on programs that have no ↵Josh Matthews2020-04-081-1/+1
| | | | varying values.