clippy: fix warnings in various modules in components (#31568)

* clippy: fix warnings in various modules in components

* fix: unit tests

* fix: build on android

* fix: all samplers use new_boxed
This commit is contained in:
eri 2024-03-08 15:28:04 +01:00 committed by GitHub
parent 19f1f2a8f4
commit 3a5ca785d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 107 additions and 118 deletions

View file

@ -919,8 +919,8 @@ impl<'a> WGPU<'a> {
pipeline_id,
} => {
let desc = DeviceDescriptor {
label: descriptor.label.as_ref().map(|l| crate::Cow::from(l)),
features: descriptor.features.clone(),
label: descriptor.label.as_ref().map(crate::Cow::from),
features: descriptor.features,
limits: descriptor.limits.clone(),
};
let global = &self.global;
@ -1336,20 +1336,12 @@ webgpu_resource!(WebGPUSurface, id::SurfaceId);
webgpu_resource!(WebGPUTexture, id::TextureId);
webgpu_resource!(WebGPUTextureView, id::TextureViewId);
#[derive(Default)]
pub struct WGPUExternalImages {
pub images: Arc<Mutex<HashMap<u64, PresentationData>>>,
pub locked_ids: HashMap<u64, Vec<u8>>,
}
impl WGPUExternalImages {
pub fn new() -> Self {
Self {
images: Arc::new(Mutex::new(HashMap::new())),
locked_ids: HashMap::new(),
}
}
}
impl WebrenderExternalImageApi for WGPUExternalImages {
fn lock(&mut self, id: u64) -> (WebrenderImageSource, Size2D<i32>) {
let size;