Implement GPUSwapChain and GPUCanvasContext and interface with Webrender

This commit is contained in:
Kunal Mohan 2020-06-04 19:28:25 +05:30
parent 73760ea594
commit 71401e0855
28 changed files with 882 additions and 91 deletions

View file

@ -38,7 +38,7 @@ use std::collections::{HashMap, VecDeque};
use std::fmt;
use style_traits::viewport::ViewportConstraints;
use style_traits::CSSPixel;
use webgpu::{wgpu, WebGPUResponseResult};
use webgpu::{wgpu, WebGPU, WebGPUResponseResult};
use webrender_api::units::{DeviceIntPoint, DeviceIntSize};
/// A particular iframe's size, associated with a browsing context.
@ -280,6 +280,8 @@ pub enum ScriptMsg {
wgpu::instance::RequestAdapterOptions,
SmallVec<[wgpu::id::AdapterId; 4]>,
),
/// Get WebGPU channel
GetWebGPUChan(IpcSender<WebGPU>),
}
impl fmt::Debug for ScriptMsg {
@ -338,6 +340,7 @@ impl fmt::Debug for ScriptMsg {
GetScreenAvailSize(..) => "GetScreenAvailSize",
MediaSessionEvent(..) => "MediaSessionEvent",
RequestAdapter(..) => "RequestAdapter",
GetWebGPUChan(..) => "GetWebGPUChan",
};
write!(formatter, "ScriptMsg::{}", variant)
}