Donner 0.5.0
Embeddable browser-grade SVG2 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"

Static Public Member Functions

static EncodedPath encode (const Path &path, FillRule fillRule, double tolerance=0.1)
 Encode a path for GPU rendering.

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 bounding quad vertices for each band

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

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 files:
  • donner/svg/renderer/geode/GeodePathEncoder.h
  • donner/svg/renderer/geode/GeodePathEncoder.cc