Skip to content

Conversation

@mrobinson
Copy link
Member

Make external image handlers per-Painter, but make some of the shared
data that they use such as the SwapChains global to all Painters.
This allows making the WebGL thread and the WebXR thread global to all
Painters as well.

This is necessary to support multiple painters sharing the same WebGL
thread.

Testing: This doesn't really change behavior yet, so is covered by existing tests.

@mrobinson mrobinson requested a review from sagudev as a code owner November 17, 2025 12:40
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 17, 2025
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Nov 17, 2025
@mrobinson mrobinson added this pull request to the merge queue Nov 17, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Nov 17, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 17, 2025
@servo-highfive servo-highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Nov 17, 2025
@sagudev sagudev added this pull request to the merge queue Nov 17, 2025
@servo-highfive servo-highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Nov 17, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 17, 2025
@servo-highfive servo-highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Nov 17, 2025
@jdm
Copy link
Member

jdm commented Nov 17, 2025

  │ Should be called with a valid WebGLContextId (thread WebGL, at components/webgl/webgl_thread.rs:446)
  │    0: servoshell::backtrace::print
  │    1: servoshell::panic_hook::panic_hook
  │    2: std::panicking::panic_with_hook
  │    3: std::panicking::panic_handler::{{closure}}
  │    4: std::sys::backtrace::__rust_end_short_backtrace
  │    5: __rustc::rust_begin_unwind
  │    6: core::panicking::panic_fmt
  │    7: core::option::expect_failed
  │    8: webgl::webxr::<impl webxr_api::layer::GLContexts<webxr::surfman_layer_manager::SurfmanGL> for webgl::webgl_thread::WebGLThread>::device
  │    9: <webxr::surfman_layer_manager::SurfmanLayerManager as webxr_api::layer::LayerManagerAPI<webxr::surfman_layer_manager::SurfmanGL>>::destroy_layer
  │   10: webgl::webxr::WebXRBridge::destroy_all_layers
  │   11: webgl::webgl_thread::WebGLThread::remove_webgl_context
  │   12: webgl::webgl_thread::WebGLThread::handle_msg
  │   13: webgl::webgl_thread::WebGLThread::process
  │   14: std::sys::backtrace::__rust_begin_short_backtrace
  │   15: core::ops::function::FnOnce::call_once{{vtable.shim}}
  │   16: std::sys::thread::unix::Thread::new::thread_start
  │   17: <unknown>
  └   18: <unknown>

Very suspicious!

Make external image handlers per-`Painter`, but make some of the shared
data that they use such as the `SwapChains` global to all `Painter`s.
This allows making the WebGL thread and the WebXR thread global to all
`Painter`s as well.

This is necessary to support multiple painters sharing the same WebGL
thread.

Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
@mrobinson mrobinson force-pushed the per-painter-external-image-handlers branch from 0ca983f to 0e95dae Compare November 18, 2025 17:32
@servo-highfive servo-highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Nov 18, 2025
@mrobinson mrobinson enabled auto-merge November 18, 2025 17:32
@mrobinson mrobinson added this pull request to the merge queue Nov 18, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Nov 18, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 18, 2025
@servo-highfive servo-highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Nov 18, 2025
@mrobinson mrobinson added this pull request to the merge queue Nov 18, 2025
@servo-highfive servo-highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Nov 18, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 18, 2025
@servo-highfive servo-highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Nov 18, 2025
@mrobinson mrobinson added this pull request to the merge queue Nov 18, 2025
@servo-highfive servo-highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Nov 18, 2025
Merged via the queue into servo:main with commit b29d58f Nov 18, 2025
47 checks passed
@mrobinson mrobinson deleted the per-painter-external-image-handlers branch November 18, 2025 19:45
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants