Skip to content
Isthimius edited this page Jun 22, 2026 · 2 revisions

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.


What goes into a RefreshQueue

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

What happens next

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.


Important behavior

  • 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

Mental model

RefreshQueue answers: what changed in the world?

The View answers: where does that appear on screen?


Where to read next

  • Gondwana/Rendering/RefreshQueue.cs
  • Gondwana/Rendering/RenderSurfaceHost.cs

Clone this wiki locally