Auto merge of #26872 - kunalmohan:gpu-canvas-context, r=kvark,jdm

Implement GPUSwapChain and GPUCanvasContext and interface with Webrender

<!-- Please describe your changes on the following line: -->
r?@kvark

---
<!-- 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
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- 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. -->
This commit is contained in:
bors-servo 2020-06-15 14:22:21 -04:00 committed by GitHub
commit abc3ed40c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 886 additions and 91 deletions

View file

@ -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 {

View file

@ -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 {
@ -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();