skia_safe::gpu::ganesh::images

Function adopt_texture_from

Source
pub fn adopt_texture_from(
    context: &mut RecordingContext,
    backend_texture: &BackendTexture,
    texture_origin: SurfaceOrigin,
    color_type: ColorType,
    alpha_type: impl Into<Option<AlphaType>>,
    color_space: impl Into<Option<ColorSpace>>,
) -> Option<Image>
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