|
|
| RendererGeodeTextureSnapshot ()=default |
| | Constructs an empty snapshot, naming nothing.
|
|
| RendererGeodeTextureSnapshot (const RendererGeodeTextureSnapshot &)=delete |
|
RendererGeodeTextureSnapshot & | operator= (const RendererGeodeTextureSnapshot &)=delete |
| | RendererGeodeTextureSnapshot (RendererGeodeTextureSnapshot &&other) noexcept |
| | Construct by moving another instance's state.
|
| RendererGeodeTextureSnapshot & | operator= (RendererGeodeTextureSnapshot &&other) noexcept |
| | Replace this object's state by moving another instance.
|
| RendererTextureSnapshotBackend | backend () const override |
| | Renderer backend that produced this texture.
|
|
bool | isValid () const |
| | Whether the snapshot names valid content in a backing allocation.
|
|
const gpu::Texture * | runtimeTexture () const |
| | Runtime identity of the texture this snapshot names, or null when it names nothing. The returned handle borrows this snapshot's lifetime and must never be consumed.
|
|
const gpu::TextureExport * | textureExport () const |
| | The export another context registers this snapshot's texture through, taken on the producer's thread when the snapshot was adopted, or null when the snapshot only borrows a producer's frame target or its backend cannot share textures. Registering it never touches the producing device, so a consumer on any thread may use it.
|
|
uint64_t | deviceId () const |
| | Identity of the runtime device the named texture belongs to, or zero when this snapshot names nothing.
|
|
Vector2i | allocationDimensions () const |
| | Actual allocation extent; content may use a smaller prefix.
|
|
std::optional< gpu::TextureFormat > | runtimeFormat () const |
| | Runtime format, if the backend format has a supported runtime representation.
|
|
gpu::Texture | takeRuntimeRegistrationForTesting () |
| | Takes the owning device's name for this snapshot's texture out of the snapshot, so a test can present a snapshot that no longer names what its backend handles point at. The caller becomes the owner of the returned handle and keeps the texture alive.
|
| Vector2i | dimensions () const override |
| | Valid content extent in device pixels, anchored at the texture origin. Sampling and readback are confined to this region even when the backing texture is larger.
|
| AlphaType | alphaType () const override |
| | Alpha interpretation of the texture contents.
|
| RendererBitmap | takeSnapshot () const override |
| | Capture a CPU-readable copy of this texture.
|
| RendererBitmap | takeSnapshotInterruptibly (const std::function< bool()> &shouldCancel) const override |
| | Captures a CPU-readable copy of this texture, as takeSnapshot does, but gives up when shouldCancel returns true.
|
| bool | setDimensions (Vector2i dimensions) |
| | Re-point the snapshot at a different content extent inside the same backing texture.
|
GPU runtime 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.
The snapshot is also the single owner for host-uploaded CPU bitmaps that presentation code wants to draw through Geode. Those uploads keep an oversized backing allocation so a resized payload can reuse the texture, so dimensions() reports the valid content extent rather than the allocation, and alphaType() reports the uploaded pixel format.
| 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.
| RendererBitmap donner::svg::RendererGeodeTextureSnapshot::takeSnapshotInterruptibly |
( |
const std::function< bool()> & | shouldCancel | ) |
const |
|
nodiscardoverridevirtual |
Captures a CPU-readable copy of this texture, as takeSnapshot does, but gives up when shouldCancel returns true.
It is polled while the capture waits for the device's readback context and while that context waits for the copy and its mapping, as RendererGeode::takeSnapshotInterruptibly polls it. Creating the readback context, the first time a device captures, is not interrupted.
- Parameters
-
| shouldCancel | Polled on the capturing thread; empty never cancels. |
- Returns
- CPU-readable bitmap, or an empty bitmap when the capture failed or was cancelled.
Reimplemented from donner::svg::RendererTextureSnapshot.