Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
EditorShellPresentation.h File Reference

EditorShell's direct-to-framebuffer presentation seam: converting cached GL/WGPU tiles and the immediate chrome snapshot into presented pixels. On Geode/WGPU builds this draws the checkerboard, document tiles, and selection chrome straight onto the window framebuffer, in that order, in one frame and with one transform; the tile-geometry helpers are backend-neutral. More...

Include dependency graph for EditorShellPresentation.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::editor::ImmediateChromePlan
 Everything the immediate chrome pass needs to draw one frame of editor chrome. Captured by value because the direct-render callback runs later in the frame, after the shell's borrowed snapshot reference would go stale. More...

Namespaces

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

Functions

PresentedFrameTileGeometry donner::editor::PresentedGeometryFromTileView (const GlTextureCache::TileView &tile, const std::optional< SelectTool::ActiveDragPreview > &activeDragPreview)
 Tile geometry as the presenter will draw it, folding an active drag preview into the tile's drag-target flag.
std::optional< PresentedDragBaselinedonner::editor::PresentedBaselineFromDragPreviews (const std::optional< SelectTool::ActiveDragPreview > &activePreview, const std::optional< SelectTool::ActiveDragPreview > &displayedPreview)
 Drag baseline shared by the active and displayed previews, or nullopt when they describe different gestures.
Transform2d donner::editor::PresentedFramebufferFromDocumentTransform (const ViewportState &viewport, const Vector2d &framebufferFromLogicalScale)
 Transform from document coordinates into window-framebuffer device pixels for one presented frame.
SelectionChromeSnapshot donner::editor::ChromePlacedOnPresentedDocument (const ViewportState &presentedViewport, const Vector2d &framebufferFromLogicalScale, SelectionChromeSnapshot snapshot)
 Return snapshot re-pointed at the transform presentedViewport places this frame's document pixels with.

Detailed Description

EditorShell's direct-to-framebuffer presentation seam: converting cached GL/WGPU tiles and the immediate chrome snapshot into presented pixels. On Geode/WGPU builds this draws the checkerboard, document tiles, and selection chrome straight onto the window framebuffer, in that order, in one frame and with one transform; the tile-geometry helpers are backend-neutral.

Function Documentation

◆ ChromePlacedOnPresentedDocument()

SelectionChromeSnapshot donner::editor::ChromePlacedOnPresentedDocument ( const ViewportState & presentedViewport,
const Vector2d & framebufferFromLogicalScale,
SelectionChromeSnapshot snapshot )
nodiscard

Return snapshot re-pointed at the transform presentedViewport places this frame's document pixels with.

Capture stamps the transform it happened to sample against, which during a gesture is one or more frames ahead of the pixels on screen. Re-pointing here is what collapses that gap: the chrome cannot be drawn with any transform other than the presented one.

Parameters
presentedViewportViewport this frame's document pixels landed in.
framebufferFromLogicalScalePhysical framebuffer pixels per ImGui logical pixel.
snapshotCaptured chrome geometry.

◆ PresentedFramebufferFromDocumentTransform()

Transform2d donner::editor::PresentedFramebufferFromDocumentTransform ( const ViewportState & viewport,
const Vector2d & framebufferFromLogicalScale )
nodiscard

Transform from document coordinates into window-framebuffer device pixels for one presented frame.

The single source of the presented frame's placement: document tiles and editor chrome both derive their transform from this, from the same ViewportState, in the same frame. Nothing else may compute it, or the two can disagree and the chrome annotates pixels that moved.

Parameters
viewportViewport this frame's document pixels are placed with.
framebufferFromLogicalScalePhysical framebuffer pixels per ImGui logical pixel.