Commit graph

172 commits

Author SHA1 Message Date
eri
da696b7e57
clippy: fix result_unit_err warnings (#31791)
* 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>
2024-03-21 12:51:45 +00:00
eri
03d64d0675
clippy: Fix assorted warnings in components/ (#31628)
* clippy: fix assorted warnings in `components/`

* fix: new and default

* fix: review comments
2024-03-13 08:31:58 +00:00
eri
5c4f8cf0df
clippy: fix some warnings in components/canvas (#31563) 2024-03-08 07:24:01 +00:00
Martin Robinson
5c1723c983
rustdoc: Fix many rustdoc errors (#31147)
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.
2024-01-22 13:13:48 +00:00
Delan Azabani
66258bfbbd
Temporarily convert existing cfg(debug_assertions) crashes to warnings (#30578) 2023-10-18 13:16:11 +00:00
Mukilan Thiyagarajan
c2502120cf
Fix webgl regression after WebRender upgrade (#30390)
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]: c385b3c973/third_party/webrender/webrender/src/renderer.rs (L7073)

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2023-09-20 13:21:02 +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
Martin Robinson
a9d37cb85a
Upgrade WebRender to e491e1ae637b2eed1e7195855d88357e5eb3ddf9 (#30323)
* 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.
2023-09-10 12:38:56 +00:00
Samson
711dbbd4af
remove extern crate (#30311)
* 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>
2023-09-08 12:11:31 +00:00
Martin Robinson
c46631a1ce
Remove dependency on surfman-chains (#30090)
This functionality is now part of surfman itself.
2023-08-11 14:24:10 +00:00
Martin Robinson
3230162fd0
Try to use WebRender types more
The newer versions of WebRender move types around between `webrender` and
`webrender_api` and this will reduce the churn during the upgrade.
2023-07-10 17:35:50 +02:00
Martin Robinson
ec3b2826ae
Remove the DOMToTexture feature
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
2023-06-27 11:39:52 +02:00
Martin Robinson
423cc34cb0 Bump euclid to 0.22
- 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.
2023-01-26 08:59:21 +01:00
yvt
41b3726271 feat: shorten thread names
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
2021-07-19 00:57:48 +09:00
Josh Matthews
1e3d72dc82 Fix deprecation warnings. 2020-11-12 15:47:08 -05:00
Josh Matthews
a5e488bc2c webgl: Support preserveDrawingBuffer. 2020-08-06 14:25:17 -04:00
Alan Jeffrey
a9bb3f7181 Support depth and stencil in webxr 2020-07-10 18:35:09 -05:00
Alan Jeffrey
349619ed2d Support for webxr layer management 2020-06-28 16:37:45 -05:00
bors-servo
1b55ab5804
Auto merge of #26787 - szeged:texi2d_3, r=jdm
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. -->
2020-06-18 09:58:55 -04:00
Istvan Miklos
6591fa54f9 Add support for WebGL2 TexImage2D
Adds initial support for one of the WebGL2 `TexImage2D` call.
2020-06-18 09:59:04 +02:00
Gregory Terzian
59896748b5 blockingly shut-down webrender when exiting webgl_thread 2020-06-17 13:47:13 +08:00
Josh Matthews
75efaa95f5 Proxy all WR interactions for layout/font/script/canvas threads to the compositor
thread. There is now a single RenderApi that is used, and all transactions are serialized
through the compositor.
2020-06-09 13:05:16 -04:00
Josh Matthews
eb2f7f7f0a Convert all uses of UpdateResources api to use webrender transactions. 2020-05-11 17:41:56 -04:00
Josh Matthews
9ce84d94de webgl: Return TEXTURE_IMMUTABLE_FORMAT as a boolean; don't panic on macOS for TEXTURE_IMMUTABLE_LEVELS. 2020-04-30 00:21:49 -04:00
Josh Matthews
3876d6dbdd webgl: Add missing RGB8 texture format combination. 2020-04-30 00:21:49 -04:00
Mátyás Mustoha
54b100b0f1 webgl: Fix tidy 2020-04-30 00:21:49 -04:00
Josh Matthews
29ab55d076 webgl: Fix support for float/half-float texture formats. 2020-04-30 00:21:49 -04:00
Mátyás Mustoha
8789a6a8d8 Add support for WebGL2 TexStorage2D
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
2020-04-30 00:21:48 -04:00
Alan Jeffrey
8bb1732258 Update surfman to 0.2 and remove glutin 2020-04-17 23:44:53 -05:00
bors-servo
23deec8c39
Auto merge of #26147 - jdm:linewidth, r=nox
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
2020-04-14 18:54:00 -04:00
Daniel Alley
865b538115 Remove assertion for negative value from get_uniform_location
closes #26150
2020-04-09 22:25:57 -04:00
bors-servo
37023b24f2
Auto merge of #26136 - asajeffrey:goodbye-webvr, r=Manishearth
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. -->
2020-04-08 23:02:50 -04:00
Alan Jeffrey
c611e46381 Remove WebVR 2020-04-08 20:23:41 -05:00
Josh Matthews
16d67b1283 webgl: Avoid GL errors with LineWidth commands. 2020-04-08 12:54:12 -04:00
Istvan
62f00df79d Add initial support for VertexAttribI4*, VertexAttribIPointer
Adds initial support for the WebGL2 `VertexAttribI4i`, `VertexAttribI4iv`, `VertexAttribI4ui`, `VertexAttribI4uiv` and `VertexAttribIPointer` calls.
2020-04-07 15:01:39 -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
Mátyás Mustoha
0afe27ef18 Add support for WebGL2 read and draw buffer settings
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
2020-03-16 12:17:15 +01:00
Mátyás Mustoha
5eaa9ef8cb Add support for some more WebGL2 renderbuffer functions
Adds support for the following WebGL2 calls:

- `RenderbufferStorageMultisample`
- `GetInternalFormativ`

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.5
2020-03-13 13:43:30 -04:00
bors-servo
b4d7ec1c99
Auto merge of #25855 - jdm:surface-inversion, r=Manishearth,asajeffrey
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
2020-03-09 19:58:21 -04:00
Josh Matthews
fbcf2bbc3e Integrate swapchain surface provider changes into webgl and webxr implementations. 2020-03-09 17:50:54 -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
bors-servo
813be91926
Auto merge of #25863 - servo:synup, r=jdm
Remove syn 0.15 from our crate graph
2020-03-05 10:03:48 -05:00
Anthony Ramine
9996e48500 Remove syn 0.15 from our crate graph (fixes #24421)
This required bumps of:

* gleam
* image
* rust-webvr
* webrender
* webxr
2020-03-05 13:01:13 +01:00
Mátyás Mustoha
8389189d94 Add support for WebGL2 FramebufferTextureLayer
Adds support for `FramebufferTextureLayer` WebGL2 call.

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.4
2020-03-04 10:07:13 +01:00
Mátyás Mustoha
cc07d930c8 Add support for WebGL2 framebuffer invalidation
Adds support for the `invalidateFramebuffer` and `invalideSubFramebuffer`
WebGL2 calls.

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.4
2020-03-03 14:54:17 +01:00
Mátyás Mustoha
8701d45715 Add support for WebGL2 clear buffer operations
Adds support for the following WebGL2 methods:

- `clearBufferfv`
- `clearBufferiv`
- `clearBufferuiv`
- `clearBufferfi`

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.11
2020-02-24 10:57:46 +01:00
Manish Goregaokar
f3e1aba4e3 Add profiling for WebXR 2020-02-22 22:00:05 -08:00
Mátyás Mustoha
7d5048f885 Add support for WebGL2 uniform matrix operations
Adds support for the `uniformMatrix[234]x[234]fv` WebGL2 functions.

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8
2020-01-17 11:42:45 +01:00
Mátyás Mustoha
bc914381a8 Add support for WebGL2 unsigned uniform operations
This adds support for the WebGL2 `uniform[1234]ui` and `uniform[1234]uiv`
operations.

See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8
2020-01-15 13:48:35 +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