Donner SVG 0.8.0
0.8.0 · ebf353960.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::svg::RendererInterface Class Referenceabstract

Backend-agnostic rendering interface consumed by RendererDriver during document traversal. More...

#include "donner/svg/renderer/RendererInterface.h"

Inheritance diagram for donner::svg::RendererInterface:
[legend]

Public Member Functions

virtual void draw (SVGDocument &document)=0
 Renders the given SVG document.
virtual int width () const =0
 Returns the rendered width in device pixels.
virtual int height () const =0
 Returns the rendered height in device pixels.
virtual void beginFrameResourceScope ()
 Begins one aggregate resource-budget scope around a controller-managed frame.
virtual void endFrameResourceScope ()
 Completes a scope opened by beginFrameResourceScope.
virtual void beginFrame (const RenderViewport &viewport)=0
 Begins a render pass with the given viewport.
virtual void endFrame ()=0
 Completes the current render pass, flushing any pending work.
virtual void setPreserveTargetOnBeginFrame (bool preserve)
 Preserve the current render target when the next frame begins.
virtual void setTransform (const Transform2d &transform)=0
 Sets the absolute transform on the renderer, replacing the current matrix.
virtual void pushTransform (const Transform2d &transform)=0
 Pushes a transform onto the renderer stack, composing with the current transform.
virtual void popTransform ()=0
 Pops the most recent transform from the renderer stack.
virtual void pushClip (const ResolvedClip &clip)=0
 Pushes a clip path/mask onto the renderer stack.
virtual void popClip ()=0
 Pops the most recent clip from the renderer stack.
virtual void pushIsolatedLayer (double opacity, MixBlendMode blendMode)=0
 Pushes an isolated compositing layer with the given opacity and blend mode.
virtual void popIsolatedLayer ()=0
 Pops the most recent isolated layer, compositing it with the given opacity.
virtual void pushFilterLayer (const components::FilterGraph &filterGraph, const std::optional< Box2d > &filterRegion)=0
 Pushes a filter layer that applies the given filter graph to all content drawn within it.
virtual void popFilterLayer ()=0
 Pops the most recent filter layer.
virtual void pushMask (const std::optional< Box2d > &maskBounds)=0
 Begins mask rendering.
virtual void transitionMaskToContent ()=0
 Transitions from rendering mask content to rendering masked content.
virtual void popMask ()=0
 Pops the mask layer stack, compositing the masked content.
virtual bool beginPatternTile (const Box2d &tileRect, const Transform2d &targetFromPattern)=0
 Begins recording content into a pattern tile.
virtual void endPatternTile (bool forStroke)=0
 Ends pattern tile recording and sets the resulting tiled shader as the current fill or stroke paint.
virtual void setPaint (const PaintParams &paint)=0
 Sets the active paint parameters used by subsequent draw calls.
virtual void drawPath (const PathShape &path, const StrokeParams &stroke)=0
 Draws an arbitrary path using the current paint state.
virtual void drawRect (const Box2d &rect, const StrokeParams &stroke)=0
 Convenience helper for drawing axis-aligned rectangles.
virtual void drawEllipse (const Box2d &bounds, const StrokeParams &stroke)=0
 Convenience helper for drawing ellipses bounded by the provided box.
virtual void drawImage (const ImageResource &image, const ImageParams &params)=0
 Draws an image resource into the given target rectangle.
virtual void drawBitmap (const RendererBitmap &bitmap, const ImageParams &params)
 Draws a CPU bitmap (typically a compositor layer/segment raster) into the given target rectangle.
virtual bool drawTextureSnapshot (const RendererTextureSnapshot &texture, const Box2d &targetRect, double opacity=1.0, bool pixelated=false)
 Draws a backend-owned texture snapshot into the given target rectangle.
virtual void drawText (Registry &registry, const components::ComputedTextComponent &text, const TextParams &params)=0
 Draws pre-shaped text with the provided paint parameters.
virtual RendererBitmap takeSnapshot () const =0
 Captures a CPU-readable snapshot of the current frame buffer for testing or downstream consumers.
