/// Construct a new sysmem-buffer-backed image and register it with the display driver. If
/// successful, the image can be assigned to a primary layer in a display configuration.
Construct a new sysmem-buffer-backed image and register it with the display driver. If
successful, the image can be assigned to a primary layer in a display configuration.
Construct a new sysmem - buffer - backed image and register it with the display driver . If successful the image can be assigned to a primary layer in a display configuration .
pub async fn create(ctrl: Controller, params: &ImageParameters) -> Result<Image> {
        let mut collection = allocate_image_buffer(ctrl.clone(), params).await?;
        let id = ctrl.import_image(collection.id, params.into()).await?;
        let vmo = collection.info.buffers[0]
            .vmo
            .as_ref()
            .ok_or(Error::BuffersNotAllocated)?
            .duplicate_handle(zx::Rights::SAME_RIGHTS)?;
        collection.release();
        Ok(Image {
            id,
            collection_id: collection.id,
            vmo,
            parameters: params.clone(),
            format_constraints: collection.info.settings.image_format_constraints,
            buffer_settings: collection.info.settings.buffer_settings,
            proxy: collection.proxy.clone(),
            ctrl,
        })
    }
pub async fn create ( ctrl : Controller , params : & ImageParameters ) -> Result < Image > { let mut collection = allocate_image_buffer ( ctrl . clone ( ) , params ) . await ? ; let id = ctrl . import_image ( collection . id , params . into ( ) ) . await ? ; let vmo = collection . info . buffers [ 0 ] . vmo . as_ref ( ) . ok_or ( Error :: BuffersNotAllocated ) ? . duplicate_handle ( zx :: Rights :: SAME_RIGHTS ) ? ; collection . release ( ) ; Ok ( Image { id , collection_id : collection . id , vmo , parameters : params . clone ( ) , format_constraints : collection . info . settings . image_format_constraints , buffer_settings : collection . info . settings . buffer_settings , proxy : collection . proxy . clone ( ) , ctrl , } ) }
Construct a new sysmem-buffer-backed image and register it with the display driver.
Construct a new sysmem - buffer - backed image and register it with the display driver .
ctrl
Controller
params
&ImageParameters