-
Notifications
You must be signed in to change notification settings - Fork 2
Rendering Pipeline
Isthimius edited this page Jun 22, 2026
·
3 revisions
Gondwana’s render path is intentionally explicit. Bitmap backbuffers use dirty-region redraw to avoid unnecessary CPU-side pixel work. GPU backbuffers, by contrast, render through a GPU-backed SKSurface, where the engine can favor full-frame redraw and let the GPU/Skia pipeline handle the heavier lifting.
Each engine cycle does two broad things:
- pre-cycle timers
- input polling
- animation advancement
- sprite movement
- collision resolution
- camera updates
- direct drawing updates
- render visible views into backbuffers
- present backbuffers to adapters
- post-cycle timers
- If the scene needs a full refresh, visible world regions are enqueued for each layer
- Each view collects dirty world rectangles and converts them to screen-space rectangles
- Dirty screen areas are pre-cleared
- Each visible layer redraws only drawables intersecting those dirty world regions
- View-level direct drawings are rendered on top
- Backbuffer dirty screen area is presented to the platform adapter
GPU surfaces currently take a different path: they redraw the full viewport each GL paint. This avoids cross-thread refresh-queue races and fits the GL-thread ownership model better.
The engine separates:
- what changed (RefreshQueue)
- what is visible (View)
- what gets drawn (Backbuffer)
- how it reaches the screen (RenderSurfaceAdapterBase)
That keeps the core engine predictable and platform-agnostic.
Gondwana/Engine.csGondwana/Rendering/RenderSurfaceHost.csGondwana/Rendering/Backbuffers/