Donner SVG main
0.8.0 ยท 382bd0190.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::svg::RendererSurfaceBudget Class Reference

Aggregate budget for render targets, layers, masks, clips, and pattern tiles. More...

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

Classes

struct  Limits
 Per-frame limits, including any tighter limits installed by a test. More...

Public Member Functions

void reset ()
 Clears usage counters and the sticky rejection state for a new frame.
bool reserve (int width, int height, std::size_t surfaceCount=1, std::uint64_t bytesPerPixel=4)
 Reserves matching surfaces; invalid dimensions or exhausted capacity latch rejection.
bool canReserveBytes (std::uint64_t bytes, std::size_t surfaces) const
 Tests additional capacity without changing counters or latching a rejection.
bool release (int width, int height, std::size_t surfaceCount=1, std::uint64_t bytesPerPixel=4)
 Releases surfaces after their last submitted GPU use, restoring active-capacity accounting.
std::uint64_t bytes () const
 Bytes currently reserved by active surfaces.
std::size_t surfaces () const
 Number of active reserved surfaces.
bool rejected () const
 Whether a reservation or release has failed in this frame.
void setLimitsForTesting (Limits limits)
 Tightens limits for a test without raising an existing limit.

Static Public Attributes

static constexpr std::uint64_t kMaximumBytes = 256ULL * 1024 * 1024
 Default upper bound on aggregate surface storage.
static constexpr std::size_t kMaximumSurfaces = 256
 Default upper bound on concurrently reserved surfaces.

Detailed Description

Aggregate budget for render targets, layers, masks, clips, and pattern tiles.


Class Documentation

◆ donner::svg::RendererSurfaceBudget::Limits

struct donner::svg::RendererSurfaceBudget::Limits

Per-frame limits, including any tighter limits installed by a test.

Class Members
uint64_t bytes = kMaximumBytes Maximum aggregate surface bytes.
size_t surfaces = kMaximumSurfaces Maximum active surface count.

Member Function Documentation

◆ canReserveBytes()

bool donner::svg::RendererSurfaceBudget::canReserveBytes ( std::uint64_t bytes,
std::size_t surfaces ) const
inlinenodiscard

Tests additional capacity without changing counters or latching a rejection.

Parameters
bytesAdditional allocation bytes.
surfacesAdditional texture count.

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