Function skia_safe::gpu::surfaces::wrap_backend_texture
source · pub fn wrap_backend_texture(
context: &mut RecordingContext,
backend_texture: &BackendTexture,
origin: SurfaceOrigin,
sample_cnt: impl Into<Option<usize>>,
color_type: ColorType,
color_space: impl Into<Option<ColorSpace>>,
surface_props: Option<&SurfaceProps>
) -> Option<Surface>Expand description
Wraps a GPU-backed texture into Surface. Caller must ensure the texture is
valid for the lifetime of returned Surface. If sample_cnt greater than zero,
creates an intermediate MSAA Surface which is used for drawing backend_texture.
Surface is returned if all parameters are valid. backend_texture is valid if
its pixel configuration agrees with color_space and context; for instance, if
backend_texture has an sRGB configuration, then context must support sRGB,
and color_space must be present. Further, backend_texture width and height must
not exceed context capabilities, and the context must be able to support
back-end textures.
context- GPU contextbackend_texture- texture residing on GPUsample_cnt- samples per pixel, or 0 to disable full scene anti-aliasingcolor_space- range of colors; may beNonesurface_props- LCD striping orientation and setting for device independent fonts; may beNoneReturns:Surfaceif all parameters are valid; otherwise,None