|
|
Donner 0.8.0-pre
Embeddable browser-grade SVG2 engine
|
One composite tile from the worker's CompositorController:: snapshotCompositorTiles() snapshot (design doc 0033 §M2C). The editor uploads one GL texture per tile (keyed on id) and blits each tile at its canvas offset. Immediate tiles intentionally use transient ids and always carry a fresh payload. Geometry fields are doc-unit quantities so the editor can scale them by the current pixelsPerDocUnit during canvas-resize debouncing. More...
#include "donner/editor/AsyncRenderer.h"
Public Types | |
| enum class | Kind : std::uint8_t { Segment , Layer , Immediate } |
Public Attributes | |
| Kind | kind = Kind::Segment |
| std::string | id |
| Stable id from the compositor — "seg:{i}" or "layer:{entity}". The editor's per-tile texture cache uses this to reuse GL textures across frames when the tile's generation hasn't bumped. | |
| Entity | layerEntity = entt::null |
| Promoted entity represented by this layer tile. Null for static segment and full-canvas tiles. The presenter uses this to suppress stale cached pixels for a selected element that became non-rendering while keeping editor chrome visible. | |
| std::uint64_t | generation = 0 |
| Monotonic generation from the compositor. Editor re-uploads the bitmap only when this advances. | |
| svg::RendererBitmap | bitmap |
| Source bitmap; uploaded as the tile's GL texture content. | |
| std::shared_ptr< const svg::RendererTextureSnapshot > | textureSnapshot |
| Backend-owned texture payload. Geode editor builds present this directly via ImGui WGPU. | |
| Vector2i | bitmapDimsPx = Vector2i::Zero() |
| Intrinsic texture dimensions in raster pixels. Metadata-only tiles keep this populated so the presentation cache can reject stale texture reuse across canvas-size epochs. | |
| Vector2i | rasterCanvasSize = Vector2i::Zero() |
| Raster canvas size that produced this payload. Metadata-only reuse is only valid inside the same raster-canvas epoch. | |
| Vector2d | canvasOffsetDoc = Vector2d::Zero() |
| Canvas-space top-left of bitmap, in document units. Editor multiplies by pixelsPerDocUnit to get the on-screen blit origin. | |
| Vector2d | bitmapDimsDoc = Vector2d::Zero() |
| Bitmap's intrinsic dimensions, in document units. Editor multiplies by current pixelsPerDocUnit to get the on-screen blit size — keeps the bitmap stretching with pinch-zoom while the canvas-size commit is debounced. | |
| Vector2d | dragTranslationDoc = Vector2d::Zero() |
| For drag-target tiles, the per-frame DOM translation in doc units (the delta between the bitmap's rasterize-time DOM transform and the entity's current DOM transform). Editor adds this to canvasOffsetDoc so the dragged tile slides in real time without re-rasterizing. | |
| Transform2d | documentFromCachedDocument = Transform2d() |
| Affine transform from cached document placement to presented document placement. | |
| bool | isDragTarget = false |
| True when this tile is the active drag target. Useful for pre-test inspection; the editor's blit math treats drag and non-drag tiles uniformly via dragTranslationDoc. | |
One composite tile from the worker's CompositorController:: snapshotCompositorTiles() snapshot (design doc 0033 §M2C). The editor uploads one GL texture per tile (keyed on id) and blits each tile at its canvas offset. Immediate tiles intentionally use transient ids and always carry a fresh payload. Geometry fields are doc-unit quantities so the editor can scale them by the current pixelsPerDocUnit during canvas-resize debouncing.