virtual RendererBitmap takeSnapshotInterruptibly (const std::function< bool()> &shouldCancel) const
 Captures a CPU-readable snapshot while allowing a low-priority caller to abort the readback.
virtual RendererReadbackStats consumeReadbackStats ()
 Consume readback diagnostics accumulated by this renderer backend.
virtual RendererResourceStats resourceStats () const
 Return resource-admission diagnostics for the current frame.
virtual RendererFilterPreparationBudget * filterPreparationBudget ()
 Shared driver-side filter preparation budget for this renderer family, when supported.
virtual void injectFilterLocalRasterAllocationFailureForTesting ()
 Cause the next local filter raster allocation to fail in a boundary test.
virtual std::shared_ptr< const RendererTextureSnapshot > takeTextureSnapshot ()
 Captures the current frame buffer as a backend-owned GPU texture.
virtual const RendererTextureSnapshot * borrowTextureSnapshot ()
 Borrows the current backend-owned GPU texture for a synchronous presentation operation.
virtual bool supportsTextureSnapshotCompositing () const
 Returns true when offscreen payloads can stay on the GPU for composition on this renderer's device. This does not imply that a texture can be handed to another thread or device.
virtual bool requiresTextureSnapshotPresentation () const
 Returns true when existing presentation callers require direct takeTextureSnapshot handoff. This legacy transport policy does not describe GPU composition capability. A false result does not authorize CPU readback during composition or qualify a GPU presentation path.
virtual std::unique_ptr< RendererInterface > createOffscreenInstance () const
 Creates an independent offscreen renderer instance of the same type as this one.
virtual void setOffscreenCreationHookForTesting (std::function< void()>)
 Install a zero-default hook entered from inside offscreen backend construction.
virtual std::uint64_t filterBudgetChunksForTesting () const
 Number of filter-budget command-buffer chunks submitted by this renderer family.
virtual void setDebugGeometryOverlay (bool)
 Enable or disable the backend's geometry debug overlay.
virtual bool debugGeometryOverlay () const
 Whether the backend's geometry debug overlay is enabled. Backends without an overlay always report false.
virtual void pushMask (const std::optional< Box2d > &maskBounds, MaskType maskType)
 Begins mask rendering with an explicit coverage mode.
virtual void setMaximumGlyphs (std::size_t maximumGlyphs)
 Sets the glyph cap: the most glyph occurrences one frame draws and the most unique glyph resources it admits.
virtual std::size_t maximumGlyphs () const
 The glyph cap set by setMaximumGlyphs, or 0 for a backend or build without text.
virtual void pushMask (const std::optional< Box2d > &maskBounds, MaskType maskType, ColorInterpolation colorInterpolation)
 Begins a mask with an explicit luminance color space.

Detailed Description

Backend-agnostic rendering interface consumed by RendererDriver during document traversal.

Implement this interface to create a custom rendering backend. The driver calls methods in the following order:

  1. Frame lifecycle: draw() → beginFrame() → (drawing calls) → endFrame()
  2. State stacks: pushTransform()/popTransform(), pushClip()/popClip(), pushIsolatedLayer()/popIsolatedLayer() are always paired (LIFO).
  3. Paint: setPaint() is called before each draw operation.
  4. Masks: pushMask() → (render mask shape) → transitionMaskToContent() → (render masked content) → popMask(). Masks may nest.

Coordinates flow through three spaces: SVG user units → document coordinates (after viewBox mapping) → device pixels (after devicePixelRatio scaling in RenderViewport).

Member Function Documentation

◆ beginFrame()

virtual void donner::svg::RendererInterface::beginFrame ( const RenderViewport & viewport)
pure virtual

Begins a render pass with the given viewport.

Implementations may allocate or reset backend-specific frame resources here.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ beginFrameResourceScope()

virtual void donner::svg::RendererInterface::beginFrameResourceScope ( )
inlinevirtual

Begins one aggregate resource-budget scope around a controller-managed frame.

A controller may render several offscreen passes before the root render pass. Backends that share frame budgets with their offscreen instances override this pair so every pass consumes one budget epoch instead of resetting independently. Ordinary single-pass callers may omit the scope and continue to rely on beginFrame.

Reimplemented in donner::svg::Renderer, donner::svg::RendererGeode, and donner::svg::RendererTinySkia.

◆ beginPatternTile()

virtual bool donner::svg::RendererInterface::beginPatternTile ( const Box2d & tileRect,
const Transform2d & targetFromPattern )
nodiscardpure virtual

Begins recording content into a pattern tile.

Content drawn between beginPatternTile and endPatternTile is captured as a repeating pattern.

Parameters
tileRectThe tile rectangle in pattern coordinate space.
targetFromPatternTransform from pattern tile space to target element space.
Returns
True when recording started. False rejects the tile without allocating resources.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ borrowTextureSnapshot()

virtual const RendererTextureSnapshot * donner::svg::RendererInterface::borrowTextureSnapshot ( )
inlinenodiscardvirtual

Borrows the current backend-owned GPU texture for a synchronous presentation operation.

The returned view is invalidated by the next frame, by takeTextureSnapshot, or by renderer destruction. Callers that retain the texture after returning must use takeTextureSnapshot instead.

Reimplemented in donner::svg::Renderer, and donner::svg::RendererGeode.

◆ consumeReadbackStats()

virtual RendererReadbackStats donner::svg::RendererInterface::consumeReadbackStats ( )
inlinenodiscardvirtual

Consume readback diagnostics accumulated by this renderer backend.

Backends without asynchronous GPU readback return zeroed stats.

Reimplemented in donner::svg::Renderer, and donner::svg::RendererGeode.

◆ createOffscreenInstance()

virtual std::unique_ptr< RendererInterface > donner::svg::RendererInterface::createOffscreenInstance ( ) const
inlinenodiscardvirtual

Creates an independent offscreen renderer instance of the same type as this one.

Used for rendering sub-documents into intermediate pixmaps when a backend needs an isolated offscreen pass (e.g., for feImage with SVG content). Returns nullptr if offscreen rendering is not supported.

Reimplemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ debugGeometryOverlay()

virtual bool donner::svg::RendererInterface::debugGeometryOverlay ( ) const
inlinenodiscardvirtual

Whether the backend's geometry debug overlay is enabled. Backends without an overlay always report false.

Reimplemented in donner::svg::Renderer, and donner::svg::RendererGeode.

◆ draw()

virtual void donner::svg::RendererInterface::draw ( SVGDocument & document)
pure virtual

Renders the given SVG document.

Implementations prepare the document, traverse the render tree, and emit drawing commands.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ drawBitmap()

virtual void donner::svg::RendererInterface::drawBitmap ( const RendererBitmap & bitmap,
const ImageParams & params )
inlinevirtual

Draws a CPU bitmap (typically a compositor layer/segment raster) into the given target rectangle.

The ImageResource contract is tightly packed unpremultiplied RGBA, so the default copies bitmap into that form, unpremultiplying premultiplied pixels, and delegates to drawImage. That keeps every backend correct at the cost of a full pixel-buffer copy per draw. Backends that can consume the bitmap's pixels directly should override this with a zero-copy path.

Parameters
bitmapThe bitmap to draw.
paramsImage placement parameters.

Reimplemented in donner::svg::Renderer, and donner::svg::RendererTinySkia.

◆ drawEllipse()

virtual void donner::svg::RendererInterface::drawEllipse ( const Box2d & bounds,
const StrokeParams & stroke )
pure virtual

Convenience helper for drawing ellipses bounded by the provided box.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ drawImage()

virtual void donner::svg::RendererInterface::drawImage ( const ImageResource & image,
const ImageParams & params )
pure virtual

Draws an image resource into the given target rectangle.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ drawPath()

virtual void donner::svg::RendererInterface::drawPath ( const PathShape & path,
const StrokeParams & stroke )
pure virtual

Draws an arbitrary path using the current paint state.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ drawRect()

