Donner SVG Editor & Engine
SVG-native editor and embeddable SVG2 + CSS3 engine in C++20, with GPU (WebGPU) and compact CPU renderers, built for correctness, security, and performance.
Loading...
Searching...
No Matches
RenderPanePresenter.h File Reference
#include <cstddef>
#include <optional>
#include <span>
#include <vector>
#include "donner/base/Box.h"
#include "donner/base/Path.h"
#include "donner/base/Vector2.h"
#include "donner/editor/GlTextureCache.h"
#include "donner/editor/MenuBarPresenter.h"
#include "donner/editor/OverlayRenderer.h"
#include "donner/editor/PresentedFrameComposer.h"
#include "donner/editor/SelectTool.h"
#include "donner/editor/ViewportInteractionController.h"
#include "donner/editor/ViewportState.h"
Include dependency graph for RenderPanePresenter.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::editor::RenderPanePresenterState
class  donner::editor::RenderPanePresenter

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Functions

bool donner::editor::ShouldPresentCompositedTile (const GlTextureCache::TileView &tile, Entity suppressedLayerEntity, bool suppressDragTargetTiles=false)
 Return true when a composited tile should be drawn in the render pane.
bool donner::editor::TileMatchesActiveDragPreview (const GlTextureCache::TileView &tile, const std::optional< SelectTool::ActiveDragPreview > &activeDragPreview)
 Return true when tile should receive the current active-drag transform.
bool donner::editor::HasPresentableDragTargetTile (const GlTextureCache &textures, const std::optional< SelectTool::ActiveDragPreview > &activeDragPreview, Entity suppressedLayerEntity, bool suppressDragTargetTiles=false)
 Return true when the presenter can move the active drag target in the current tile set.
bool donner::editor::ShouldPresentOverviewTiles (bool activeTilesViewportBounded, std::span< const GlTextureCache::TileView > overviewTiles)
 Return true when retained overview tiles should be drawn behind the active tile set.
bool donner::editor::PresentedTileQuadIntersectsScreenRect (const PresentedTileQuad &tileQuad, const Box2d &screenRect)
 Return true when a presented tile quad has visible overlap with a screen rect.
std::optional< Box2ddonner::editor::PresentedImageClipRect (const Box2d &paneRect, const Box2d &imageRect)
 Return the screen-space clip rect for presented document pixels.

Variables

constexpr double donner::editor::kRenderPaneCheckerboardSize = 16.0
constexpr double donner::editor::kFramebufferCheckerboardSize = kRenderPaneCheckerboardSize

Function Documentation

◆ HasPresentableDragTargetTile()

bool donner::editor::HasPresentableDragTargetTile ( const GlTextureCache & textures,
const std::optional< SelectTool::ActiveDragPreview > & activeDragPreview,
Entity suppressedLayerEntity,
bool suppressDragTargetTiles = false )
nodiscard

Return true when the presenter can move the active drag target in the current tile set.

Parameters
texturesPresentation texture cache.
activeDragPreviewActive drag preview driving presenter-side transforms.
suppressedLayerEntityPromoted entity hidden from presentation.
suppressDragTargetTilesTrue when drag target tiles are globally hidden.

◆ PresentedImageClipRect()

std::optional< Box2d > donner::editor::PresentedImageClipRect ( const Box2d & paneRect,
const Box2d & imageRect )
nodiscard

Return the screen-space clip rect for presented document pixels.

Parameters
paneRectScreen-space render-pane bounds.
imageRectScreen-space artboard/image bounds.

◆ PresentedTileQuadIntersectsScreenRect()

bool donner::editor::PresentedTileQuadIntersectsScreenRect ( const PresentedTileQuad & tileQuad,
const Box2d & screenRect )
nodiscard

Return true when a presented tile quad has visible overlap with a screen rect.

Parameters
tileQuadOutput-space tile quad from ComputePresentedTileQuad.
screenRectScreen-space clip rect, usually the render pane bounds.

◆ ShouldPresentCompositedTile()

bool donner::editor::ShouldPresentCompositedTile ( const GlTextureCache::TileView & tile,
Entity suppressedLayerEntity,
bool suppressDragTargetTiles = false )
nodiscard

Return true when a composited tile should be drawn in the render pane.

Parameters
tileTile view published by GlTextureCache.
suppressedLayerEntityPromoted entity whose cached or immediate pixels should not be drawn while selection chrome remains visible. Null leaves all entity-owned tiles eligible.
suppressDragTargetTilesTrue when the current selected element is display:none and legacy/metadata-missing elevated drag-target tiles should be hidden as a fallback.

◆ ShouldPresentOverviewTiles()

bool donner::editor::ShouldPresentOverviewTiles ( bool activeTilesViewportBounded,
std::span< const GlTextureCache::TileView > overviewTiles )
nodiscard

Return true when retained overview tiles should be drawn behind the active tile set.

Overview infill is only coherent under viewport-bounded active tiles. Full-document active tiles already represent the current presentation, so drawing an older retained overview underneath can reintroduce stale pixels during a transform drag.

Parameters
activeTilesViewportBoundedTrue when the active tile set covers only the viewport.
overviewTilesRetained full-document overview tiles.

◆ TileMatchesActiveDragPreview()

bool donner::editor::TileMatchesActiveDragPreview ( const GlTextureCache::TileView & tile,
const std::optional< SelectTool::ActiveDragPreview > & activeDragPreview )
nodiscard

Return true when tile should receive the current active-drag transform.

Selection prewarm renders can publish layer tiles before the user starts dragging. Those tiles are valid drag presentation candidates even though their worker-side isDragTarget bit was false at prewarm time.

Parameters
tileTile view published by GlTextureCache.
activeDragPreviewActive drag preview driving presenter-side transforms.