Trait gpu_display::DisplayT
source · pub(crate) trait DisplayT: AsRawDescriptor {
// Required method
fn create_surface(
&mut self,
parent_surface_id: Option<u32>,
surface_id: u32,
scanout_id: Option<u32>,
display_params: &DisplayParameters,
surf_type: SurfaceType
) -> GpuDisplayResult<Box<dyn GpuDisplaySurface>>;
// Provided methods
fn pending_events(&self) -> bool { ... }
fn flush(&self) { ... }
fn next_event(&mut self) -> GpuDisplayResult<u64> { ... }
fn handle_next_event(
&mut self,
_surface: &mut Box<dyn GpuDisplaySurface>
) -> Option<GpuDisplayEvents> { ... }
fn import_resource(
&mut self,
_import_id: u32,
_surface_id: u32,
_external_display_resource: DisplayExternalResourceImport<'_>
) -> Result<()> { ... }
fn release_import(&mut self, _import_id: u32, _surface_id: u32) { ... }
}
Required Methods§
sourcefn create_surface(
&mut self,
parent_surface_id: Option<u32>,
surface_id: u32,
scanout_id: Option<u32>,
display_params: &DisplayParameters,
surf_type: SurfaceType
) -> GpuDisplayResult<Box<dyn GpuDisplaySurface>>
fn create_surface( &mut self, parent_surface_id: Option<u32>, surface_id: u32, scanout_id: Option<u32>, display_params: &DisplayParameters, surf_type: SurfaceType ) -> GpuDisplayResult<Box<dyn GpuDisplaySurface>>
Creates a surface with the given parameters. The display backend is given a non-zero
surface_id
as a handle for subsequent operations.
Provided Methods§
sourcefn pending_events(&self) -> bool
fn pending_events(&self) -> bool
Returns true if there are events that are on the queue.
sourcefn next_event(&mut self) -> GpuDisplayResult<u64>
fn next_event(&mut self) -> GpuDisplayResult<u64>
Returns the surface descirptor associated with the current event
sourcefn handle_next_event(
&mut self,
_surface: &mut Box<dyn GpuDisplaySurface>
) -> Option<GpuDisplayEvents>
fn handle_next_event( &mut self, _surface: &mut Box<dyn GpuDisplaySurface> ) -> Option<GpuDisplayEvents>
Handles the event from the compositor, and returns an list of events
sourcefn import_resource(
&mut self,
_import_id: u32,
_surface_id: u32,
_external_display_resource: DisplayExternalResourceImport<'_>
) -> Result<()>
fn import_resource( &mut self, _import_id: u32, _surface_id: u32, _external_display_resource: DisplayExternalResourceImport<'_> ) -> Result<()>
Imports a resource into the display backend. The display backend is given a non-zero
import_id
as a handle for subsequent operations.
sourcefn release_import(&mut self, _import_id: u32, _surface_id: u32)
fn release_import(&mut self, _import_id: u32, _surface_id: u32)
Frees a previously imported resource.