|
|
Donner SVG 0.8.0-pre
SVG editor and embeddable C++20 engine.
|
Document-wide state for retained coverage, stored in the registry context. More...
#include "donner/svg/renderer/RetainedSpans.h"
Public Attributes | |
| std::size_t | liveBytes = 0 |
| Bytes currently held by every retained entry in this document. | |
| std::size_t | budgetBytes = kDefaultBudgetBytes |
| Ceiling on liveBytes. | |
| bool | disabled = false |
| Set when the working set did not fit the budget, which turns retention off for this document until it is reset. Falling back wholesale is cheaper and more predictable than re-capturing the same shapes every frame. | |
| std::uint64_t | evictions = 0 |
| Entries evicted to stay under budget, across the document's lifetime. | |
| std::uint64_t | frameCounter = 0 |
| Issues frame identities. Every frame of every renderer drawing this document takes the next value, so "already drawn in this frame" cannot be confused with "drawn by another
renderer". | |
Document-wide state for retained coverage, stored in the registry context.
Retained coverage is attacker-influenced: a document chooses how many shapes exist and how much coverage each produces. The budget here is what keeps that bounded. Exceeding it evicts the coldest entries, and a working set that does not fit at all turns retention off for the document rather than growing without limit.
It also issues frame identities, because retained entries belong to the document rather than to any one renderer: several renderers can draw one document, and each of their frames needs an identity the others cannot collide with.