From 2c95df73a4d74b24db451e5ff1d3ccc5ced10fe2 Mon Sep 17 00:00:00 2001 From: Kunal Mohan Date: Sun, 14 Jun 2020 11:05:36 +0530 Subject: [PATCH] Add WebGPU to Layout-2020 --- components/layout_2020/dom_traversal.rs | 1 + components/layout_2020/replaced.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/components/layout_2020/dom_traversal.rs b/components/layout_2020/dom_traversal.rs index 5af0305c7d1..99bf0804ce6 100644 --- a/components/layout_2020/dom_traversal.rs +++ b/components/layout_2020/dom_traversal.rs @@ -451,6 +451,7 @@ where HTMLCanvasDataSource::Image(ipc_sender) => { CanvasSource::Image(ipc_sender.map(|renderer| Arc::new(Mutex::new(renderer)))) }, + HTMLCanvasDataSource::WebGPU(image_key) => CanvasSource::WebGPU(image_key), }; Some(( CanvasInfo { diff --git a/components/layout_2020/replaced.rs b/components/layout_2020/replaced.rs index d10e03198ac..3cb7dd725a4 100644 --- a/components/layout_2020/replaced.rs +++ b/components/layout_2020/replaced.rs @@ -52,6 +52,7 @@ pub(crate) struct IntrinsicSizes { pub(crate) enum CanvasSource { WebGL(ImageKey), Image(Option>>>), + WebGPU(ImageKey), } impl fmt::Debug for CanvasSource { @@ -62,6 +63,7 @@ impl fmt::Debug for CanvasSource { match *self { CanvasSource::WebGL(_) => "WebGL", CanvasSource::Image(_) => "Image", + CanvasSource::WebGPU(_) => "WebGPU", } ) } @@ -210,6 +212,7 @@ impl ReplacedContent { let image_key = match canvas_info.source { CanvasSource::WebGL(image_key) => image_key, + CanvasSource::WebGPU(image_key) => image_key, CanvasSource::Image(ref ipc_renderer) => match *ipc_renderer { Some(ref ipc_renderer) => { let ipc_renderer = ipc_renderer.lock().unwrap();