Package paint provides drawing operations for 2D graphics.
The PaintOp operation draws the current brush into a rectangular area, taking the current clip path and transformation into account.
The current brush is set by either a ColorOp for a constant color, or ImageOp for an image.
ColorOp sets the brush to a constant color.
ImageOp sets the brush to an image.
Note: the ImageOp may keep a reference to the backing image. See NewImageOp for details.
NewImageOp creates an ImageOp backed by src. See gioui.org/io/system.FrameEvent for a description of when data referenced by operations is safe to re-use.
NewImageOp assumes the backing image is immutable, and may cache a copy of its contents in a GPU-friendly way. Create new ImageOps to ensure that changes to an image is reflected in the display of it.
PaintOp fills an area with the current brush, respecting the current clip path and transformation.