Only start WebGPU thread if an adapter is requested

This commit is contained in:
Zakor Gyula 2019-11-20 09:03:10 +01:00
parent f8c957dc1b
commit a751b1c3d7
15 changed files with 200 additions and 147 deletions

View file

@ -135,7 +135,6 @@ use style::str::HTML_SPACE_CHARACTERS;
use style::stylesheets::CssRuleType;
use style_traits::{CSSPixel, DevicePixel, ParsingMode};
use url::Position;
use webgpu::WebGPU;
use webrender_api::units::{DeviceIntPoint, DeviceIntSize, LayoutPixel};
use webrender_api::{DocumentId, ExternalScrollId};
use webvr_traits::WebVRMsg;
@ -267,10 +266,6 @@ pub struct Window {
#[ignore_malloc_size_of = "channels are hard"]
webgl_chan: Option<WebGLChan>,
#[ignore_malloc_size_of = "channels are hard"]
/// A handle for communicating messages to the WebGPU threads.
webgpu: Option<WebGPU>,
/// A handle for communicating messages to the webvr thread, if available.
#[ignore_malloc_size_of = "channels are hard"]
webvr_chan: Option<IpcSender<WebVRMsg>>,
@ -466,10 +461,6 @@ impl Window {
.map(|chan| WebGLCommandSender::new(chan.clone(), self.get_event_loop_waker()))
}
pub fn webgpu_channel(&self) -> Option<WebGPU> {
self.webgpu.clone()
}
pub fn webvr_thread(&self) -> Option<IpcSender<WebVRMsg>> {
self.webvr_chan.clone()
}
@ -2213,7 +2204,6 @@ impl Window {
navigation_start: u64,
navigation_start_precise: u64,
webgl_chan: Option<WebGLChan>,
webgpu: Option<WebGPU>,
webvr_chan: Option<IpcSender<WebVRMsg>>,
webxr_registry: webxr_api::Registry,
microtask_queue: Rc<MicrotaskQueue>,
@ -2292,7 +2282,6 @@ impl Window {
media_query_lists: DOMTracker::new(),
test_runner: Default::default(),
webgl_chan,
webgpu,
webvr_chan,
webxr_registry,
permission_state_invocation_results: Default::default(),