mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
webgpu: Use compositor_api instead of webrender_api (#37713)
webgpu currently sends updates WebRender directly via WebRender API (same as webgl that I also plan to reform). 2D canvas uses Compositor API for that and with this PR so does webgpu. This will be helpful for #35733, where compositor must know state of image updates. Testing: WebGPU CTS run: https://github.com/sagudev/servo/actions/runs/15895299748 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
6656a09f8c
commit
c8132137cd
4 changed files with 38 additions and 86 deletions
|
@ -6,7 +6,6 @@ use log::warn;
|
|||
use swapchain::WGPUImageMap;
|
||||
pub use swapchain::{ContextData, WGPUExternalImages};
|
||||
use webgpu_traits::{WebGPU, WebGPUMsg};
|
||||
use webrender::RenderApiSender;
|
||||
use wgpu_thread::WGPU;
|
||||
pub use {wgpu_core as wgc, wgpu_types as wgt};
|
||||
|
||||
|
@ -16,16 +15,14 @@ mod wgpu_thread;
|
|||
use std::borrow::Cow;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use compositing_traits::WebrenderExternalImageRegistry;
|
||||
use compositing_traits::{CrossProcessCompositorApi, WebrenderExternalImageRegistry};
|
||||
use ipc_channel::ipc::{self, IpcReceiver};
|
||||
use servo_config::pref;
|
||||
use webrender_api::DocumentId;
|
||||
|
||||
pub mod swapchain;
|
||||
|
||||
pub fn start_webgpu_thread(
|
||||
webrender_api_sender: RenderApiSender,
|
||||
webrender_document: DocumentId,
|
||||
compositor_api: CrossProcessCompositorApi,
|
||||
external_images: Arc<Mutex<WebrenderExternalImageRegistry>>,
|
||||
wgpu_image_map: WGPUImageMap,
|
||||
) -> Option<(WebGPU, IpcReceiver<WebGPUMsg>)> {
|
||||
|
@ -62,8 +59,7 @@ pub fn start_webgpu_thread(
|
|||
receiver,
|
||||
sender_clone,
|
||||
script_sender,
|
||||
webrender_api_sender,
|
||||
webrender_document,
|
||||
compositor_api,
|
||||
external_images,
|
||||
wgpu_image_map,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue