Donner SVG main
0.8.0 ยท 766e862a0.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::svg::components::BoundsGeometryPaths Class Reference

Path copies that collected geometry holds, shared between pieces that hold the same path, such as the pieces of every external <use> of one fragment. More...

#include "donner/svg/components/shape/BoundsGeometry.h"

Public Member Functions

std::shared_ptr< const Path > share (const Registry &registry, Entity source, const Path &path, StyleResourceBudget &budget)
 A shared copy of path, which source in registry holds, reusing an identical copy made earlier.
void clear ()
 Forget every copy.

Detailed Description

Path copies that collected geometry holds, shared between pieces that hold the same path, such as the pieces of every external <use> of one fragment.

Each distinct copy is charged to a byte allowance. Copies are found by a hash of their contents, so sharing a path costs one full comparison at most however many different copies its source element has.

Member Function Documentation

◆ share()

std::shared_ptr< const Path > donner::svg::components::BoundsGeometryPaths::share ( const Registry & registry,
Entity source,
const Path & path,
StyleResourceBudget & budget )

A shared copy of path, which source in registry holds, reusing an identical copy made earlier.

Parameters
registryRegistry holding source.
sourceEntity whose geometry path is.
pathPath to share.
budgetAllowance a new copy's bytes are charged to.
Returns
The shared copy, or nullptr when no copy is shared: once a new copy has not fit the allowance, or when a different copy of source has the same hash.

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