diff --git a/Cargo.lock b/Cargo.lock index 17c8396e18..6cc20aba28 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2762,6 +2762,7 @@ name = "gpui_widgets" version = "0.1.0" dependencies = [ "anyhow", + "core-video", "gpui", "gpui_elements", "gpui_platform", diff --git a/crates/gpui_macos/src/metal_renderer.rs b/crates/gpui_macos/src/metal_renderer.rs index 4ff9ac4e6e..ae108fbb76 100644 --- a/crates/gpui_macos/src/metal_renderer.rs +++ b/crates/gpui_macos/src/metal_renderer.rs @@ -1840,13 +1840,14 @@ impl MetalRenderer { DevicePixels::from(surface.image_buffer.get_height() as i32), ); - let is_bgra = match surface.image_buffer.get_pixel_format() { - kCVPixelFormatType_420YpCbCr8BiPlanarFullRange => false, - kCVPixelFormatType_32BGRA => true, - other => { - log::error!("unsupported surface pixel format: {other}"); - return false; - } + let pixel_format = surface.image_buffer.get_pixel_format(); + let is_bgra = if pixel_format == kCVPixelFormatType_420YpCbCr8BiPlanarFullRange { + false + } else if pixel_format == kCVPixelFormatType_32BGRA { + true + } else { + log::error!("unsupported surface pixel format: {pixel_format}"); + return false; }; // Y (or the whole BGRA image) texture from plane 0.