Module surfaces
Available on crate feature
engine only.Functionsยง
- get_
backend_ render_ target - Retrieves the back-end render target. If
Surfacehas no back-end render target,Noneis returned. - get_
backend_ texture - Retrieves the back-end texture. If
Surfacehas no back-end texture,Noneis returned. - render_
target - Returns
Surfaceon GPU indicated by context. Allocates memory for pixels, based on the width, height, andcrate::ColorTypeinImageInfo. budgeted selects whether allocation for pixels is tracked by context.image_infodescribes the pixel format incrate::ColorType, and transparency incrate::AlphaType, and color matching incrate::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
Surfacehas 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 ensurebackend_render_targetis valid for the lifetime of returnedSurface. - wrap_
backend_ texture - Wraps a GPU-backed texture into
Surface. Caller must ensure the texture is valid for the lifetime of returnedSurface. Ifsample_cntgreater than zero, creates an intermediate MSAASurfacewhich is used for drawingbackend_texture.