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§

source

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§

source

fn pending_events(&self) -> bool

Returns true if there are events that are on the queue.

source

fn flush(&self)

Sends any pending commands to the compositor.

source

fn next_event(&mut self) -> GpuDisplayResult<u64>

Returns the surface descirptor associated with the current event

source

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

source

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.

source

fn release_import(&mut self, _import_id: u32, _surface_id: u32)

Frees a previously imported resource.

Implementors§