Skip to content

Conversation

@jserv
Copy link
Contributor

@jserv jserv commented Jan 2, 2026

This consolidates line and path rendering across all ports (headless, WASM) to use capsule SDF algorithm matching SDL2's geometry-based rendering.

  • Remove redundant algorithms: Xiaolin Wu, sharpened Wu, Bresenham
  • Simplify iui_raster_line() to delegate to iui_raster_capsule()
  • Add iui_raster_path_stroke() for consistent font rendering
  • Remove unused iui_raster_cap() (capsule geometry includes caps)

Performance optimizations:

  • Squared distance early-out avoids sqrtf for solid core pixels
  • Adaptive AA fringe (0.35-0.5) for crisper thin lines
  • Incremental dot product computation in inner loop
  • Direct framebuffer access with pre-clipped bounds
  • Row pointer caching for better memory access

This consolidates line and path rendering across all ports (headless,
WASM) to use capsule SDF algorithm matching SDL2's geometry-based rendering.
- Remove redundant algorithms: Xiaolin Wu, sharpened Wu, Bresenham
- Simplify iui_raster_line() to delegate to iui_raster_capsule()
- Add iui_raster_path_stroke() for consistent font rendering
- Remove unused iui_raster_cap() (capsule geometry includes caps)

Performance optimizations:
- Squared distance early-out avoids sqrtf for solid core pixels
- Adaptive AA fringe (0.35-0.5) for crisper thin lines
- Incremental dot product computation in inner loop
- Direct framebuffer access with pre-clipped bounds
- Row pointer caching for better memory access
@jserv jserv merged commit b5ff132 into main Jan 2, 2026
11 checks passed
@jserv jserv deleted the improve-raster branch January 2, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants