vizia::vg::gpu::ganesh

Module images

Functions§

  • Creates GPU-backed Image from backend_texture associated with context. Skia will assume ownership of the resource and will release it when no longer needed. A non-null Image is returned if format of backend_texture is recognized and supported. Recognized formats vary by GPU backend.
  • Creates GPU-backed Image from the provided GPU texture associated with context. GPU texture must stay valid and unchanged until texture_release_proc is called by Skia. Skia will call texture_release_proc with the passed-in release_context when Image is deleted or no longer refers to the texture. A non-null Image is returned if format of backend_texture is recognized and supported. Recognized formats vary by GPU backend. Note: When using a DDL recording context, texture_release_proc will be called on the GPU thread after the DDL is played back on the direct context.
  • Creates a GPU-backed Image from pixmap. It is uploaded to GPU backend using context. Created Image is available to other GPU contexts, and is available across thread boundaries. All contexts must be in the same GPU share group, or otherwise share resources. When Image is no longer referenced, context releases texture memory asynchronously. ColorSpace of Image is determined by pixmap.color_space(). Image is returned referring to GPU backend if context is not None, format of data is recognized and supported, and if context supports moving resources between contexts. Otherwise, pixmap pixel data is copied and Image as returned in raster format if possible; None may be returned. Recognized GPU formats vary by platform and GPU backend.
  • Retrieves the existing backend texture. If Image is not a Ganesh-backend texture image or otherwise does not have such a texture, false is returned. Otherwise, returned will be set to the image’s texture.
  • Returns subset of this image as a texture-backed image.
  • Creates a GPU-backed Image from compressed data. This method will return an Image representing the compressed data. If the GPU doesn’t support the specified compression method, the data will be decompressed and then wrapped in a GPU-backed image. Note: one can query the supported compression formats via RecordingContext::compressed_backend_format.
  • Returns Image backed by GPU texture associated with context. Returned Image is compatible with Surface created with dst_color_space. The returned Image respects mipmapped setting; if mipmapped equals Mipmapped::Yes, the backing texture allocates mip map levels. The mipmapped parameter is effectively treated as No if MIP maps are not supported by the GPU. Returns original Image if the image is already texture-backed, the context matches, and mipmapped is compatible with the backing GPU texture. skgpu::Budgeted is ignored in this case. Returns None if context is None, or if Image was created with another DirectContext.
  • Creates a GPU-backed Image from YUVAPixmaps. The image will remain planar with each plane converted to a texture using the passed RecordingContext. YUVAPixmaps has a YUVAInfo which specifies the transformation from YUV to RGB. The ColorSpace of the resulting RGB values is specified by image_color_space. This will be the ColorSpace reported by the image and when drawn the RGB values will be converted from this space into the destination space (if the destination is tagged). Currently, this is only supported using the GPU backend and will fail if context is None. YUVAPixmaps does not need to remain valid after this returns.
  • Creates a GPU-backed Image from YUV[A] planar textures. This requires that the textures stay valid for the lifetime of the image. The ReleaseContext can be used to know when it is safe to either delete or overwrite the textures. If ReleaseProc is provided it is also called before return on failure.