Donner SVG 0.8.0
0.8.0 ยท ebf353960.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::editor::FramePresentation Class Reference

Immutable, validated pixel/geometry binding used by every draw pass for a presented frame. More...

#include "donner/editor/FramePresentation.h"

Public Member Functions

const std::vector< PresentationPose > & overrides () const
 Objects still shown at a pose that has not been incorporated into their raster capture.
const std::optional< SelectionChromeSnapshot > & replacementPaint () const
 Solid vector paint replacing the raster layer at its original paint-order position.
std::uint64_t frameId () const
 Frame identity shared by both GPU passes and any diagnostic capture.
bool usesOverviewRaster () const
 Whether the frame selected the retained overview raster family.
Box2d rasterDocumentRect () const
 Author-space coverage of the raster family chosen for this immutable frame.
Vector2i rasterOutputSizePx () const
 Pixel dimensions of the raster family chosen for this immutable frame.
PresentationIdentity selectionIdentity () const
 Geometry source for selected objects, including a complete live vector replacement.
const PresentationIdentity & identity () const
 Raster/geometry provenance of this frame.
const ViewportState & viewport () const
 One camera used by both document and chrome.
const Box2d & paneClipRect () const
 Clip region shared by the document and editor chrome.
const std::optional< Box2d > & documentClipRect () const
 Visible artboard portion, captured with the camera.
Transform2d framebufferFromDocument (const Vector2d &framebufferFromLogicalScale) const
 Apply the target framebuffer scale to this frame's one document camera.
bool chromeEnabled () const
 Whether this frame includes editor chrome, rather than a content-only capture.
const std::vector< GlTextureCache::TileView > & tiles () const
 Active raster geometry already resolved to the chosen absolute poses.
const std::vector< GlTextureCache::TileView > & overviewTiles () const
 Compatible overview geometry; it never supplies a different selected-object pose.
const SelectionChromeSnapshot & chrome () const
 Selection geometry resolved from the same capture and mapping as the tiles.
const std::vector< Box2d > & selectionBounds () const
 Unculled selected bounds for hit testing and handles, including content-only captures.
bool hasSelectionGeometry () const
 Whether selection geometry belongs to this frame's selected object set.
bool followsPointer () const
 Whether the frame applied pointer intent to independently movable captured pixels.
const std::vector< PresentationPose > & poses () const
 Chosen absolute object poses, also used to derive selection geometry.
std::optional< svg::SVGGraphicsElement > pointerTargetAt (const Vector2d &point) const
 Resolve a screen point against the immutable geometry paired with this frame's raster.

Static Public Member Functions

static FramePresentationBuildResult Build (std::shared_ptr< const GlTextureCache::PresentationResources > resources, const FramePresentationInput &input, std::shared_ptr< const CapturedPresentation > selectionCapture=nullptr, std::shared_ptr< const FramePresentation > previous=nullptr)
 Resolve presentation from a complete resource manifest, without reading a live document.
static std::shared_ptr< const CapturedPresentation > CaptureForFrame (const std::shared_ptr< const GlTextureCache::PresentationResources > &resources, const FramePresentationInput &input)
 Select the exact raster source against which selection geometry may be recaptured.
static bool ActiveRasterCoversPane (const PresentationCoverageDiagnostics &coverage, const ViewportState &viewport, const Box2d &paneClipRect)
 Whether active raster coverage contains every visible artboard point in this pane.
static bool CanAdopt (const CapturedPresentation &capture, std::span< const RenderResult::CompositedTile > tiles, const FramePresentation *previous, bool latestCommittedScene=false)
 Check whether a candidate can preserve every affine pose already visible to the user.

Detailed Description

Immutable, validated pixel/geometry binding used by every draw pass for a presented frame.

Member Function Documentation

◆ ActiveRasterCoversPane()

bool donner::editor::FramePresentation::ActiveRasterCoversPane ( const PresentationCoverageDiagnostics & coverage,
const ViewportState & viewport,
const Box2d & paneClipRect )
staticnodiscard

Whether active raster coverage contains every visible artboard point in this pane.

Parameters
coverageActive raster extent and whether it is viewport-bounded.
viewportCamera mapping for the prospective frame.
paneClipRectLogical screen-space clip for that pane.

◆ Build()

FramePresentationBuildResult donner::editor::FramePresentation::Build ( std::shared_ptr< const GlTextureCache::PresentationResources > resources,
const FramePresentationInput & input,
std::shared_ptr< const CapturedPresentation > selectionCapture = nullptr,
std::shared_ptr< const FramePresentation > previous = nullptr )
staticnodiscard

Resolve presentation from a complete resource manifest, without reading a live document.

Parameters
resourcesAtomically published textures and matching captured scene.
inputThis UI frame's pointer, selection and camera intent.
selectionCaptureOptional new selection captured from exactly the same scene revision.
previousPrior frame, used to retain text adornments while newer text is rendering.
Returns
A sealed frame, or null when the resource/geometry binding is invalid.

◆ CanAdopt()

bool donner::editor::FramePresentation::CanAdopt ( const CapturedPresentation & capture,
std::span< const RenderResult::CompositedTile > tiles,
const FramePresentation * previous,
bool latestCommittedScene = false )
staticnodiscard

Check whether a candidate can preserve every affine pose already visible to the user.

Parameters
captureCandidate geometry and pose provenance.
tilesCandidate renderer-owned tile identities.
previousLast installed frame, or null before first presentation.
latestCommittedSceneTrue when capture is the current committed scene with no pending mutations; such a capture need not preserve poses previous still holds.

◆ CaptureForFrame()

std::shared_ptr< const CapturedPresentation > donner::editor::FramePresentation::CaptureForFrame ( const std::shared_ptr< const GlTextureCache::PresentationResources > & resources,
const FramePresentationInput & input )
staticnodiscard

Select the exact raster source against which selection geometry may be recaptured.

Parameters
resourcesComplete active/overview resource manifest.
inputCamera intent used by Build for the same frame.
Returns
Selected immutable capture, or null if no complete source covers this camera.

◆ framebufferFromDocument()

Transform2d donner::editor::FramePresentation::framebufferFromDocument ( const Vector2d & framebufferFromLogicalScale) const
inlinenodiscard

Apply the target framebuffer scale to this frame's one document camera.

Parameters
framebufferFromLogicalScalePhysical pixels per logical pixel on the target.

◆ pointerTargetAt()

std::optional< svg::SVGGraphicsElement > donner::editor::FramePresentation::pointerTargetAt ( const Vector2d & point) const
inline

Resolve a screen point against the immutable geometry paired with this frame's raster.

Parameters
pointScreen position in logical pixels.

The documentation for this class was generated from the following file: