Trait smithay::backend::egl::native::EGLNativeSurface[][src]

pub unsafe trait EGLNativeSurface: Send + Sync {
    fn create(
        &self,
        display: &Arc<EGLDisplayHandle>,
        config_id: EGLConfig
    ) -> Result<*const c_void, EGLError>; fn needs_recreation(&self) -> bool { ... }
fn resize(&self, _width: i32, _height: i32, _dx: i32, _dy: i32) -> bool { ... }
fn swap_buffers(
        &self,
        display: &Arc<EGLDisplayHandle>,
        surface: EGLSurface
    ) -> Result<(), SwapBuffersError> { ... } }
Expand description

Trait for types returning valid surface pointers for initializing egl

Unsafety

The returned NativeWindowType must be valid for EGL and there is no way to test that.

Required methods

Create an EGLSurface from the internal native type.

Must be able to deal with re-creation of existing resources, if needs_recreation can return true.

Provided methods

Will be called to check if any internal resources will need to be recreated. Old resources must be used until create was called again and a new surface was obtained.

Only needs to be recreated, if this may return true. The default implementation always returns false.

If the surface supports resizing you may implement and use this function.

The two first arguments (width, height) are the new size of the surface, the two others (dx, dy) represent the displacement of the top-left corner of the surface. It allows you to control the direction of the resizing if necessary.

Implementations may ignore the dx and dy arguments.

Returns true if the resize was successful.

Adds additional semantics when calling EGLSurface::swap_buffers

Only implement if required by the backend.

Implementations on Foreign Types

Implementors