How servo/pathfinder works
Pathfinder is a modular GPU rasterizer for fonts and vector graphics, exposed through a canvas-like API and Rust/C bindings. The main workflow is to create or load vector content, build a scene, prepare and tile it, then render it through a GPU backend. Separate branches cover text, SVG/SWF/Lottie input, and vector export. The README documents backend and rendering capabilities; several subsystem connections below are dashed because their implementation files were not sampled.
Main entry points: scene.rs Scene model · src/lib.rs Canvas API · src/lib.rs GPU abstractions · builder.rs Scene preparation
Components 24
Authoring and content
- Canvas API
canvas/src/lib.rs - Text rendering
canvas/src/text.rs - Vector content
content/src/outline.rs - Geometry primitives
geometry/src/vector.rs
Scene rendering
- Scene model
renderer/src/scene.rs - Paint data
renderer/src/paint.rs - Scene preparation
renderer/src/builder.rs - Tile generation
renderer/src/tiler.rs - Tile mapping
renderer/src/tile_map.rs - GPU renderer
renderer/src/gpu/renderer.rs
GPU platforms
- GPU abstractions
gpu/src/lib.rs - OpenGL backend
gl/src/lib.rs - WebGL backend
webgl/src/lib.rs - Metal backend
metal/src/lib.rs
Formats and export
- SVG loading
svg/src/lib.rs - SWF shapes
swf/src/shapes.rs - Lottie input
lottie/src/lib.rs - Vector export
export/src/lib.rs - PDF writer
export/src/pdf.rs
Application interfaces
- C bindings
c/src/lib.rs - Web canvas
web_canvas/src/lib.rs - Vector UI
ui/src/lib.rs
Other components
- Application
- Rendered output
Connections 24
- Application → Canvas API: draws with
README.md - Canvas API → Vector content: creates paths
- Canvas API → Text rendering: draws text
canvas/src/lib.rs - Canvas API → Scene model: adds draw paths
canvas/src/lib.rs - Vector content → Geometry primitives: uses geometry
- Scene model → Paint data: references paint
- Scene model → Scene preparation: prepares scene
- Scene preparation → Tile generation: generates tiles
- Tile generation → Tile mapping: maps tiles
- Scene preparation → GPU renderer: submits work
- GPU renderer → GPU abstractions: issues GPU work
- GPU abstractions → OpenGL backend: supports backend
- GPU abstractions → WebGL backend: supports backend
- GPU abstractions → Metal backend: supports backend
- GPU renderer → Rendered output: renders
README.md - Application → SVG loading: loads SVG
README.md - SVG loading → Scene model: provides vector content
- Application → SWF shapes: loads SWF
- Application → Lottie input: loads animation
- Scene model → Vector export: exports scene
export/src/lib.rs - Vector export → PDF writer: writes PDF
export/src/lib.rs - Application → C bindings: uses bindings
README.md - Application → Web canvas: uses web canvas
- Application → Vector UI: uses vector UI