vizia::vg::gpu::ganesh::images

Function adopt_texture_from

pub fn adopt_texture_from(
    context: &mut RCHandle<GrRecordingContext>,
    backend_texture: &RefHandle<GrBackendTexture>,
    texture_origin: GrSurfaceOrigin,
    color_type: ColorType,
    alpha_type: impl Into<Option<SkAlphaType>>,
    color_space: impl Into<Option<RCHandle<SkColorSpace>>>,
) -> Option<RCHandle<SkImage>>
Expand description

Creates GPU-backed Image from backend_texture associated with context. Skia will assume ownership of the resource and will release it when no longer needed. A non-null Image is returned if format of backend_texture is recognized and supported. Recognized formats vary by GPU backend.

  • context - GPU context
  • backend_texture - texture residing on GPU
  • texture_origin - origin of backend_texture
  • color_type - color type of the resulting image
  • alpha_type - alpha type of the resulting image
  • color_space - range of colors; may be None

Returns: created Image, or None