aboutsummaryrefslogtreecommitdiffstats
path: root/components/canvas/webgl_thread.rs
Commit message (Collapse)AuthorAgeFilesLines
* Replace `sparkle` with `glow` in `components/canvas` (#33918)Samson2024-11-201-660/+881
| | | | | | | | | | | | | * 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>
* feat: `webxr` feature flag (#34241)Ngo Iok Ui (Wu Yu Wei)2024-11-131-341/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add webxr feature flag Add webxr feature flag to embedder_traits Add webxr flag to constellation Add webxr flag to compositor Add webxr flag to canvas Turn registry into optional Add webxr flag to servo lib Signed-off-by: Wu Yu Wei <yuweiwu@pm.me> Co-authored-by: august kline <me@augustkline.com> * Cargo fmt Signed-off-by: Wu Yu Wei <yuweiwu@pm.me> * Add missing license Signed-off-by: Wu Yu Wei <yuweiwu@pm.me> * Cargo clippy Signed-off-by: Wu Yu Wei <yuweiwu@pm.me> --------- Signed-off-by: Wu Yu Wei <yuweiwu@pm.me> Co-authored-by: august kline <me@augustkline.com>
* remove sparkle from components/servo (#33910)Samson2024-10-191-12/+12
| | | | | | | | | | | | | * replace sparkle's GlType with canvas_traits's GlType Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * remove sparkle from components/servo Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Update to surfman&webxr without sparkle and use glow 0.15 (#33538)Samson2024-10-181-5/+18
| | | Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Move unmultiply_inplace to pixels crate (#33553)Taym Haddadi2024-09-271-10/+1
| | | Signed-off-by: Taym <haddadi.taym@gmail.com>
* ohos: Enable Webgl context creation on OH 5.0 (#33257)Jonathan Schwender2024-09-021-2/+0
| | | | | | | | | | | | | * ohos: Enable Webgl context creation on OH 5.0 Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Bump surfman to 0.9.8 Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> --------- Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* fix clippy warning for clamp pattern in `webgl_thread` (#33230)Callum Leslie2024-08-281-2/+2
| | | Signed-off-by: Callum Leslie <git@cleslie.uk>
* clippy: Fix various clippy warnings throughout the code (#33003)Ashwin Naren2024-08-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * replace u64::max_value() with u64::MAX Signed-off-by: Ashwin Naren <arihant2math@gmail.com> * removed redundant import Signed-off-by: Ashwin Naren <arihant2math@gmail.com> * Fixed dereference Signed-off-by: Ashwin Naren <arihant2math@gmail.com> * Fixed a probable bug Signed-off-by: Ashwin Naren <arihant2math@gmail.com> * fixed imports Signed-off-by: Ashwin Naren <arihant2math@gmail.com> * fixed dereference Signed-off-by: Ashwin Naren <arihant2math@gmail.com> * dereference formatting Signed-off-by: Ashwin Naren <arihant2math@gmail.com> * removed unnessicary number imports Signed-off-by: Ashwin Naren <arihant2math@gmail.com> * removed unnessicary number imports Signed-off-by: Ashwin Naren <arihant2math@gmail.com> * removed excess borrow Signed-off-by: Ashwin Naren <arihant2math@gmail.com> * ran mach fmt Signed-off-by: Ashwin Naren <arihant2math@gmail.com> * fixed doc comment Signed-off-by: Ashwin Naren <arihant2math@gmail.com> * removed deref on an immutable reference Signed-off-by: Ashwin Naren <arihant2math@gmail.com> * fixed minor syntax error Signed-off-by: Ashwin Naren <arihant2math@gmail.com> * reverted clamping Signed-off-by: Ashwin Naren <arihant2math@gmail.com> * formatting Signed-off-by: Ashwin Naren <arihant2math@gmail.com> * reverted final clamp Signed-off-by: Ashwin Naren <arihant2math@gmail.com> --------- Signed-off-by: Ashwin Naren <arihant2math@gmail.com> Co-authored-by: Ashwin Naren <ashwin@pixelators.org>
* Fix panic in Webrender during shutdown (#32897)Taym Haddadi2024-08-061-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix panic in webrender during shutdown Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Pass webgl_threads_sender to WebGLThreads::exit Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * follow the naming convention and use sender instead of webgl_threads_sender Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Avoid deadlock when webgl_threads is None Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Use tuple matching for webgl_threads and webgl_threads_receiver Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Remove unused _webgl_threads_sender Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
* Remove the WebXR dependency on ancient `time@0.1` crate (#32862)Martin Robinson2024-07-261-13/+0
| | | | | | | | | | | `webxr` depends on a very old verison of `time`, which allowed serializing monotonic clock output. This isn't possible on all platforms, so newer versions of `time` do not allow this. In order to stop using the old 0.1 versions of `time` we have to stop relying on times passed from `webxr` to Servo. This change does that, at the cost of removing the XR profiling feature. It has to be rewritten in another way in the `webxr` crate. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Add OpenHarmony support to servoshell (#32594)Jonathan Schwender2024-06-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Generate EGL bindings for ohos Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Adjust servoshell `bin` error message for android/ohos Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * ohos: disable WebGL offscreen buffers are not implemented yet on ohos. Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Add OpenHarmony support to servoshell Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Share ResourceReaderInstance Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Share android/ohos HostTrait Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Share servo glue Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com> * Pass Init options from ArkTS to Servo Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * f rebase ResourceReaderMethods Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * fixup! Share ResourceReaderInstance Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Fix typo Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Update Cargo.lock Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * ohos: Move WebGL check to webgl thread Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Remove commented code Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> * Remove commented and duplicate / unused code Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> --------- Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com> Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* clippy: fix `result_unit_err` warnings (#31791)eri2024-03-211-4/+4
| | | | | | | | | | | | | | | | | * clippy: fix `result_unit_err` warnings * feat: fix result warnings in script * doc: document `generate_key` return type Co-authored-by: Martin Robinson <mrobinson@igalia.com> * feat: add back result to RangeRequestBounds::get_final Co-authored-by: Martin Robinson <mrobinson@igalia.com> --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* clippy: Fix assorted warnings in `components/` (#31628)eri2024-03-131-3/+5
| | | | | | | * clippy: fix assorted warnings in `components/` * fix: new and default * fix: review comments
* clippy: fix some warnings in components/canvas (#31563)eri2024-03-081-36/+36
|
* rustdoc: Fix many rustdoc errors (#31147)Martin Robinson2024-01-221-1/+1
| | | | 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.
* Temporarily convert existing cfg(debug_assertions) crashes to warnings (#30578)Delan Azabani2023-10-181-3/+6
|
* Fix webgl regression after WebRender upgrade (#30390)Mukilan Thiyagarajan2023-09-201-26/+22
| | | | | | | | | | | | | | | | | Sending WebRender an explicit ResourceUpdate message after every buffer swap invalidates the tile caches that depend on the image resource created for the webgl canvas. The previous WebRender code that Servo was using might have worked with WebGL only accidentally since picture caching was disabled by [default][1] and so the tiles were not cached between frames. Fixes #30367 [1]: https://github.com/servo/servo/blob/c385b3c9737c17d59cb02e520c3b68b232cb6497/third_party/webrender/webrender/src/renderer.rs#L7073 Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-62/+29
| | | | | * strict imports formatting * Reformat all imports
* Upgrade WebRender to e491e1ae637b2eed1e7195855d88357e5eb3ddf9 (#30323)Martin Robinson2023-09-101-15/+19
| | | | | | | | | | | | | | | | | | * Upgrade vendored version of WebRender * Patch WebRender: upgrade version of gleam * Restore hit testing implementation * Fix WebRender warnings * Adapt Servo to new WebRender * Update results * Add a workaround for #30313 This slightly expands text boundaries in order to take into account the fact that layout isn't measuring glyph boundaries.
* remove `extern crate` (#30311)Samson2023-09-081-0/+2
| | | | | | | | | | | * remove extern crate * Update components/script_plugins/lib.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Remove dependency on surfman-chains (#30090)Martin Robinson2023-08-111-15/+7
| | | This functionality is now part of surfman itself.
* Try to `use` WebRender types moreMartin Robinson2023-07-101-38/+40
| | | | | The newer versions of WebRender move types around between `webrender` and `webrender_api` and this will reduce the churn during the upgrade.
* Remove the DOMToTexture featureMartin Robinson2023-06-271-97/+0
| | | | | | | | | | | This relies on WebRender's frame output API, `set_output_image_handler`, which has been removed from the latest upstream [1]. It's sad to remove this feature, which was probably a lot of work to implement, but it seems difficult to patch WebRender to restore this functionality. Fixes #29936. 1. https://hg.mozilla.org/mozilla-central/rev/361521e3c52324809553c555fb066d50f023d9bf
* Bump euclid to 0.22Martin Robinson2023-01-261-1/+1
| | | | | | | | | | | | | - Also updates raqote to latest with an upgrade of font-kit to 0.11 applied on as a patch - Update lyon_geom to the latest version Major change: - All matrices are now stored in row major order. This means that parameters to rotation functions no longer should be negated. - `post_...()` functions are now named `then()`. `pre_transform()` is removed, so `then()` is used and the order of operations changed.
* feat: shorten thread namesyvt2021-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Linux kernel imposes a 15-byte limit on thread names[1]. This means information that does not fit in this limit, e.g., the pipeline ID of layout and script threads, is lost in a debugger and profiler (see the first column of the table below). This commit shortens the thread names used in Servo to maximize the amount of information conveyed. It also rectifies some inconsistencies in the names. | Before | After | |-------------------|-------------------| | `BluetoothThread` | `Bluetooth` | | `CanvasThread` | `Canvas` | | `display alert d` | `AlertDialog` | | `FontCacheThread` | `FontCache` | | `GLPlayerThread` | `GLPlayer` | | `HTML Parser` | `Parse:www.examp` | | `LayoutThread Pi` | `Layout(1,1)` | | `Memory profiler` | `MemoryProfiler` | | `Memory profiler` | `MemoryProfTimer` | | `OfflineAudioCon` | `OfflineACResolv` | | `PullTimelineMar` | `PullTimelineDat` | | `ScriptThread Pi` | `Script(1,1)` | | `WebWorker for h` | `WW:www.example.` | | `ServiceWorker f` | `SW:www.example.` | | `ServiceWorkerMa` | `SvcWorkerManage` | | `Time profiler t` | `TimeProfTimer` | | `Time profiler` | `TimeProfiler` | | `WebGL thread` | `WebGL` | | `Choose a device` | `DevicePicker` | | `Pick a file` | `FilePicker` | | `Pick files` | `FilePicker` | [1]: https://stackoverflow.com/questions/5026531/thread-name-longer-than-15-chars
* Fix deprecation warnings.Josh Matthews2020-11-121-11/+11
|
* webgl: Support preserveDrawingBuffer.Josh Matthews2020-08-061-13/+21
|
* Support depth and stencil in webxrAlan Jeffrey2020-07-101-16/+19
|
* Support for webxr layer managementAlan Jeffrey2020-06-281-200/+427
|
* Auto merge of #26787 - szeged:texi2d_3, r=jdmbors-servo2020-06-181-2/+26
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for WebGL2 TexImage2D Adds initial support for one of the WebGL2 `TexImage2D` call. I've enabled the `tests/wpt/webgl/tests/deqp/` tests. --- <!-- 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 part of #26512 - [x] There are tests for these changes @mmatyas @zakorgy @jdm <!-- 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 TexImage2DIstvan Miklos2020-06-181-2/+26
| | | | | | | | Adds initial support for one of the WebGL2 `TexImage2D` call.
* | blockingly shut-down webrender when exiting webgl_threadGregory Terzian2020-06-171-10/+8
|/
* Proxy all WR interactions for layout/font/script/canvas threads to the ↵Josh Matthews2020-06-091-4/+4
| | | | | | | compositor thread. There is now a single RenderApi that is used, and all transactions are serialized through the compositor.
* Convert all uses of UpdateResources api to use webrender transactions.Josh Matthews2020-05-111-3/+11
|
* webgl: Return TEXTURE_IMMUTABLE_FORMAT as a boolean; don't panic on macOS ↵Josh Matthews2020-04-301-0/+5
| | | | for TEXTURE_IMMUTABLE_LEVELS.
* webgl: Add missing RGB8 texture format combination.Josh Matthews2020-04-301-1/+2
|
* webgl: Fix tidyMátyás Mustoha2020-04-301-8/+4
|
* webgl: Fix support for float/half-float texture formats.Josh Matthews2020-04-301-11/+22
|
* Add support for WebGL2 TexStorage2DMátyás Mustoha2020-04-301-3/+20
| | | | | | | | 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
* Update surfman to 0.2 and remove glutinAlan Jeffrey2020-04-171-142/+300
|
* Auto merge of #26147 - jdm:linewidth, r=noxbors-servo2020-04-141-1/+7
|\ | | | | | | | | | | | | | | Avoid GL errors with LineWidth commands - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #26139
| * webgl: Avoid GL errors with LineWidth commands.Josh Matthews2020-04-081-1/+7
| |
* | Remove assertion for negative value from get_uniform_locationDaniel Alley2020-04-091-1/+0
| | | | | | | | closes #26150
* | Auto merge of #26136 - asajeffrey:goodbye-webvr, r=Manishearthbors-servo2020-04-081-17/+0
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove WebVR <!-- Please describe your changes on the following line: --> Removes support for WebVR. WebXR is our future! --- <!-- 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 do not require tests because how do you test <!-- 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. -->
| * Remove WebVRAlan Jeffrey2020-04-081-17/+0
| |
* | Add initial support for VertexAttribI4*, VertexAttribIPointerIstvan2020-04-071-1/+6
|/ | | | Adds initial support for the WebGL2 `VertexAttribI4i`, `VertexAttribI4iv`, `VertexAttribI4ui`, `VertexAttribI4uiv` and `VertexAttribIPointer` calls.
* Add support for DrawRangeElements in WebGL2Istvan2020-03-301-0/+1
| | | | Adds initial support for the WebGL2 `DrawRangeElements` call.
* Add support for WebGL2 read and draw buffer settingsMátyás Mustoha2020-03-161-0/+2
| | | | | | | | | | | Adds support for the `ReadBuffer` and `DrawBuffers` WebGL2 calls and the related parameter getters. See: - https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.2 - https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.4 - https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.11
* Add support for some more WebGL2 renderbuffer functionsMátyás Mustoha2020-03-131-0/+31
| | | | | | | | | Adds support for the following WebGL2 calls: - `RenderbufferStorageMultisample` - `GetInternalFormativ` See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.5
* Auto merge of #25855 - jdm:surface-inversion, r=Manishearth,asajeffreybors-servo2020-03-091-54/+53
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove GL->d3d blit in HoloLens immersive mode Depends on: * https://github.com/servo/surfman/pull/151 * https://github.com/asajeffrey/surfman-chains/pull/7 * https://github.com/servo/webxr/pull/133 These changes add two extra APIs for embedders to use when registering a WebXR device - one to allow running any closure as a task in the webgl thread, and one to register an arbitrary surface provider for a particular webxr session. When an openxr session is started, it can then obtain the webgl thread's d3d device from that thread's surfman device and ensure that openxr uses it. Surface providers are traits that have their methods invoked by the webgl thread as part of the the normal swapchain operations. This allows the openxr surface provider to return surfaces that wrap the underlying openxr textures, which are valid in the webgl thread and can be used as the target of an opaque framebuffer. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #25735 - [x] These changes do not require tests because there are no windows immersive mode tests