virtual void donner::svg::RendererInterface::drawRect ( const Box2d & rect,
const StrokeParams & stroke )
pure virtual

Convenience helper for drawing axis-aligned rectangles.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ drawText()

virtual void donner::svg::RendererInterface::drawText ( Registry & registry,
const components::ComputedTextComponent & text,
const TextParams & params )
pure virtual

Draws pre-shaped text with the provided paint parameters.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ drawTextureSnapshot()

virtual bool donner::svg::RendererInterface::drawTextureSnapshot ( const RendererTextureSnapshot & texture,
const Box2d & targetRect,
double opacity = 1.0,
bool pixelated = false )
inlinevirtual

Draws a backend-owned texture snapshot into the given target rectangle.

Backends that cannot consume texture directly return false. GPU presentation must preserve a usable frame or report that failure; it must not read pixels back as a fallback.

Reimplemented in donner::svg::Renderer, and donner::svg::RendererGeode.

◆ endFrame()

virtual void donner::svg::RendererInterface::endFrame ( )
pure virtual

Completes the current render pass, flushing any pending work.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ endFrameResourceScope()

virtual void donner::svg::RendererInterface::endFrameResourceScope ( )
inlinevirtual

◆ endPatternTile()

virtual void donner::svg::RendererInterface::endPatternTile ( bool forStroke)
pure virtual

Ends pattern tile recording and sets the resulting tiled shader as the current fill or stroke paint.

Parameters
forStrokeIf true, set the pattern as the stroke paint; otherwise as the fill paint.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ filterBudgetChunksForTesting()

virtual std::uint64_t donner::svg::RendererInterface::filterBudgetChunksForTesting ( ) const
inlinenodiscardvirtual

Number of filter-budget command-buffer chunks submitted by this renderer family.

Reimplemented in donner::svg::Renderer, and donner::svg::RendererGeode.

◆ filterPreparationBudget()

virtual RendererFilterPreparationBudget * donner::svg::RendererInterface::filterPreparationBudget ( )
inlinenodiscardvirtual

Shared driver-side filter preparation budget for this renderer family, when supported.

Reimplemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ height()

virtual int donner::svg::RendererInterface::height ( ) const
nodiscardpure virtual

Returns the rendered height in device pixels.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ maximumGlyphs()

virtual std::size_t donner::svg::RendererInterface::maximumGlyphs ( ) const
inlinenodiscardvirtual

The glyph cap set by setMaximumGlyphs, or 0 for a backend or build without text.

Reimplemented in donner::svg::Renderer, donner::svg::RendererGeode, and donner::svg::RendererTinySkia.

◆ popClip()

virtual void donner::svg::RendererInterface::popClip ( )
pure virtual

Pops the most recent clip from the renderer stack.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ popFilterLayer()

virtual void donner::svg::RendererInterface::popFilterLayer ( )
pure virtual

◆ popIsolatedLayer()

virtual void donner::svg::RendererInterface::popIsolatedLayer ( )
pure virtual

Pops the most recent isolated layer, compositing it with the given opacity.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ popMask()

virtual void donner::svg::RendererInterface::popMask ( )
pure virtual

Pops the mask layer stack, compositing the masked content.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ popTransform()

virtual void donner::svg::RendererInterface::popTransform ( )
pure virtual

Pops the most recent transform from the renderer stack.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ pushClip()

virtual void donner::svg::RendererInterface::pushClip ( const ResolvedClip & clip)
pure virtual

Pushes a clip path/mask onto the renderer stack.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ pushFilterLayer()

virtual void donner::svg::RendererInterface::pushFilterLayer ( const components::FilterGraph & filterGraph,
const std::optional< Box2d > & filterRegion )
pure virtual

Pushes a filter layer that applies the given filter graph to all content drawn within it.

Parameters
filterGraphThe filter graph describing primitives and their connections.
filterRegionThe filter region bounds in local coordinates, used to clip the filter output. If nullopt, the filter operates on the full surface.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ pushIsolatedLayer()

virtual void donner::svg::RendererInterface::pushIsolatedLayer ( double opacity,
MixBlendMode blendMode )
pure virtual

Pushes an isolated compositing layer with the given opacity and blend mode.

Content drawn between pushIsolatedLayer and popIsolatedLayer is composited as a group at the specified opacity using the specified blend mode.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ pushMask() [1/3]

virtual void donner::svg::RendererInterface::pushMask ( const std::optional< Box2d > & maskBounds)
pure virtual

Begins mask rendering.

The driver renders the mask content between pushMask and transitionMaskToContent, then renders the actual content between transitionMaskToContent and popMask.

This compatibility entry point begins a luminance mask. Existing embedders that implement this pure virtual remain source-compatible. Override the typed overload to support alpha masks.

Parameters
maskBoundsOptional clip rect for the mask region.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ pushMask() [2/3]

virtual void donner::svg::RendererInterface::pushMask ( const std::optional< Box2d > & maskBounds,
MaskType maskType )
inlinevirtual

Begins mask rendering with an explicit coverage mode.

Appended after the legacy virtual surface to preserve existing vtable slot order. The default compatibility implementation delegates to the one-argument luminance entry point. Backends that support MaskType::Alpha override this overload.

Parameters
maskBoundsOptional clip rect for the mask region.
maskTypeWhether mask coverage comes from luminance or alpha.

Reimplemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ pushMask() [3/3]

virtual void donner::svg::RendererInterface::pushMask ( const std::optional< Box2d > & maskBounds,
MaskType maskType,
ColorInterpolation colorInterpolation )
inlinevirtual

Begins a mask with an explicit luminance color space.

Legacy implementations retain their sRGB behavior through the two-argument overload. Backends supporting linearRGB masks override this entry point.

Parameters
maskBoundsOptional mask region in local coordinates.
maskTypeWhether coverage comes from luminance or alpha.
colorInterpolationColor space for luminance conversion; auto chooses sRGB.

Reimplemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ pushTransform()

virtual void donner::svg::RendererInterface::pushTransform ( const Transform2d & transform)
pure virtual

Pushes a transform onto the renderer stack, composing with the current transform.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ requiresTextureSnapshotPresentation()

virtual bool donner::svg::RendererInterface::requiresTextureSnapshotPresentation ( ) const
inlinenodiscardvirtual

Returns true when existing presentation callers require direct takeTextureSnapshot handoff. This legacy transport policy does not describe GPU composition capability. A false result does not authorize CPU readback during composition or qualify a GPU presentation path.

Reimplemented in donner::svg::Renderer, and donner::svg::RendererGeode.

◆ resourceStats()

virtual RendererResourceStats donner::svg::RendererInterface::resourceStats ( ) const
inlinenodiscardvirtual

Return resource-admission diagnostics for the current frame.

Reimplemented in donner::svg::Renderer, donner::svg::RendererGeode, and donner::svg::RendererTinySkia.

◆ setDebugGeometryOverlay()

virtual void donner::svg::RendererInterface::setDebugGeometryOverlay ( bool )
inlinevirtual

Enable or disable the backend's geometry debug overlay.

Geode observes geometry at the actual Slug GPU submission boundary and renders the dynamically-dilated post-vertex convex fan represented by each EncodedPath::boundingVertices array as one frame-final root-target wireframe pass. Default off. Backends without a debug overlay ignore the call.

Reimplemented in donner::svg::Renderer, and donner::svg::RendererGeode.

◆ setMaximumGlyphs()

virtual void donner::svg::RendererInterface::setMaximumGlyphs ( std::size_t maximumGlyphs)
inlinevirtual

Sets the glyph cap: the most glyph occurrences one frame draws and the most unique glyph resources it admits.

Text past the cap is not drawn in that frame. Backends that keep glyph outlines resident across frames also cap each document's resident outlines at this count.

