GGUI::PaintState struct

PaintState: slot bookkeeping carried from one paint of a document to the next.

A visible node owns a power-of-two run of primitive slots and keeps it while visible: its primitives can change and grow up to that capacity without anything else moving. A node that outgrows its run gets a new one; a node that stops being visible returns its run to a free list. Clipping nodes keep a clip table entry the same way. The state describes exactly one snapshot: the last one painted.

Public types

struct View
Accumulated scroll offset, zoom, and group transform, and the visible region, for a node's content (GGSnapshot::View).
struct NestedClips
The clip entries a node showing a document inside (PaintNested) keeps: one for the document's unclipped primitives, then one per clip of its own.

Public static variables

static uint32_t RoomSizes constexpr
run sizes kept, by log2

Public variables

const GGSnapshot* Painted
the snapshot this state describes
std::vector<uint32_t> FreeRooms
free slot runs, by log2 size: first slot of each
uint32_t SlotEnd
one past the highest slot ever allocated
std::vector<uint16_t> FreeClips
free clip table entries
uint32_t ClipEnd
one past the highest entry ever allocated (entry 0 = unclipped)
std::vector<uint32_t> Shown
slots of visible nodes, in draw order
std::vector<uint32_t> Walked
scratch
std::vector<uint32_t> Order
scratch
uint32_t OrderSize
length of the last order written; used to reserve the next
std::vector<uint64_t> Seen
one bit per node slot
std::vector<uint64_t> Forced
one bit per node slot
std::vector<UIPrimitive> Out
GGLooks* Looks
Style cache to paint with (a document passes its own). Null: resolved per paint.
std::vector<uint16_t> ClipAt
std::vector<View> ViewAt
std::vector<NestedClips> NestedEntries
by node

Variable documentation

std::vector<UIPrimitive> GGUI::PaintState::Out

one node's primitives

std::vector<uint16_t> GGUI::PaintState::ClipAt

by depth: the clip the current node's children draw under

std::vector<View> GGUI::PaintState::ViewAt

by depth, like ClipAt