Donner SVG main
0.8.0 ยท 766e862a0.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
RetainedRenderTreeUpdate.h File Reference

Retained render-tree updates: apply a frame's DOM changes without tearing down and recomputing the whole document, when every change is one the computed components do not depend on. More...

#include <optional>
#include <vector>
#include "donner/base/EcsRegistry.h"
#include "donner/base/ParseWarningSink.h"
#include "donner/base/RcString.h"
#include "donner/svg/components/style/StylePassScheduler.h"
Include dependency graph for RetainedRenderTreeUpdate.h:

Classes

struct  donner::svg::components::RetainedUpdatePlan
 The work a retained update performs, collected while checking that a frame's dirty set qualifies for one. 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.
namespace  donner::svg::components
 Contains the implementation of the Donner ECS,.

Functions

std::optional< RetainedUpdatePlan > donner::svg::components::PlanRetainedUpdate (Registry &registry)
 Check whether the current dirty set of registry qualifies for a retained update, and plan it.
void donner::svg::components::ApplyRetainedUpdate (Registry &registry, const RetainedUpdatePlan &plan, ParseWarningSink &warningSink, StylePassScheduler scheduler={})
 Bring the computed components of registry up to date for a frame planned by PlanRetainedUpdate.
void donner::svg::components::AttachExternalUse (Registry &registry, Entity entity, const RcString &href, ParseWarningSink &warningSink)
 Give an external <use> the document its reference names, as an ExternalUseComponent.

Detailed Description

Retained render-tree updates: apply a frame's DOM changes without tearing down and recomputing the whole document, when every change is one the computed components do not depend on.


Class Documentation

◆ donner::svg::components::RetainedUpdatePlan

struct donner::svg::components::RetainedUpdatePlan

The work a retained update performs, collected while checking that a frame's dirty set qualifies for one.

A dirty set qualifies when every change only moves content (a transform write), changes how it is composited (an opacity write), points an external <use> at another external instance, or only requires an element to redraw content it draws through a reference (an feImage of a moved element). None of these changes any input of the computed styles of other elements, the shadow trees, the computed paths, text layout, paint servers or filter graphs, so those are kept, and the render instances are rebuilt from them. Anything else, or any case where one of these changes could reach a computed component (for example a moved element that a shadow tree clones, or that a <textPath> follows), takes the full rebuild.

Class Members
vector< Entity > layoutEntities Entities whose computed layout was dropped by a transform write.
bool restyle = false Whether any entity needs its style recomputed through the selective style pass.
vector< Entity > retargetedUses External <use> elements that were retargeted to another external instance.