diff options
Diffstat (limited to 'components/script/dom/webgpu/gpu.rs')
-rw-r--r-- | components/script/dom/webgpu/gpu.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/components/script/dom/webgpu/gpu.rs b/components/script/dom/webgpu/gpu.rs index 20380e07bfb..b2534cda9a8 100644 --- a/components/script/dom/webgpu/gpu.rs +++ b/components/script/dom/webgpu/gpu.rs @@ -86,8 +86,12 @@ impl GPUMethods<crate::DomTypeHolder> for GPU { /// <https://gpuweb.github.io/gpuweb/#dom-gpu-getpreferredcanvasformat> fn GetPreferredCanvasFormat(&self) -> GPUTextureFormat { - // TODO: real implementation - GPUTextureFormat::Rgba8unorm + // From https://github.com/mozilla-firefox/firefox/blob/24d49101ce17b78c3ba1217d00297fe2891be6b3/dom/webgpu/Instance.h#L68 + if cfg!(target_os = "android") { + GPUTextureFormat::Rgba8unorm + } else { + GPUTextureFormat::Bgra8unorm + } } /// <https://www.w3.org/TR/webgpu/#dom-gpu-wgsllanguagefeatures> |