Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::geode::GeodePathEncoder Class Reference

Encodes a Path into Slug band decomposition format for GPU rendering. More...

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

Classes

struct  Limits

Static Public Member Functions

static EncodedPath encode (const Path &path, FillRule fillRule, double tolerance=0.1)
 Encode a path for GPU rendering.
static EncodedPath encode (const Path &path, FillRule fillRule, double tolerance, Limits limits)
 Resource-limited encode overload.

Detailed Description

Encodes a Path into Slug band decomposition format for GPU rendering.

The encoding pipeline:

  1. Convert cubics to quadratics (Path::cubicToQuadratic)
  2. Split curves at Y-monotone points (Path::toMonotonic)
  3. Compute path bounds and determine band count
  4. Assign curves to bands and sort
  5. Generate a small conservative whole-path bounding polygon

The output EncodedPath contains all data needed to fill the path on the GPU.


Class Documentation

◆ donner::geode::GeodePathEncoder::Limits

struct donner::geode::GeodePathEncoder::Limits
Class Members
size_t maximumConvertedCommands = 1u << 20
size_t maximumEncodedGeometryItems = 1u << 20

Member Function Documentation

◆ encode()

EncodedPath donner::geode::GeodePathEncoder::encode ( const Path & path,
FillRule fillRule,
double tolerance = 0.1 )
static

Encode a path for GPU rendering.

Parameters
pathThe path to encode. Will be preprocessed (cubic→quadratic, monotonic split).
fillRuleThe fill rule (non-zero or even-odd) - stored for the fragment shader.
toleranceQuadratic approximation tolerance (default 0.1, suitable for text-size).
Returns
Encoded path data ready for GPU upload, or empty if the path is degenerate.

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