-
Notifications
You must be signed in to change notification settings - Fork 2
Refresh Queues
A RefreshQueue is Gondwana’s core dirty-region data structure. It is used solely with the CPU-backed BitmapBackbuffer.
Each SceneLayer owns one. It stores world-space rectangles that need to be redrawn.
That detail matters: refresh queues are not screen-space and not adapter-space. They are world-space first.
Whenever something changes visually in a layer, the engine can enqueue a world-pixel rectangle representing the affected area.
Examples include:
- sprite motion
- tile changes
- layer-origin changes
- redraw requests caused by camera/view changes
- screen-space overlay invalidation projected back into world space
Later, during rendering, each View converts those world rects into screen-space dirty rectangles for that particular camera/viewport/parallax combination.
That is the key design win: one world-space change can be projected differently by different views.
- containment checks prevent storing redundant rects
- thread hops are marshaled back to the engine thread
- rendering consumes snapshots of the queue
- queues are cleared after the frame is rendered
RefreshQueue answers: what changed in the world?
The View answers: where does that appear on screen?
Gondwana/Rendering/RefreshQueue.csGondwana/Rendering/RenderSurfaceHost.cs