diff options
author | bors-servo <infra@servo.org> | 2023-06-27 20:01:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-27 20:01:48 +0200 |
commit | ea4701c57b3cb732a46ea5356e0945aa1d488d06 (patch) | |
tree | bd7d05ca9cbbeec816cf28df326d7cb61e85f193 /components/canvas/webgl_mode/inprocess.rs | |
parent | 1ca74a3ceea37ed6eb8786c35028966d4b8d3547 (diff) | |
parent | ec3b2826ae7f9186e20e7a992f8be70c9aa2f903 (diff) | |
download | servo-ea4701c57b3cb732a46ea5356e0945aa1d488d06.tar.gz servo-ea4701c57b3cb732a46ea5356e0945aa1d488d06.zip |
Auto merge of #29938 - mrobinson:remove-domtotexture, r=jdm
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
<!-- Please describe your changes on the following line: -->
---
<!-- 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 #29936.
- [x] These changes do not require tests because they remove functionality.
<!-- 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. -->
Diffstat (limited to 'components/canvas/webgl_mode/inprocess.rs')
-rw-r--r-- | components/canvas/webgl_mode/inprocess.rs | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/components/canvas/webgl_mode/inprocess.rs b/components/canvas/webgl_mode/inprocess.rs index ca9188aee54..64180b47930 100644 --- a/components/canvas/webgl_mode/inprocess.rs +++ b/components/canvas/webgl_mode/inprocess.rs @@ -7,12 +7,8 @@ use canvas_traits::webgl::webgl_channel; use canvas_traits::webgl::{WebGLContextId, WebGLMsg, WebGLThreads}; use euclid::default::Size2D; use fnv::FnvHashMap; -use gleam; -use servo_config::pref; -use sparkle::gl; use sparkle::gl::GlType; use std::default::Default; -use std::rc::Rc; use std::sync::{Arc, Mutex}; use surfman::Device; use surfman::SurfaceInfo; @@ -30,7 +26,6 @@ use webxr_api::LayerGrandManager as WebXRLayerGrandManager; pub struct WebGLComm { pub webgl_threads: WebGLThreads, pub image_handler: Box<dyn WebrenderExternalImageApi>, - pub output_handler: Option<Box<dyn webrender_api::OutputImageHandler>>, pub webxr_layer_grand_manager: WebXRLayerGrandManager<WebXRSurfman>, } @@ -38,7 +33,6 @@ impl WebGLComm { /// Creates a new `WebGLComm` object. pub fn new( surfman: WebrenderSurfman, - webrender_gl: Rc<dyn gleam::gl::Gl>, webrender_api_sender: webrender_api::RenderApiSender, webrender_doc: webrender_api::DocumentId, external_images: Arc<Mutex<WebrenderExternalImageRegistry>>, @@ -64,12 +58,6 @@ impl WebGLComm { webxr_init, }; - let output_handler = if pref!(dom.webgl.dom_to_texture.enabled) { - Some(Box::new(OutputHandler::new(webrender_gl.clone()))) - } else { - None - }; - let external = WebGLExternalImages::new(surfman, webrender_swap_chains); WebGLThread::run_on_own_thread(init); @@ -77,7 +65,6 @@ impl WebGLComm { WebGLComm { webgl_threads: WebGLThreads(sender), image_handler: Box::new(external), - output_handler: output_handler.map(|b| b as Box<_>), webxr_layer_grand_manager: webxr_layer_grand_manager, } } @@ -144,43 +131,3 @@ impl WebrenderExternalImageApi for WebGLExternalImages { self.unlock_swap_chain(id); } } - -/// struct used to implement DOMToTexture feature and webrender::OutputImageHandler trait. -struct OutputHandler { - webrender_gl: Rc<dyn gleam::gl::Gl>, - sync_objects: FnvHashMap<webrender_api::PipelineId, gleam::gl::GLsync>, -} - -impl OutputHandler { - fn new(webrender_gl: Rc<dyn gleam::gl::Gl>) -> Self { - OutputHandler { - webrender_gl, - sync_objects: Default::default(), - } - } -} - -/// Bridge between the WR frame outputs and WebGL to implement DOMToTexture synchronization. -impl webrender_api::OutputImageHandler for OutputHandler { - fn lock( - &mut self, - id: webrender_api::PipelineId, - ) -> Option<(u32, webrender_api::units::FramebufferIntSize)> { - // Insert a fence in the WR command queue - let gl_sync = self - .webrender_gl - .fence_sync(gl::SYNC_GPU_COMMANDS_COMPLETE, 0); - self.sync_objects.insert(id, gl_sync); - // https://github.com/servo/servo/issues/24615 - None - } - - fn unlock(&mut self, id: webrender_api::PipelineId) { - if let Some(gl_sync) = self.sync_objects.remove(&id) { - // Flush the Sync object into the GPU's command queue to guarantee that it it's signaled. - self.webrender_gl.flush(); - // Mark the sync object for deletion. - self.webrender_gl.delete_sync(gl_sync); - } - } -} |