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/gpuadapter.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/gpuadapter.rs')
-rw-r--r-- | components/script/dom/gpuadapter.rs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/components/script/dom/gpuadapter.rs b/components/script/dom/gpuadapter.rs index abf8844522d..34f040405c1 100644 --- a/components/script/dom/gpuadapter.rs +++ b/components/script/dom/gpuadapter.rs @@ -91,11 +91,17 @@ impl GPUAdapterMethods for GPUAdapter { }; let id = self .global() - .wgpu_create_device_id(self.adapter.0.backend()); + .wgpu_id_hub() + .create_device_id(self.adapter.0.backend()); if self .channel .0 - .send(WebGPURequest::RequestDevice(sender, self.adapter, desc, id)) + .send(WebGPURequest::RequestDevice { + sender, + adapter_id: self.adapter, + descriptor: desc, + device_id: id, + }) .is_err() { promise.reject_error(Error::Operation); @@ -107,7 +113,11 @@ impl GPUAdapterMethods for GPUAdapter { impl AsyncWGPUListener for GPUAdapter { fn handle_response(&self, response: WebGPUResponse, promise: &Rc<Promise>) { match response { - WebGPUResponse::RequestDevice(device_id, queue_id, _descriptor) => { + WebGPUResponse::RequestDevice { + device_id, + queue_id, + _descriptor, + } => { let device = GPUDevice::new( &self.global(), self.channel.clone(), |