Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::editor::DocumentPresentationCompositor Class Reference

Composes cached non-WGPU document tiles into one transparent GL texture. More...

#include "donner/editor/DocumentPresentationCompositor.h"

Public Member Functions

 DocumentPresentationCompositor (const DocumentPresentationCompositor &)=delete
DocumentPresentationCompositor & operator= (const DocumentPresentationCompositor &)=delete
DocumentCompositeTextureView compose (const ViewportState &viewport, const Box2d &imageClipRect, std::span< const GlTextureCache::TileView > overviewTiles, std::span< const GlTextureCache::TileView > tiles, const std::optional< SelectTool::ActiveDragPreview > &activeDragPreview, const std::optional< SelectTool::ActiveDragPreview > &displayedDragPreview, Entity suppressedLayerEntity, bool suppressDragTargetTiles)
 Compose the current document presentation into one pane-sized texture.
void reset ()
 Invalidate the cached request and clear its presented view while retaining allocations.
std::uint64_t retainedBytes () const
 Bytes retained by the two RGBA8 intermediate textures.
std::uint64_t compositionCountForTesting () const
 Number of cache-miss compositions, exposed for deterministic performance tests.

Detailed Description

Composes cached non-WGPU document tiles into one transparent GL texture.

The compositor preserves each tile's full affine presentation quad, including live drag and transform previews. It performs the tile blend in premultiplied form, resolves back to straight alpha for ImGui, and caches the result while all presentation inputs remain unchanged.

Member Function Documentation

◆ compose()

DocumentCompositeTextureView donner::editor::DocumentPresentationCompositor::compose ( const ViewportState & viewport,
const Box2d & imageClipRect,
std::span< const GlTextureCache::TileView > overviewTiles,
std::span< const GlTextureCache::TileView > tiles,
const std::optional< SelectTool::ActiveDragPreview > & activeDragPreview,
const std::optional< SelectTool::ActiveDragPreview > & displayedDragPreview,
Entity suppressedLayerEntity,
bool suppressDragTargetTiles )
nodiscard

Compose the current document presentation into one pane-sized texture.

Parameters
viewportPresented document-to-screen mapping.
imageClipRectVisible document region clipped to the render pane.
overviewTilesLow-resolution infill tiles drawn below active coverage.
tilesActive paint-order tile views.
activeDragPreviewLive drag transform to advance eligible tiles.
displayedDragPreviewDrag transform already represented by cached tiles.
suppressedLayerEntityLayer omitted from this presentation frame.
suppressDragTargetTilesWhether active drag-target tiles are omitted.
Returns
Cached or newly composed texture view, or an empty view when composition is invalid.

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