Documentation
¶
Overview ¶
Package repaint keeps one surface's repaint bookkeeping between frames: the logical rects its widget tree owes, and, at paint time, the device rects a buffer from the surface's rotating pool must repaint, the buffer's own staleness included. Windows and popups draw through it alike.
Index ¶
- type Region
- func (r *Region) Add(bounds render.Rect, rects ...render.Rect)
- func (r *Region) Collect(root widget.Widget, bounds render.Rect) bool
- func (r *Region) Empty() bool
- func (r *Region) Full(bounds render.Rect)
- func (r *Region) Plan(b *buffer.Buffer, num int) (rects []render.Rect, changed, region render.Rect)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Region ¶
type Region struct {
// contains filtered or unexported fields
}
Region is the damage a surface owes its next frame. The zero value owes nothing and has drained no tree yet.
func (*Region) Add ¶
Add owes rects, clipped to bounds, besides what the tree drained: a focus ring that moved, or the whole surface.
func (*Region) Collect ¶
Collect drains root's invalidations into the region, clipped to bounds, the surface's logical rect: a widget may owe pixels outside it (an overflowing scroll child), and those must not keep a frame alive. It reports whether root owed anything, inside bounds or not.
func (*Region) Empty ¶
Empty reports whether nothing is owed: the frame can skip its buffer entirely.
func (*Region) Full ¶
Full owes the whole surface, bounds: a rescale, a renderer change, an overlay toggled over everything.
func (*Region) Plan ¶
Plan maps the owed rects onto b at device scale num/scale.Denom and clears them. rects is what the frame repaints and damages on the wire: the owed rects plus whatever b is stale in. changed is only what differs on screen after the commit, the owed rects without b's staleness: a fresh buffer's first paint covers the whole surface but changes nothing the screen did not already show, so the pool must not count it against the other buffers (buffer.Pool.Presented). region bounds rects, the clip the frame paints in. rects is reused by the next Plan.