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::RendererGeodeTextureSnapshot Class Referencefinal

WebGPU texture snapshot exported by RendererGeode. More...

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

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

Public Member Functions

 RendererGeodeTextureSnapshot (std::shared_ptr< geode::GeodeDevice > device, wgpu::Texture texture, Vector2i dimensions, wgpu::TextureFormat format)
 Construct a Geode texture snapshot.
RendererTextureSnapshotBackend backend () const override
 Renderer backend that produced this texture.
Vector2i dimensions () const override
 Pixel dimensions of the texture in device pixels.
AlphaType alphaType () const override
 Alpha interpretation of the texture contents.
RendererBitmap takeSnapshot () const override
 Capture a CPU-readable copy of this texture.
const wgpu::Texture & texture () const
 Resolved single-sample WebGPU texture.
const wgpu::TextureView & textureView () const
 Lazily-created texture view suitable for ImGui_ImplWGPU's ImTextureID.
wgpu::TextureFormat format () const
 WebGPU texture format.

Detailed Description

WebGPU texture snapshot exported by RendererGeode.

The snapshot keeps the backing geode::GeodeDevice and texture alive so editor presentation code can sample the texture after the renderer has moved on to a later frame.

Constructor & Destructor Documentation

◆ RendererGeodeTextureSnapshot()

donner::svg::RendererGeodeTextureSnapshot::RendererGeodeTextureSnapshot ( std::shared_ptr< geode::GeodeDevice > device,
wgpu::Texture texture,
Vector2i dimensions,
wgpu::TextureFormat format )

Construct a Geode texture snapshot.

Parameters
deviceShared Geode device that owns the WebGPU handle lifetime.
textureResolved single-sample texture containing the rendered frame.
dimensionsTexture dimensions in device pixels.
formatTexture format.

Member Function Documentation

◆ alphaType()

AlphaType donner::svg::RendererGeodeTextureSnapshot::alphaType ( ) const
inlinenodiscardoverridevirtual

Alpha interpretation of the texture contents.

Implements donner::svg::RendererTextureSnapshot.

◆ backend()

RendererTextureSnapshotBackend donner::svg::RendererGeodeTextureSnapshot::backend ( ) const
inlinenodiscardoverridevirtual

Renderer backend that produced this texture.

Reimplemented from donner::svg::RendererTextureSnapshot.

◆ dimensions()

Vector2i donner::svg::RendererGeodeTextureSnapshot::dimensions ( ) const
inlinenodiscardoverridevirtual

Pixel dimensions of the texture in device pixels.

Implements donner::svg::RendererTextureSnapshot.

◆ takeSnapshot()

RendererBitmap donner::svg::RendererGeodeTextureSnapshot::takeSnapshot ( ) const
nodiscardoverridevirtual

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 from donner::svg::RendererTextureSnapshot.


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