Checkpoint

Antonio Scandurra and Nathan Sobo created

Co-Authored-By: Nathan Sobo <nathan@zed.dev>

Change summary

crates/gpui3/src/platform.rs |  4 ++--
crates/gpui3/src/renderer.rs |  6 +++++-
crates/gpui3/src/window.rs   | 10 +++-------
3 files changed, 10 insertions(+), 10 deletions(-)

Detailed changes

crates/gpui3/src/platform.rs 🔗

@@ -155,13 +155,13 @@ pub trait PlatformWindow {
 
 unsafe impl<'a> HasRawWindowHandle for &'a dyn PlatformWindow {
     fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
-        self.raw_window_handle()
+        (*self).raw_window_handle()
     }
 }
 
 unsafe impl<'a> HasRawDisplayHandle for &'a dyn PlatformWindow {
     fn raw_display_handle(&self) -> raw_window_handle::RawDisplayHandle {
-        self.raw_display_handle()
+        (*self).raw_display_handle()
     }
 }
 

crates/gpui3/src/renderer.rs 🔗

@@ -1,6 +1,7 @@
 use crate::{DevicePixels, Scene, Size};
 use futures::{future::BoxFuture, FutureExt};
 use raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle};
+use wgpu::Backends;
 
 pub struct Renderer {
     device: wgpu::Device,
@@ -21,7 +22,10 @@ impl Renderer {
     where
         W: RenderTarget,
     {
-        let instance = wgpu::Instance::new(Default::default());
+        let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
+            backends: Backends::METAL,
+            ..Default::default()
+        });
         let surface = unsafe { instance.create_surface(window).unwrap() };
         let width = window.content_device_size().width;
         let height = window.content_device_size().height;

crates/gpui3/src/window.rs 🔗

@@ -1,11 +1,7 @@
 use crate::{
-    renderer::Renderer, AvailableSpace, MainThreadOnly, Platform, PlatformWindow, Point, Size,
-    Style, TextStyle, TextStyleRefinement, WindowOptions,
-};
-
-use super::{
-    px, taffy::LayoutId, AppContext, Bounds, Context, EntityId, Handle, Pixels, Reference,
-    TaffyLayoutEngine,
+    px, renderer::Renderer, taffy::LayoutId, AppContext, AvailableSpace, Bounds, Context, EntityId,
+    Handle, MainThreadOnly, Pixels, Platform, PlatformWindow, Point, Reference, Size, Style,
+    TaffyLayoutEngine, TextStyle, TextStyleRefinement, WindowOptions,
 };
 use anyhow::Result;
 use derive_more::{Deref, DerefMut};