mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
webgpu: leverage routed_promise in calls returning promises (#35859)
Using the RoutedPromiseListener let us define a different response type for each promise. This removes unreachable branches that used to exist when they all shared the same WebGPUResponse. Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
parent
4814cbdb1f
commit
1c9f486f88
15 changed files with 221 additions and 263 deletions
|
@ -157,7 +157,7 @@ use style_traits::CSSPixel;
|
|||
#[cfg(feature = "webgpu")]
|
||||
use webgpu::swapchain::WGPUImageMap;
|
||||
#[cfg(feature = "webgpu")]
|
||||
use webgpu::{self, WebGPU, WebGPURequest, WebGPUResponse};
|
||||
use webgpu::{self, WebGPU, WebGPURequest};
|
||||
#[cfg(feature = "webgpu")]
|
||||
use webrender::RenderApi;
|
||||
use webrender::RenderApiSender;
|
||||
|
@ -1936,7 +1936,7 @@ where
|
|||
FromScriptMsg::RequestAdapter(response_sender, options, adapter_id) => {
|
||||
match webgpu_chan {
|
||||
None => {
|
||||
if let Err(e) = response_sender.send(WebGPUResponse::None) {
|
||||
if let Err(e) = response_sender.send(None) {
|
||||
warn!("Failed to send request adapter message: {}", e)
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue