|
| static void | PrepareOccurrence (Registry ®istry) |
| | Prepare the referenced document's styles for the occurrence installed in its ExternalUseStyleContext.
|
| static void | PrepareInstance (Registry ®istry) |
| | Once the occurrence's instance layout is in place, schedule an instance rebuild when the render tree was last built for a different occurrence: another root, paint, or viewport the <use> establishes for a <symbol> or <svg>.
|
| static void | ScheduleFullRestyle (Registry ®istry) |
| | Schedule a restyle of every element and a full render-tree rebuild of the document.
|
| static bool | RestoreOtherSubtreesIfReadingOutside (Registry ®istry) |
| | After the render tree is instantiated for the installed occurrence, restore every other retained subtree to the document's own styles if drawing the occurrence may read any element outside its own subtree: a paint server, clip path, mask, marker, filter, instantiated element, inherited paint server, or a feImage, textPath or mpath target.
|
| static void | FinishOccurrence (Registry ®istry) |
| | End the installed occurrence's draw, before its context is removed.
|
| static void | RestoreStandalone (Registry ®istry) |
| | Restyle every subtree an occurrence styled and drop the occurrence's rendering instances and context paint, so the document renders and reads with its own styles.
|
| static void | RestoreStandaloneForRead (Registry ®istry) |
| | Before a public read of computed or derived state (styles, stops, text metrics, layout transforms, shape geometry and bounds, rendering instances): if an occurrence styled the document, restore it with RestoreStandalone and prepare its render tree again, since restoring drops layout state that reads expect the preparation to have computed.
|
| static bool | IsOccurrenceStyled (const Registry ®istry, Entity entity) |
| | Whether entity's computed style currently reflects an occurrence rather than its document.
|
| static bool | HasOccurrenceState (const Registry ®istry) |
| | Whether any occurrence state is retained, so the document's rendering instances may reflect an occurrence.
|
Keeps a document referenced by external <use> elements styled for the occurrences that draw it, instead of restyling the whole document for every occurrence on every frame.
An occurrence's inherited style only reaches the subtree of the element it references, so each referenced subtree stays styled for the inputs it was last drawn with: the element, the host's computed style for the <use>, and its fill and stroke. A draw with the same inputs reuses the subtree's computed state; changed inputs restyle only that subtree. The state lives in the referenced document's registry context.
Only occurrences whose fill and stroke are none or a solid color are retained; one painted with a gradient or pattern reference is restyled for every draw and restored afterwards, so no state outliving a draw refers to the host document. Public reads of the document's own styles and rendering restore it with RestoreStandalone first.
| void donner::svg::components::ExternalUseStyleRetention::PrepareInstance |
( |
Registry & | registry | ) |
|
|
static |
Once the occurrence's instance layout is in place, schedule an instance rebuild when the render tree was last built for a different occurrence: another root, paint, or viewport the <use> establishes for a <symbol> or <svg>.
A full rebuild is scheduled instead when the subtree holds a <use> whose shadow tree a rebuild for another root left uninstantiated.
- Parameters
-
| registry | Referenced document's registry, with its occurrence context installed. |
| bool donner::svg::components::ExternalUseStyleRetention::RestoreOtherSubtreesIfReadingOutside |
( |
Registry & | registry | ) |
|
|
static |
After the render tree is instantiated for the installed occurrence, restore every other retained subtree to the document's own styles if drawing the occurrence may read any element outside its own subtree: a paint server, clip path, mask, marker, filter, instantiated element, inherited paint server, or a feImage, textPath or mpath target.
What such an element pulls in can reach any other subtree, so a self-contained subtree is the only one drawn next to retained subtrees.
- Parameters
-
| registry | Referenced document's registry, with its occurrence context installed. |
- Returns
- True if a subtree was restored, in which case the caller instantiates the render tree again before drawing.
| void donner::svg::components::ExternalUseStyleRetention::RestoreStandaloneForRead |
( |
Registry & | registry | ) |
|
|
static |
Before a public read of computed or derived state (styles, stops, text metrics, layout transforms, shape geometry and bounds, rendering instances): if an occurrence styled the document, restore it with RestoreStandalone and prepare its render tree again, since restoring drops layout state that reads expect the preparation to have computed.
Call under write access. A read-only accessor that cannot restore reports no value for occurrence-derived state instead.
- Parameters
-
| registry | Document registry. |