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
donner::svg::RendererTextureSnapshot Class Referenceabstract

Backend-owned GPU texture snapshot produced by a renderer. More...

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

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

Public Member Functions

virtual RendererTextureSnapshotBackend backend () const
 Renderer backend that produced this texture.
virtual Vector2i dimensions () const =0
 Pixel dimensions of the texture in device pixels.
virtual AlphaType alphaType () const =0
 Alpha interpretation of the texture contents.
virtual RendererBitmap takeSnapshot () const
 Capture a CPU-readable copy of this texture.

Detailed Description

Backend-owned GPU texture snapshot produced by a renderer.

The base type is intentionally backend-neutral so compositor/editor code can carry texture payloads without depending on WebGPU, OpenGL, or any concrete graphics API. Backends that support direct texture presentation return a derived type from RendererInterface::takeTextureSnapshot().

Member Function Documentation

◆ alphaType()

virtual AlphaType donner::svg::RendererTextureSnapshot::alphaType ( ) const
nodiscardpure virtual

Alpha interpretation of the texture contents.

Implemented in donner::svg::RendererGeodeTextureSnapshot.

◆ backend()

virtual RendererTextureSnapshotBackend donner::svg::RendererTextureSnapshot::backend ( ) const
inlinenodiscardvirtual

Renderer backend that produced this texture.

Reimplemented in donner::svg::RendererGeodeTextureSnapshot.

◆ dimensions()

virtual Vector2i donner::svg::RendererTextureSnapshot::dimensions ( ) const
nodiscardpure virtual

Pixel dimensions of the texture in device pixels.

Implemented in donner::svg::RendererGeodeTextureSnapshot.

◆ takeSnapshot()

virtual RendererBitmap donner::svg::RendererTextureSnapshot::takeSnapshot ( ) const
inlinenodiscardvirtual

Capture a CPU-readable copy of this texture.

Backends that cannot read texture snapshots return an empty bitmap. The operation may submit GPU work and block for completion, so presentation code should keep using the texture directly and reserve readback for explicit capture, diagnostics, and tests.

Returns
CPU-readable bitmap, or an empty bitmap when readback is unsupported.

Reimplemented in donner::svg::RendererGeodeTextureSnapshot.


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