Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
CompositorController.h File Reference
Include dependency graph for CompositorController.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::svg::compositor::CompositorTile
 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...
struct  donner::svg::compositor::CompositorConfig
 Runtime feature gates for CompositorController. More...
class  donner::svg::compositor::CompositorController
 Controls compositor layer promotion/demotion and orchestrates composited rendering. More...
struct  donner::svg::compositor::CompositorController::FastPathCounters
 Diagnostic counters for the translation-only fast path. Tests read these to assert that a drag is taking the fast path every frame, not falling through to prepareDocumentForRendering. More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.
namespace  donner::svg
 Donner SVG library, which can load, manipulate and render SVG files.

Functions

std::unordered_map< Entity, Entitydonner::svg::compositor::BuildStructuralEntityRemap (const SVGDocument &oldDoc, const SVGDocument &newDoc)
 Walk the XML trees of oldDoc and newDoc in lockstep and build a remap from old-registry entity ids → new-registry entity ids, suitable for CompositorController::remapAfterStructuralReplace.

Variables

constexpr int donner::svg::compositor::kMaxCompositorLayers = 32
 Maximum number of compositor layers that can be simultaneously active.
constexpr size_t donner::svg::compositor::kMaxCompositorMemoryBytes = 256 * 1024 * 1024
 Maximum total memory budget for compositor layer bitmaps, in bytes.

Class Documentation

◆ donner::svg::compositor::CompositorController::FastPathCounters

struct donner::svg::compositor::CompositorController::FastPathCounters

Diagnostic counters for the translation-only fast path. Tests read these to assert that a drag is taking the fast path every frame, not falling through to prepareDocumentForRendering.

Class Members
uint64_t fastPathFrames = 0 Incremented every frame that takes the fast path and successfully handled every dirty entity via a compose-transform update.
uint64_t noDirtyFrames = 0 Incremented every frame where the fast-path eligibility check wasn't reached because no entities were dirty (e.g. page-load, selection-change-only frames).
uint64_t slowPathFramesWithDirty = 0 Incremented every frame whose dirty-entity set disqualified the fast path (transform+other flags, subtree with non-translation delta, missing layer, etc.) and fell through to the slow path.

Function Documentation

◆ BuildStructuralEntityRemap()

std::unordered_map< Entity, Entity > donner::svg::compositor::BuildStructuralEntityRemap ( const SVGDocument & oldDoc,
const SVGDocument & newDoc )
nodiscard

Walk the XML trees of oldDoc and newDoc in lockstep and build a remap from old-registry entity ids → new-registry entity ids, suitable for CompositorController::remapAfterStructuralReplace.

Returns an empty map if the two trees are not structurally equivalent — defined as: same preorder walk, same element tag name at every step, and same id attribute at every step (or neither has one). Attribute values other than id are allowed to differ — the drag-end writeback case changes transform values, not tree shape.

The returned map covers every element visited in the walk. The caller is responsible for handing it to remapAfterStructuralReplace on the compositor that was previously tracking oldDoc's entity space.