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 contextbackend_texture
- texture residing on GPUtexture_origin
- origin ofbackend_texture
color_type
- color type of the resulting imagealpha_type
- alpha type of the resulting imagecolor_space
- range of colors; may beNone
Returns: created Image
, or None