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::CompositedPresentation Class Reference

Accepted composited presentation resources, plus the released drag intent retained until a render that represents it is accepted. More...

#include "donner/editor/CompositedPresentation.h"

Classes

struct  DiagnosticsSnapshot
 Detached metadata for scheduler, replay and inspector diagnostics. More...

Public Types

enum class  Phase {
  NoCache ,
  Cached ,
  SettlingForRender
}
 Closed presentation phases. A ready resource set already includes its chrome geometry.

Public Member Functions

DiagnosticsSnapshot diagnostics () const
 Inspect the accepted state without borrowing mutable state.
std::shared_ptr< const GlTextureCache::PresentationResources > resources () const
 Complete paired resources accepted for drawing.
std::shared_ptr< const CapturedPresentation > capturedPresentation () const
 Captured geometry used by non-window bitmap inspection as well as the UI.
bool hasCachedTextures () const
 Whether an accepted presentation cache exists.
bool hasCachedTexturesForEntity (Entity entity) const
 Whether the accepted presentation cache belongs to entity.
bool isWaitingForFullRender () const
 Whether a released drag is waiting for a render that represents its final poses.
std::optional< SelectTool::ActiveDragPreview > activePreviewForPresentation (const std::optional< SelectTool::ActiveDragPreview > &activePreview) const
 Retain the released absolute poses until a matching completed render is adopted.
std::optional< SelectTool::ActiveDragPreview > presentationPreview (const std::optional< SelectTool::ActiveDragPreview > &) const
 Return captured request metadata for diagnostics; never reinterpret its gesture basis.
bool represents (const SelectTool::ActiveDragPreview &active) const
 Whether a raster already represents all absolute poses requested by the pointer.
bool needsCompositedLayerCapture (const std::optional< SelectTool::ActiveDragPreview > &active, std::uint64_t, const Vector2i &, double translationRecaptureDistanceDoc=std::numeric_limits< double >::infinity()) const
 Determine whether a new raster is required for coverage or affine sampling quality.
bool needsSettledSelectionRefresh (Entity entity, std::uint64_t version) const
 Whether the released drag of entity is settling and version has reached the document version that represents its final poses, so its selection must be refreshed.
bool needsSettledLayerRasterization (Entity entity, std::uint64_t version) const
 Whether the settling drag of entity also needs a fresh layer raster: its selection needs a settled refresh and its retained transform is not a pure translation.
bool shouldPrewarm (Entity entity, const std::vector< Entity > &extraEntities, std::uint64_t version, const Vector2i &canvasSize, bool dragActive) const
 Whether a selection prewarm render should run for entity: no drag is active or settling, and the accepted cache does not already hold this entity, version, canvas size and set of entities moving with it.
void notePreparedResources (std::shared_ptr< const GlTextureCache::PresentationResources > resources, Entity entity, std::optional< SelectTool::ActiveDragPreview > representedPreview, bool currentCommittedScene=false)
 Adopt a fully prepared resource/geometry pair in one transition.
void noteCachedTextures (Entity entity, std::uint64_t version, const Vector2i &canvasSize, std::optional< SelectTool::ActiveDragPreview > representedPreview=std::nullopt, std::shared_ptr< const CapturedPresentation > capture=nullptr)
 Record a complete non-window raster cache, which does not own GPU registrations.
bool discardCachedTexturesForEntity (Entity entity)
 Invalidate the selected-layer cache key while retaining any complete scene for replacement.
void beginSettling (const std::optional< SelectTool::ActiveDragPreview > &preview, std::uint64_t targetVersion)
 Retain a released drag's preview until a render at targetVersion that represents its poses is accepted. Without a preview, only the accepted cache is kept.
void clearSettlingIfSelectionChanged (Entity entity, bool dragActive)
 Stop retaining a released intent after a different actual selection replaces it.

Detailed Description

Accepted composited presentation resources, plus the released drag intent retained until a render that represents it is accepted.


Class Documentation

◆ donner::editor::CompositedPresentation::DiagnosticsSnapshot

struct donner::editor::CompositedPresentation::DiagnosticsSnapshot

Detached metadata for scheduler, replay and inspector diagnostics.

Class Members
Vector2i cachedCanvasSize = Vector2i::Zero() Canvas dimensions of the retained cache, in pixels.
Entity cachedEntity = entt::null Entity associated with the retained presentation cache.
uint64_t cachedVersion = 0 Document frame version represented by the retained cache.
bool hasCachedTextures = false Whether a presentation texture cache is available.
Phase phase = Phase::NoCache Current cached-presentation lifecycle phase.
optional< ActiveDragPreview > settlingPreview Drag transform retained while the final raster result is pending.
uint64_t settlingTargetVersion = 0 Document frame version needed to finish drag settling.
bool waitingForFullRender = false Whether presentation is waiting for the final complete render.

Member Function Documentation

◆ beginSettling()

void donner::editor::CompositedPresentation::beginSettling ( const std::optional< SelectTool::ActiveDragPreview > & preview,
std::uint64_t targetVersion )
inline

Retain a released drag's preview until a render at targetVersion that represents its poses is accepted. Without a preview, only the accepted cache is kept.

Parameters
previewDrag state at release, or empty when nothing was dragged.
targetVersionDocument frame version expected to include the released poses.

◆ discardCachedTexturesForEntity()

bool donner::editor::CompositedPresentation::discardCachedTexturesForEntity ( Entity entity)
inline

Invalidate the selected-layer cache key while retaining any complete scene for replacement.

Parameters
entitySelected-layer owner being invalidated.

◆ hasCachedTexturesForEntity()

bool donner::editor::CompositedPresentation::hasCachedTexturesForEntity ( Entity entity) const
inlinenodiscard

Whether the accepted presentation cache belongs to entity.

Parameters
entitySelected-layer owner to compare.

◆ needsSettledLayerRasterization()

bool donner::editor::CompositedPresentation::needsSettledLayerRasterization ( Entity entity,
std::uint64_t version ) const
inlinenodiscard

Whether the settling drag of entity also needs a fresh layer raster: its selection needs a settled refresh and its retained transform is not a pure translation.

Parameters
entitySelected entity to check.
versionDocument frame version now available.

◆ needsSettledSelectionRefresh()

bool donner::editor::CompositedPresentation::needsSettledSelectionRefresh ( Entity entity,
std::uint64_t version ) const
inlinenodiscard

Whether the released drag of entity is settling and version has reached the document version that represents its final poses, so its selection must be refreshed.

Parameters
entitySelected entity to check.
versionDocument frame version now available.

◆ shouldPrewarm()

bool donner::editor::CompositedPresentation::shouldPrewarm ( Entity entity,
const std::vector< Entity > & extraEntities,
std::uint64_t version,
const Vector2i & canvasSize,
bool dragActive ) const
inlinenodiscard

Whether a selection prewarm render should run for entity: no drag is active or settling, and the accepted cache does not already hold this entity, version, canvas size and set of entities moving with it.

Parameters
entitySelected entity to prewarm.
extraEntitiesAdditional entities that move with entity.
versionCurrent document frame version.
canvasSizeCurrent canvas size in pixels.
dragActiveWhether a drag gesture is in progress.

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