Function vizia::vg::gpu::surfaces::wrap_backend_texture
pub fn wrap_backend_texture(
context: &mut RCHandle<GrRecordingContext>,
backend_texture: &RefHandle<GrBackendTexture>,
origin: GrSurfaceOrigin,
sample_cnt: impl Into<Option<usize>>,
color_type: ColorType,
color_space: impl Into<Option<RCHandle<SkColorSpace>>>,
surface_props: Option<&SurfaceProps>,
) -> Option<RCHandle<SkSurface>>
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 beNone
surface_props
- LCD striping orientation and setting for device independent fonts; may beNone
Returns:Surface
if all parameters are valid; otherwise,None