Documentation
¶
Overview ¶
Package raster draws scenes in memory: the software renderer behind headless rendering, window captures and windows without a GPU renderer. Coverage comes from signed distances to rounded rectangles, so edges, corners and clips are anti-aliased the way the GPU shaders do it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClipMask ¶
ClipMask updates a retained coverage image for nested clips in area. GPU renderers cache this independently of the content within a clip, so moving content under a stationary clip costs no CPU pixel work.
A row works out coverage only near the clips' edges: it is 0 outside a clip's bounds and 1 within the span every clip without a transform covers entirely, filled a run at a time. Large masks take several cores.
Types ¶
type Image ¶
Image is a premultiplied BGRA bitmap, the layout Windows DIBs, cairo and Core Graphics take.
type Renderer ¶
type Renderer struct {
// Image holds the last scene drawn, in mem.
Image Image
// contains filtered or unexported fields
}
Renderer draws the successive scenes of a window into Image, redrawing only where a scene differs from the one before (scene.Differ): a blinking caret, a ticking clock or a button under the pointer redraws only itself.
func (*Renderer) Invalidate ¶
func (r *Renderer) Invalidate()
Invalidate makes the next Render draw everything.