Skip to main content
Provides functions for drawing paths and images, managing clipping, and applying transforms during rendering.

Methods

drawPath

drawPath(path: Path, paint: Paint)
Provides functions for drawing paths and images, managing clipping, and applying transforms during rendering. Draws the given path using the specified paint.

drawImage

drawImage(image: Image, sampler: ImageSampler,  blendMode: BlendMode, opacity: number)
Draws an image using the specified sampler, blend mode, and opacity.

drawImageMesh

drawImageMesh(image: Image, sampler: ImageSampler, vertices: VertexBuffer, uvs: VertexBuffer, triangles: TriangleBuffer, blendMode: BlendMode, opacity: number)
Draws an image using mesh data defined by vertices, texture coordinates, and triangle indices.

clipPath

clipPath(path: Path)
Restricts subsequent drawing to the area defined by the given path. Clipping remains in effect until the next restore call.

save

save()
Saves the current rendering state, including transforms and clipping.

restore

restore()
Restores the most recently saved rendering state.

transform

transform(transform: Mat2D)
Applies a transform to the current rendering state. Transforms are applied cumulatively until restored.