Add raw window handle implementations to GPUI (#7101)

This is in preparation for experiments with wgpu. This should have no
external effect.

Release Notes:

- N/A
This commit is contained in:
Mikayla Maki 2024-01-30 11:42:28 -08:00 committed by GitHub
parent 1d794dbb37
commit a54eaaecee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 60 additions and 6 deletions

View file

@ -8,13 +8,14 @@ mod test;
use crate::{
Action, AnyWindowHandle, AsyncWindowContext, BackgroundExecutor, Bounds, DevicePixels, Font,
FontId, FontMetrics, FontRun, ForegroundExecutor, GlobalPixels, GlyphId, Keymap, LineLayout,
Pixels, PlatformInput, Point, RenderGlyphParams, RenderImageParams, RenderSvgParams, Result,
Scene, SharedString, Size, Task, TaskLabel, WindowContext,
Pixels, PlatformInput, Point, RenderGlyphParams, RenderImageParams, RenderSvgParams, Scene,
SharedString, Size, Task, TaskLabel, WindowContext,
};
use anyhow::anyhow;
use anyhow::{anyhow, Result};
use async_task::Runnable;
use futures::channel::oneshot;
use parking::Unparker;
use raw_window_handle::{HasDisplayHandle, HasWindowHandle};
use seahash::SeaHasher;
use serde::{Deserialize, Serialize};
use std::borrow::Cow;
@ -138,7 +139,7 @@ impl Debug for DisplayId {
unsafe impl Send for DisplayId {}
pub(crate) trait PlatformWindow {
pub(crate) trait PlatformWindow: HasWindowHandle + HasDisplayHandle {
fn bounds(&self) -> WindowBounds;
fn content_size(&self) -> Size<Pixels>;
fn scale_factor(&self) -> f32;