diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2020-02-27 13:10:48 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-27 13:10:48 -0500 |
commit | 79b20c62c2a5588f603bfdbe997d906d078571bc (patch) | |
tree | a75ae22569d53fdc9ff5fa5990cc91b2a7f55337 /components/script/dom/gpu.rs | |
parent | 719b1972a6d2b2fd74cf8c6b658c8da3f862eb6c (diff) | |
parent | 000a5d543d8780a73ace6477c0c8255b8d7a97f6 (diff) | |
download | servo-79b20c62c2a5588f603bfdbe997d906d078571bc.tar.gz servo-79b20c62c2a5588f603bfdbe997d906d078571bc.zip |
Auto merge of #25850 - szeged:wgpu_lib_cleanup, r=jdm
Fixing some style related issues in WebGPU.
Changed the Requests/Response from tuples to named struct variants and also sorted in alphabetical order.
Replaced the ID generator functions from `globalscope` with a single function, which returns a `RefMut` and can call the appropriate method to generate resource IDs.
<!-- Please describe your changes on the following line: -->
---
<!-- 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
<!-- 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.-->
cc @kvark @jdm @zakorgy
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Diffstat (limited to 'components/script/dom/gpu.rs')
-rw-r--r-- | components/script/dom/gpu.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/components/script/dom/gpu.rs b/components/script/dom/gpu.rs index 8f129e14c30..e2f7e3e5a82 100644 --- a/components/script/dom/gpu.rs +++ b/components/script/dom/gpu.rs @@ -115,7 +115,7 @@ impl GPUMethods for GPU { }, None => wgpu::instance::PowerPreference::Default, }; - let ids = global.wgpu_create_adapter_ids(); + let ids = global.wgpu_id_hub().create_adapter_ids(); let script_to_constellation_chan = global.script_to_constellation_chan(); if script_to_constellation_chan @@ -135,13 +135,17 @@ impl GPUMethods for GPU { impl AsyncWGPUListener for GPU { fn handle_response(&self, response: WebGPUResponse, promise: &Rc<Promise>) { match response { - WebGPUResponse::RequestAdapter(name, adapter, channel) => { + WebGPUResponse::RequestAdapter { + adapter_name, + adapter_id, + channel, + } => { let adapter = GPUAdapter::new( &self.global(), channel, - DOMString::from(format!("{} ({:?})", name, adapter.0.backend())), + DOMString::from(format!("{} ({:?})", adapter_name, adapter_id.0.backend())), Heap::default(), - adapter, + adapter_id, ); promise.resolve_native(&adapter); }, |