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 for GPU { /// 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 + } } ///