|
|
Donner 0.8.0-pre
Embeddable browser-grade SVG2 engine
|
A single bitmap cache unit the compositor exposes for GPU upload — either a static segment (non-promoted content between promoted layers) or a promoted layer's own rasterization. More...
#include "donner/svg/compositor/CompositorController.h"
Public Attributes | |
| uint64_t | tileId = 0 |
| Stable id for this tile's slot in the compositor's cache topology. Segments are (0..N), layers are (1'<<31) | entityId so the two namespaces don't collide. Editor uses the tileId as the key in its GL texture cache — so as long as the compositor reuses the same tileId for a preserved bitmap, the editor keeps its texture. | |
| uint64_t | generation = 0 |
| Monotonic version counter, bumped every time this tile's pixel content is re-rasterized. Editor uploads to GL only when the generation differs from the one it last uploaded for this tileId. On the first click-to-drag after page load, at most 3 tile generations advance — the split segment's two halves and the new drag-target layer — because every other segment / filter layer keeps its identity across the layer-set change. | |
| uint32_t | paintOrderIndex = 0 |
| Position in paint order among the full compositor output. Editor composites tiles by blitting in ascending paintOrderIndex. | |
| RendererBitmap | bitmap |
| Owned bitmap payload. Empty when the snapshot policy omits this tile's pixels or when the tile has no rendered content. | |
| std::shared_ptr< const RendererTextureSnapshot > | textureSnapshot |
| Optional backend-owned GPU texture payload. Present when the renderer can expose this tile without CPU readback. | |
| Vector2i | bitmapDims = Vector2i::Zero() |
| Source bitmap dimensions, even when bitmap is intentionally omitted. | |
| Entity | layerEntity = entt::null |
| Non-null for a promoted layer tile: the promoted entity id. Null for a static segment tile. | |
| Vector2d | canvasOffsetPx = Vector2d::Zero() |
| Canvas-space top-left where the tile's bitmap blits back, in canvas pixels at rasterize time (design doc 0033 §M2C). For segments this is staticSegmentOffsets_[i] (non-zero on the tight-bounded path, design doc 0027); for layers this is CompositorLayer::canvasOffset() (non-zero for intrinsic-sized rasters, design doc 0033 §M2A). The editor's blit math is Translate(canvasOffsetPx) * canvasFromBitmap. | |
| Transform2d | canvasFromBitmap |
| canvasFromBitmap transform the tile should be drawn with: maps the bitmap's local pixel grid into canvas pixels. Identity for segments and for non-drag layers; pure translation for the drag layer when the fast path has updated its offset. | |
| bool | isDragTarget = false |
| True when this tile is the active drag-target layer. The editor uses this both for diagnostic highlighting and as the cue to route the live pre-commit DOM delta through canvasFromBitmap on the GPU side. | |
| bool | immediate = false |
| True when this segment or promoted layer should be presented as a transient immediate-mode tile instead of a persistent presentation texture. | |
A single bitmap cache unit the compositor exposes for GPU upload — either a static segment (non-promoted content between promoted layers) or a promoted layer's own rasterization.
The caller (editor) holds a texture per tile keyed on tileId, and only re-uploads to the GPU when generation advances. The compositor composites these in paint-order (paintOrderIndex) on the editor side.
| RendererBitmap donner::svg::compositor::CompositorTile::bitmap |
Owned bitmap payload. Empty when the snapshot policy omits this tile's pixels or when the tile has no rendered content.
| Vector2i donner::svg::compositor::CompositorTile::bitmapDims = Vector2i::Zero() |
Source bitmap dimensions, even when bitmap is intentionally omitted.
| Transform2d donner::svg::compositor::CompositorTile::canvasFromBitmap |
canvasFromBitmap transform the tile should be drawn with: maps the bitmap's local pixel grid into canvas pixels. Identity for segments and for non-drag layers; pure translation for the drag layer when the fast path has updated its offset.
| Vector2d donner::svg::compositor::CompositorTile::canvasOffsetPx = Vector2d::Zero() |
Canvas-space top-left where the tile's bitmap blits back, in canvas pixels at rasterize time (design doc 0033 §M2C). For segments this is staticSegmentOffsets_[i] (non-zero on the tight-bounded path, design doc 0027); for layers this is CompositorLayer::canvasOffset() (non-zero for intrinsic-sized rasters, design doc 0033 §M2A). The editor's blit math is Translate(canvasOffsetPx) * canvasFromBitmap.
| uint64_t donner::svg::compositor::CompositorTile::generation = 0 |
Monotonic version counter, bumped every time this tile's pixel content is re-rasterized. Editor uploads to GL only when the generation differs from the one it last uploaded for this tileId. On the first click-to-drag after page load, at most 3 tile generations advance — the split segment's two halves and the new drag-target layer — because every other segment / filter layer keeps its identity across the layer-set change.
| bool donner::svg::compositor::CompositorTile::immediate = false |
True when this segment or promoted layer should be presented as a transient immediate-mode tile instead of a persistent presentation texture.
| bool donner::svg::compositor::CompositorTile::isDragTarget = false |
True when this tile is the active drag-target layer. The editor uses this both for diagnostic highlighting and as the cue to route the live pre-commit DOM delta through canvasFromBitmap on the GPU side.
| Entity donner::svg::compositor::CompositorTile::layerEntity = entt::null |
Non-null for a promoted layer tile: the promoted entity id. Null for a static segment tile.
| uint32_t donner::svg::compositor::CompositorTile::paintOrderIndex = 0 |
Position in paint order among the full compositor output. Editor composites tiles by blitting in ascending paintOrderIndex.
| std::shared_ptr<const RendererTextureSnapshot> donner::svg::compositor::CompositorTile::textureSnapshot |
Optional backend-owned GPU texture payload. Present when the renderer can expose this tile without CPU readback.
| uint64_t donner::svg::compositor::CompositorTile::tileId = 0 |
Stable id for this tile's slot in the compositor's cache topology. Segments are (0..N), layers are (1'<<31) | entityId so the two namespaces don't collide. Editor uses the tileId as the key in its GL texture cache — so as long as the compositor reuses the same tileId for a preserved bitmap, the editor keeps its texture.