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:
parent
1d794dbb37
commit
a54eaaecee
5 changed files with 60 additions and 6 deletions
|
@ -5,6 +5,7 @@ use crate::{
|
|||
};
|
||||
use collections::HashMap;
|
||||
use parking_lot::Mutex;
|
||||
use raw_window_handle::{HasDisplayHandle, HasWindowHandle};
|
||||
use std::{
|
||||
rc::{Rc, Weak},
|
||||
sync::{self, Arc},
|
||||
|
@ -29,6 +30,22 @@ pub(crate) struct TestWindowState {
|
|||
#[derive(Clone)]
|
||||
pub(crate) struct TestWindow(pub(crate) Arc<Mutex<TestWindowState>>);
|
||||
|
||||
impl HasWindowHandle for TestWindow {
|
||||
fn window_handle(
|
||||
&self,
|
||||
) -> Result<raw_window_handle::WindowHandle<'_>, raw_window_handle::HandleError> {
|
||||
unimplemented!("Test Windows are not backed by a real platform window")
|
||||
}
|
||||
}
|
||||
|
||||
impl HasDisplayHandle for TestWindow {
|
||||
fn display_handle(
|
||||
&self,
|
||||
) -> Result<raw_window_handle::DisplayHandle<'_>, raw_window_handle::HandleError> {
|
||||
unimplemented!("Test Windows are not backed by a real platform window")
|
||||
}
|
||||
}
|
||||
|
||||
impl TestWindow {
|
||||
pub fn new(
|
||||
options: WindowOptions,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue