adopt Texture From
fun adoptTextureFrom(context: DirectContext, backendTexture: BackendTexture, origin: SurfaceOrigin, colorType: ColorType): Image
Creates GPU-backed SkImage from backendTexture 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 backendTexture is recognized and supported. Recognized formats vary by GPU backend.
Return
created Image
Parameters
context
GPU context
backend Texture
texture residing on GPU
origin
origin of backendTexture
color Type
color type of the resulting Image
Throws
Runtime Exception
if nullPtr is returned.