Rendering controller, which instantiates and and manages the rendering tree.
More...
#include "donner/svg/renderer/RenderingContext.h"
|
| using | InitialPaintState |
| | Owned paint state saved and restored under a sub-document's write guard.
|
|
| std::optional< std::vector< HitRecord > > | captureHitGeometry (std::size_t maximumRecords=65536, std::size_t maximumPathBytes=32 *1024 *1024) |
| | Capture bounded hit geometry; nullopt rejects the whole snapshot on budget exhaustion.
|
|
| RenderingContext (Registry ®istry) |
| | Constructor.
|
| void | instantiateRenderTree (bool verbose, ParseWarningSink &warningSink) |
| | Create the render tree for the document, optionally returning parse warnings found when parsing deferred parts of the tree.
|
| void | ensureComputedComponents (ParseWarningSink &warningSink) |
| | Create all computed components needed for text/layout/style queries without instantiating render instances.
|
| Entity | findIntersecting (const Vector2d &point, HitTestMode mode=HitTestMode::SvgPointerEvents) |
| | Find the first entity that intersects the given point, using spatial acceleration when the document has enough elements.
|
| std::vector< Entity > | findAllIntersecting (const Vector2d &point, HitTestMode mode=HitTestMode::SvgPointerEvents) |
| | Find all entities that intersect the given point, ordered front-to-back.
|
| std::vector< Entity > | findIntersectingRect (const Box2d &rect) |
| | Find all entities whose world-space bounds intersect the given rectangle, ordered front-to-back.
|
| std::optional< Box2d > | getWorldBounds (Entity entity) |
| | Get the world-space bounding box of an entity (fill bounds only, not including stroke).
|
|
void | invalidateRenderTree () |
| | Invalidate the rendering tree, forcing it to be recreated on the next render.
|
|
std::optional< FeImageSubtreeResult > | createFeImageShadowTree (Entity hostEntity, Entity targetEntity, bool verbose) |
| | Create a shadow tree for an feImage fragment reference, allowing elements inside <defs> to be rendered offscreen.
|
| void | setInitialContextPaint (const ResolvedPaintServer &fill, const ResolvedPaintServer &stroke) |
| | Set initial context-fill and context-stroke values for sub-document rendering.
|
| void | clearInitialContextPaint () |
| | Clear previously set context-fill and context-stroke values.
|
|
InitialPaintState | initialPaintState () const |
| | Return the owned context paints for restoration after a scoped external-use render.
|
|
void | restoreInitialPaintState (InitialPaintState state) |
| | Restore the state that preceded a scoped external-use occurrence.
|
Rendering controller, which instantiates and and manages the rendering tree.
Used during the rendering phase in combination with the rendering backend.
◆ donner::svg::components::RenderingContext::HitRecord
| struct donner::svg::components::RenderingContext::HitRecord |
Owned geometry and internal target identity in front-to-back paint order.
◆ donner::svg::components::RenderingContext::FeImageSubtreeResult
| struct donner::svg::components::RenderingContext::FeImageSubtreeResult |
Result from createFeImageShadowTree.
| Class Members |
|
Entity |
firstEntity |
First entity in the shadow subtree. |
|
Entity |
lastEntity |
Last entity in the shadow subtree. |
◆ InitialPaintState
Initial value:
std::pair<std::optional<ResolvedPaintServer>, std::optional<ResolvedPaintServer>>
Owned paint state saved and restored under a sub-document's write guard.
◆ captureHitGeometry()
| std::optional< std::vector< HitRecord > > donner::svg::components::RenderingContext::captureHitGeometry |
( |
std::size_t | maximumRecords = 65536, |
|
|
std::size_t | maximumPathBytes = 32 *1024 *1024 ) |
Capture bounded hit geometry; nullopt rejects the whole snapshot on budget exhaustion.
- Parameters
-
| maximumRecords | Lowerable instance budget, capped at 65536. |
| maximumPathBytes | Lowerable path-storage budget, capped at 32 MiB. |
◆ clearInitialContextPaint()
| void donner::svg::components::RenderingContext::clearInitialContextPaint |
( |
| ) |
|
Clear previously set context-fill and context-stroke values.
Call after rendering a sub-document to prevent stale context paint from leaking to subsequent renders of the same cached sub-document handle.
◆ ensureComputedComponents()
| void donner::svg::components::RenderingContext::ensureComputedComponents |
( |
ParseWarningSink & | warningSink | ) |
|
Create all computed components needed for text/layout/style queries without instantiating render instances.
- Parameters
-
| warningSink | Sink to collect warnings. |
◆ EventTargetEntity()
| Entity donner::svg::components::RenderingContext::EventTargetEntity |
( |
const Registry & | registry, |
|
|
Entity | entity ) |
|
static |
Map a rendered entity to the document-tree element that receives its pointer events.
Content instantiated by <use> lives in a shadow tree that is rebuilt with the render tree. As in SVG 2, events on those instances target the <use> element, the outermost one for nested instances. Offscreen content (patterns, masks, markers and feImage fragments) is painted as part of the element that references it and receives no events.
- Parameters
-
- Returns
- The document-tree entity, or entt::null for offscreen content.
◆ findAllIntersecting()
Find all entities that intersect the given point, ordered front-to-back.
- Parameters
-
| point | Point to find intersecting entities for |
| mode | Hit eligibility policy. |
◆ findIntersecting()
Find the first entity that intersects the given point, using spatial acceleration when the document has enough elements.
Offscreen content is never hit; a hit on <use> content returns its shadow entity, see EventTargetEntity.
- Parameters
-
| point | Point to find the intersecting entity for |
| mode | Hit eligibility policy. |
◆ findIntersectingRect()
| std::vector< Entity > donner::svg::components::RenderingContext::findIntersectingRect |
( |
const Box2d & | rect | ) |
|
Find all entities whose world-space bounds intersect the given rectangle, ordered front-to-back.
Uses the spatial grid for acceleration when available.
- Parameters
-
| rect | Rectangle in world coordinates to test intersection against |
◆ getWorldBounds()
| std::optional< Box2d > donner::svg::components::RenderingContext::getWorldBounds |
( |
Entity | entity | ) |
|
Get the world-space bounding box of an entity (fill bounds only, not including stroke).
- Parameters
-
| entity | Entity to get bounds for |
- Returns
- The world-space AABB, or std::nullopt if the entity has no shape
◆ instantiateRenderTree()
| void donner::svg::components::RenderingContext::instantiateRenderTree |
( |
bool | verbose, |
|
|
ParseWarningSink & | warningSink ) |
Create the render tree for the document, optionally returning parse warnings found when parsing deferred parts of the tree.
- Parameters
-
| verbose | If true, enable verbose logging. |
| warningSink | Sink to collect warnings. |
◆ setInitialContextPaint()
Set initial context-fill and context-stroke values for sub-document rendering.
When a <use> element references an external SVG, the <use> element's resolved fill and stroke become the initial context-fill/context-stroke in the sub-document.
- Parameters
-
| fill | Initial context-fill value. |
| stroke | Initial context-stroke value. |
The documentation for this class was generated from the following file: