Module surface_ganesh

Source

Functionsยง

get_backend_render_target
Retrieves the back-end render target. If Surface has no back-end render target, None is returned.
get_backend_texture
Retrieves the back-end texture. If Surface has no back-end texture, None is returned.
render_target
Returns Surface on GPU indicated by context. Allocates memory for pixels, based on the width, height, and crate::ColorType in ImageInfo. budgeted selects whether allocation for pixels is tracked by context. image_info describes the pixel format in crate::ColorType, and transparency in crate::AlphaType, and color matching in crate::ColorSpace.
resolve_msaa
If a surface is a Ganesh-backed surface, is being drawn with MSAA, and there is a resolve texture, this call will insert a resolve command into the stream of gpu commands. In order for the resolve to actually have an effect, the work still needs to be flushed and submitted to the GPU after recording the resolve command. If a resolve is not supported or the Surface has no dirty work to resolve, then this call is a no-op.
wrap_backend_render_target
Wraps a GPU-backed buffer into Surface. Caller must ensure backend_render_target is valid for the lifetime of returned Surface.
wrap_backend_texture
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.