mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
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:
commit
abc3ed40c9
30 changed files with 886 additions and 91 deletions
|
@ -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 {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue