Module vizia_core::vg::gpu::surfaces

Functionsยง

  • Retrieves the back-end render target. If Surface has no back-end render target, None is returned.
  • Retrieves the back-end texture. If Surface has no back-end texture, None is returned.
  • 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.
  • 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.
  • Wraps a GPU-backed buffer into Surface. Caller must ensure backend_render_target is valid for the lifetime of returned Surface.
  • 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.