Donner SVG main
0.8.0 ยท 766e862a0.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::geode::GradientRampCache Struct Reference

The stop ramp one encoder bound for a resolved gradient, so the resolution's further draws in that encoder bind it without hashing or comparing the stops again. More...

#include "donner/svg/renderer/geode/GeoEncoder.h"

Public Attributes

uint64_t encoderId = 0
 Identity of the encoder that filled the cache; 0 when empty.
std::shared_ptr< const GeodeGradientRamp > ramp
 The ramp that encoder bound, which its own bookkeeping also keeps alive until submission.

Detailed Description

The stop ramp one encoder bound for a resolved gradient, so the resolution's further draws in that encoder bind it without hashing or comparing the stops again.

The caller keeps one beside each resolution, whose stops must not change while it is kept, and hands it to every draw made from that resolution. It is valid for one encoder only: a draw in another encoder looks the ramp up again and takes the cache over, so a resolution costs one lookup per encoder it draws in.

Member Data Documentation

◆ encoderId

uint64_t donner::geode::GradientRampCache::encoderId = 0

Identity of the encoder that filled the cache; 0 when empty.

◆ ramp

std::shared_ptr<const GeodeGradientRamp> donner::geode::GradientRampCache::ramp

The ramp that encoder bound, which its own bookkeeping also keeps alive until submission.


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