|
|
Donner SVG 0.8.0-pre
SVG editor and embeddable C++20 engine.
|
Owns the per-frame decision of where this frame's document pixels land. More...
#include <cstdint>#include <functional>#include <memory>#include <optional>#include <vector>#include "donner/base/Box.h"#include "donner/base/EcsRegistry.h"#include "donner/editor/GlTextureCache.h"#include "donner/editor/SelectTool.h"#include "donner/editor/ViewportState.h"Classes | |
| struct | donner::editor::FramebufferUnderlayPlan |
| Everything the framebuffer underlay needs to draw one frame of document pixels. Captured by value because the underlay callback runs later in the frame, after the shell's borrowed tile views would have gone stale. More... | |
| struct | donner::editor::DocumentPresentationFrame |
| Per-frame inputs to the external-surface half of the presentation decision. More... | |
| struct | donner::editor::DocumentPresentationResult |
| What the presenter resolved for this frame. More... | |
| class | donner::editor::DocumentPresenter |
| The per-frame document presentation decision. More... | |
| class | donner::editor::FramebufferUnderlayPresenter |
| Presents document tiles by compositing them onto the window framebuffer underneath the ImGui UI. More... | |
Namespaces | |
| namespace | donner |
| Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css. | |
Typedefs | |
| using | donner::editor::FramebufferUnderlayPlanSink = std::function<void(std::optional<FramebufferUnderlayPlan>)> |
| Sink installing (or, on std::nullopt, clearing) this frame's framebuffer underlay plan. | |
Functions | |
| bool | donner::editor::DocumentPresentationMappingChanged (const ViewportState &before, const ViewportState &after) |
| Return whether two viewports place document pixels differently on screen. | |
| std::unique_ptr< DocumentPresenter > | donner::editor::MakeDocumentPresenter (FramebufferUnderlayPlanSink planSink) |
| Build the presenter every platform presents through. | |
Owns the per-frame decision of where this frame's document pixels land.
There is exactly one presentation target on every platform: the framebuffer underlay. Cached document tiles are composited straight onto the window framebuffer underneath the ImGui UI, together with the WGSL checkerboard backdrop.
This used to be a fork. The browser presented through a worker-owned canvas outside the window framebuffer, placed and clipped with CSS from the live viewport, and fell back to the underlay whenever the worker had no accepted surface epoch. The single-canvas replacement deleted that target: the browser build now runs the whole application on one worker thread that owns the single canvas, so the document composites under the UI in the same WebGPU frame that draws the UI, exactly as on desktop. The fork it replaced is the reason this seam exists at all, and the seam is kept because the underlay plan is still worth testing headlessly.
The presenter deliberately owns no rendering resources. It talks to the outside world through an injected sink, so the placement math is unit-testable headlessly on any build.
|
nodiscard |
Return whether two viewports place document pixels differently on screen.
Compares only what moves the document: the screen/document mapping, the artboard rect, and the device pixel ratio the chrome is rasterized at. Pane origin and size are deliberately excluded - the pane moving does not by itself move the document within it.
| before | Viewport the presented pixels were previously placed with. |
| after | Viewport they are placed with now. |
|
nodiscard |
Build the presenter every platform presents through.
| planSink | Installs or clears the framebuffer underlay draw plan. |