Producer that pre-chunks a document into a small number of layers based on per-subtree rasterization cost. More...
#include "donner/svg/compositor/ComplexityBucketer.h"
Public Member Functions | |
| ComplexityBucketer (ComplexityBucketerConfig config={}) | |
| Create a bucketer with the supplied complexity thresholds. | |
| ComplexityBucketer (const ComplexityBucketer &)=delete | |
| ComplexityBucketer & | operator= (const ComplexityBucketer &)=delete |
| ComplexityBucketer (ComplexityBucketer &&) noexcept=default | |
| Transfer held bucket hints and their cleanup ownership. | |
| ComplexityBucketer & | operator= (ComplexityBucketer &&other) noexcept=default |
| Replace this bucketer's held hints and state with another's. | |
| void | reconcile (Registry ®istry) |
| Recompute the bucket partition for the current document state. | |
| void | clear () |
| Drop all held bucket hints. Callers use this when the registry is being reset (e.g. CompositorController::resetAllLayers) so stale bucket assignments don't linger into the rebuilt document. | |
| void | releaseAllHintsNoClean () |
| Like clear(), but releases each hint's registry pointer first so the dtor becomes a no-op. Used from CompositorController::resetAll
Layers after setDocument has replaced the entity space - the old CompositorHintComponents are already gone, and registry.valid() on the rebuilt registry would SIGSEGV against the stale entity IDs. | |
| void | rebuildForReplacedDocument (Registry &newRegistry) |
| Rebuild the bucket hint set against a new entity space after a structurally-identical setDocument. Mirror of MandatoryHint
Detector::rebuildForReplacedDocument - release the stale hints without touching the old entity ids, then run reconcile on the new registry. Because the bucketer's decisions are a pure function of the render-tree shape + complexity costs, a structurally-equal document produces the identical bucket set keyed on the new ids. | |
| const ComplexityBucketerStats & | stats () const |
| Statistics from the most recent bucket reconciliation. | |
| const ComplexityBucketerConfig & | config () const |
| Thresholds used for bucket selection. | |
Producer that pre-chunks a document into a small number of layers based on per-subtree rasterization cost.
Runs at document load and on structural rebuild (both callers control when; this class is stateless between calls other than its held hints).
Algorithm:
Restricting candidates to top-level root children sidesteps the deferred-pop correctness concern: by construction, top-level children have no isolation / clip / filter / mask ancestor (other than the root itself), so bucketing them cannot split a group that must stay atomic.
Candidate and work limits:
Held hints map (bucketHints_) is non-copyable, movable. The RAII pattern ensures dropped entries clean up their CompositorHintComponent entries.
|
inlineexplicit |
Create a bucketer with the supplied complexity thresholds.
| config | Thresholds and limits used when choosing bucket roots. |
|
defaultnoexcept |
Replace this bucketer's held hints and state with another's.
| other | Bucketer whose hint ownership is transferred. |
| void donner::svg::compositor::ComplexityBucketer::reconcile | ( | Registry & | registry | ) |
Recompute the bucket partition for the current document state.
Intended to be called on document load and when RenderTreeState::needsFullRebuild is true. Publishes new ComplexityBucket hints, drops stale ones, and updates stats. Idempotent on unchanged input.