Skip to content

Commit

Permalink
Add WebGPU to Layout-2020
Browse files Browse the repository at this point in the history
  • Loading branch information
kunalmohan committed Jun 14, 2020
1 parent 71401e0 commit 2c95df7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/layout_2020/dom_traversal.rs
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions components/layout_2020/replaced.rs
Expand Up @@ -52,6 +52,7 @@ pub(crate) struct IntrinsicSizes {
pub(crate) enum CanvasSource {
WebGL(ImageKey),
Image(Option<Arc<Mutex<IpcSender<CanvasMsg>>>>),
WebGPU(ImageKey),
}

impl fmt::Debug for CanvasSource {
Expand All @@ -62,6 +63,7 @@ impl fmt::Debug for CanvasSource {
match *self {
CanvasSource::WebGL(_) => "WebGL",
CanvasSource::Image(_) => "Image",
CanvasSource::WebGPU(_) => "WebGPU",
}
)
}
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 2c95df7

Please sign in to comment.