Skip to content

Comments

fix: delegate scene.Renderer rasterization to SoftwareRenderer#125

Merged
kolkov merged 1 commit intomainfrom
fix/scene-renderer-delegation
Feb 23, 2026
Merged

fix: delegate scene.Renderer rasterization to SoftwareRenderer#125
kolkov merged 1 commit intomainfrom
fix/scene-renderer-delegation

Conversation

@kolkov
Copy link
Contributor

@kolkov kolkov commented Feb 23, 2026

Summary

  • Delegate scene.Renderer rasterization to gg.SoftwareRenderer — replace broken internal rasterizer with delegation to the existing CPU rendering infrastructure
  • Fixes 6 bugs: no AA, stroke ignoring curves (CubicTo/QuadTo), background destruction, no alpha compositing, stubbed layers/clips, only solid brushes
  • Zero public API changes — orchestration (TileGrid, WorkerPool, DirtyRegion, LayerCache) preserved

Fixes #124 (reported in #116)

Details

The scene.Renderer had its own simplified rasterizer written before gg.SoftwareRenderer and the GPU pipeline existed. Following the universal pattern confirmed by Qt Quick, Skia, Vello, and Flutter/Impeller — scene graph orchestrates, immediate-mode backend rasterizes — the pixel rendering is now delegated to SoftwareRenderer.

Changed:

  • fillPathOnTile / strokePathOnTile → delegate to sr.Fill() / sr.Stroke()
  • compositeTile → premultiplied source-over alpha blending (was raw copy())
  • sync.Pool for per-tile SoftwareRenderer and Pixmap reuse
  • Path conversion: scene.Path (float32) → gg.Path (float64) with tile offset
  • Removed dead code: fillPathOnTile, strokePathOnTile, drawLineOnTile, blendPixel

Docs:

  • CHANGELOG.md, ROADMAP.md updated for v0.29.4
  • docs/ARCHITECTURE.md — new Scene Renderer section

Test plan

  • 11 new pixel-level tests (circle fill/stroke, background preservation, alpha compositing, rect fill, transforms, path/paint conversion)
  • All 28 existing+new scene tests pass
  • go build ./... clean (GOWORK=off)
  • go test ./... — 38 packages OK
  • golangci-lint run — 0 issues
  • go fmt — clean

Replace broken internal rasterizer with delegation to gg.SoftwareRenderer.
Fixes: no AA, stroke ignoring curves, background destruction, no alpha compositing.
Zero public API changes — orchestration (tiles, workers, cache) preserved.
@kolkov kolkov merged commit 03ad102 into main Feb 23, 2026
9 checks passed
@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

❌ Patch coverage is 92.24138% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
scene/renderer.go 92.24% 6 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

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.

refactor: delegate scene.Renderer rasterization to gg.SoftwareRenderer

1 participant