import { type Surface } from "https://deno.land/x/canvas@v1.3.0/src/canvaskit.ts";
Methods
Clean up the surface and any extra memory. [Deprecated]: In the future, calls to delete() will be sufficient to clean up the memory.
Return a canvas that is backed by this surface. Any draws to the canvas will (eventually) show up on the surface. The returned canvas is owned by the surface and does NOT need to be cleaned up by the client.
Returns the ImageInfo associated with this surface.
Creates an Image from the provided texture and info. The Image will own the texture; when the image is deleted, the texture will be cleaned up.
Returns a texture-backed image based on the content in src. It uses RGBA_8888, unpremul and SRGB - for more control, use makeImageFromTexture.
Not available for software-backed surfaces.
Returns current contents of the surface as an Image. This image will be optimized to be drawn to another surface of the same type. For example, if this surface is backed by the GPU, the returned Image will be backed by a GPU texture.
Returns a compatible Surface, haring the same raster or GPU properties of the original. The pixels are not shared.