pub unsafe fn wrap_mtk_view(
context: &mut RecordingContext,
mtk_view: Handle,
origin: SurfaceOrigin,
sample_count: impl Into<Option<usize>>,
color_type: ColorType,
color_space: impl Into<Option<ColorSpace>>,
surface_props: Option<&SurfaceProps>,
) -> Option<Surface>Expand description
Creates Surface from MTKView.
Returned Surface takes a reference on the MTKView. The ref on the layer will be
released when the Surface is destroyed.
Only available when Metal API is enabled.
Will grab the current drawable from the layer and use its texture as a backend_rt to
create a renderable surface.
context- GPU contextlayer-gpu::mtl::Handle(expected to be a MTKView*)sample_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 beNone
Returns: created Surface, or None