The aggregate budgets still apply and can be reached first. TinySkia charges every glyph occurrence one draw call, two when the text is stroked, against RendererDrawBudget::kMaximumDrawCalls, and its outline decode against RendererTextMaterializationBudget::kMaximumBytes, which admits tens of thousands of glyphs per frame depending on outline complexity. Geode charges that byte budget for each cache miss (its decode and its entry) and for per-occurrence path copies of stroked, gradient, and pattern text, and charges draws against its frame geometry budget. Lowering the cap bounds per-frame text work for untrusted documents.

Offscreen instances from createOffscreenInstance share the cap. Backends and builds without text ignore the call.

The initial cap is RendererTextMaterializationBudget::kDefaultMaximumGlyphs.

Parameters
maximumGlyphsMaximum glyph occurrences and unique glyph resources admitted per frame.

Reimplemented in donner::svg::Renderer, donner::svg::RendererGeode, and donner::svg::RendererTinySkia.

◆ setOffscreenCreationHookForTesting()

virtual void donner::svg::RendererInterface::setOffscreenCreationHookForTesting ( std::function< void()> )
inlinevirtual

Install a zero-default hook entered from inside offscreen backend construction.

Reimplemented in donner::svg::Renderer, and donner::svg::RendererGeode.

◆ setPaint()

virtual void donner::svg::RendererInterface::setPaint ( const PaintParams & paint)
pure virtual

Sets the active paint parameters used by subsequent draw calls.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ setPreserveTargetOnBeginFrame()

virtual void donner::svg::RendererInterface::setPreserveTargetOnBeginFrame ( bool preserve)
inlinevirtual

Preserve the current render target when the next frame begins.

Backends that support append passes override this to use a load operation instead of clearing. Other backends may ignore the request.

Reimplemented in donner::svg::Renderer, and donner::svg::RendererGeode.

◆ setTransform()

virtual void donner::svg::RendererInterface::setTransform ( const Transform2d & transform)
pure virtual

Sets the absolute transform on the renderer, replacing the current matrix.

Unlike pushTransform, this does not interact with the save/restore stack.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ supportsTextureSnapshotCompositing()

virtual bool donner::svg::RendererInterface::supportsTextureSnapshotCompositing ( ) const
inlinenodiscardvirtual

Returns true when offscreen payloads can stay on the GPU for composition on this renderer's device. This does not imply that a texture can be handed to another thread or device.

Reimplemented in donner::svg::Renderer, and donner::svg::RendererGeode.

◆ takeSnapshot()

virtual RendererBitmap donner::svg::RendererInterface::takeSnapshot ( ) const
nodiscardpure virtual

Captures a CPU-readable snapshot of the current frame buffer for testing or downstream consumers.

The snapshot must remain valid after the render pass completes.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ takeSnapshotInterruptibly()

virtual RendererBitmap donner::svg::RendererInterface::takeSnapshotInterruptibly ( const std::function< bool()> & shouldCancel) const
inlinenodiscardvirtual

Captures a CPU-readable snapshot while allowing a low-priority caller to abort the readback.

Backends whose snapshots are already bounded may inherit this default. GPU backends should override it and poll shouldCancel while waiting for mapped readback data.

Reimplemented in donner::svg::Renderer, and donner::svg::RendererGeode.

◆ takeTextureSnapshot()

virtual std::shared_ptr< const RendererTextureSnapshot > donner::svg::RendererInterface::takeTextureSnapshot ( )
inlinenodiscardvirtual

Captures the current frame buffer as a backend-owned GPU texture.

Returns nullptr for backends that cannot expose a directly-sampleable texture. When non-null, the returned snapshot owns the texture lifetime needed by downstream presentation code.

Reimplemented in donner::svg::Renderer, and donner::svg::RendererGeode.

◆ transitionMaskToContent()

virtual void donner::svg::RendererInterface::transitionMaskToContent ( )
pure virtual

Transitions from rendering mask content to rendering masked content.

Must be called between pushMask and popMask.

Implemented in donner::svg::Renderer, donner::svg::RendererGeode, donner::svg::RendererTinySkia, and donner::svg::RenderSnapshotRecorder.

◆ width()

virtual int donner::svg::RendererInterface::width ( ) const
nodiscardpure virtual

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