Releases: gogpu/gg
Releases · gogpu/gg
v0.40.0 — Alpha Mask API
Alpha Mask API
Complete enterprise-level alpha masking system following Vello/tiny-skia patterns. Fixes #238 and #236. Thanks @Rider21 for the reports and API feedback!
New Features
Per-shape masking — SetMask(mask) modulates each Fill/Stroke individually:
mask := gg.NewMask(300, 300)
// ... fill mask ...
dc.SetMask(mask)
dc.DrawRectangle(0, 0, 300, 300)
dc.Fill() // only visible through maskPer-layer masking — PushMaskLayer(mask) masks entire groups:
dc.PushMaskLayer(circleMask)
dc.DrawCircle(100, 100, 50)
dc.Fill()
dc.DrawRect(200, 200, 80, 80)
dc.Fill()
dc.PopLayer() // entire layer masked, then compositedPost-processing — ApplyMask(mask) for DestinationIn blend on existing content.
Constructors:
NewLuminanceMask(img)— CSS Masking Level 1 formulaNewMaskFromData(data, w, h)— raw byte constructor
GPU integration:
MaskAwareinterface for GPU accelerators- Automatic CPU fallback when GPU doesn't support masks
Quality
- 25 mask-related tests across all platforms
- Enterprise references: Cairo, Skia, tiny-skia, Vello
- Mask + clip compose multiplicatively
v0.39.4
v0.39.3
Fixed
- MSDF text overlapping on Retina — Large text (28px+) had overlapping letters and rectangular artifacts on HiDPI displays (scale=2). MSDF quad positioning included deviceScale in ratio, producing physical-pixel positions in a logical coordinate system. Fixed to use logicalSize/refSize — CTM handles device scaling. Small text (<48px device) was unaffected (Glyph Mask pipeline). (#247, reported by @jdbann)
v0.39.2
v0.39.1
Changed
- wgpu v0.23.9 → v0.24.2: Metal PollCompleted atomic tracking, MapWrite staging, DX12 HEAP_TYPE_CUSTOM, encoder pool, Metal SetBindGroup cross-group slot fix
- gogpu v0.26.1 → v0.26.3: cascade dependency updates
- naga v0.16.6 → v0.17.0: DXIL direct compilation backend
- Examples updated (gogpu_integration, lcd_text)
v0.39.0 — Zero-Alloc Rasterizer + Path SOA
Breaking Changes
- Path API: SOA representation —
PathElementinterface deleted. UseIterate(),Verbs(),Coords(). Verb constants renamed:VerbMoveTo→MoveTo. See migration guide in CHANGELOG.
Performance
- Zero-alloc rasterizer — FillRect: 14 → 0 allocs. FillCircle r500: 270 → 0 allocs.
- Path SOA — zero per-verb heap allocations (Skia/tiny-skia/Blend2D pattern, ADR-010)
- Embedded stack buffer — small paths use stack memory. ParseSVGPath: 14 → 1 alloc.
- Gradient 2-5x faster — pre-sorted stops, 0 allocs per pixel
- Scene renderer -40% allocs, -71% memory — pooled Paths/Paints/Decoders
- Stroke expansion 2-13x faster — embedded builders, reusable flatten buffer
- Worker pool -50% allocs —
ExecuteIndexed()eliminates per-tile closures
Fixed
- Removed 3 dead naga SPIR-V workarounds (GPU golden test verified)
- dashQuad/dashCubic off-by-one
- Standalone compute adapter selection
Changed
- deps: wgpu v0.23.9, naga v0.16.6, gputypes v0.4.0, x/image v0.38.0
v0.38.3
Performance
- Gradient rendering 2-5x faster, zero allocations —
sortStops()was called per-pixel. Now pre-sorted atAddColorStop(). LinearGradient: 5.5x, RadialGradient: 2.4x. - Circle/curve rendering 90-95% fewer allocs —
NewLineEdge()returns value type. r500: 270 → 14 allocs. - Scene renderer -40% allocs, -71% memory — pooled Paths, Paints, Decoders, clip masks per tile. 4K: 4M → 2.4M allocs, 238MB → 68MB.
- Scene build -75% allocs —
PathBuilderinterface + path pool. 10K shapes: 40K → 10K. - Worker pool -50% allocs —
ExecuteIndexed()eliminates per-tile closures. - Stroke expansion 2-13x faster, up to 98% less memory — embedded builders, reusable flatten buffer.
Fixed
- Removed 3 dead naga SPIR-V workarounds in Vello compute shaders — naga v0.16.6 fixed the codegen bugs. Verified with GPU golden comparison on Vulkan, DX12, and GLES.
- Standalone compute adapter selection —
RequestAdapter(nil)instead ofHighPerformance. - dashQuad/dashCubic off-by-one — flattened curve points loop index fix.
Changed
- deps: wgpu v0.23.9, naga v0.16.6, gputypes v0.4.0, x/image v0.38.0
v0.38.2
Fixed
Clear()documentation and examples — Godoc now correctly states thatClear()resets to transparent;ClearWithColor()is the recommended way to set a background color (Blend2D/Skia/HTML Canvas pattern). Updated all examples. Fixes #227.Recorder.Clear()semantics — now matchesContext.Clear()(transparent), was incorrectly using current fill brush.- Render() promotes pendingTexture — Universal rendering path now correctly promotes pending texture. Fixes black screen on CPU-only adapters (BUG-GOGPU-001).
- Skip GPU-direct path on CPU adapters —
AcceleratorCanRenderDirect()returns false on llvmpipe/SwiftShader.
Changed
- GPU accelerator: wgpu Submit API update —
SubmitWithFence+WaitForFence→Submit+WaitIdle(wgpu BUG-GOGPU-004). - deps: wgpu v0.22.1 → v0.23.0, naga v0.14.8 → v0.15.0, goffi v0.4.2 → v0.5.0
v0.38.1
v0.38.0
Added
- Enterprise SVG renderer (
gg/svgpackage) — full SVG XML parser and renderer for JetBrains-quality icons. Supports path, circle, rect, g, polygon, polyline, line, ellipse. Color override for theming (RenderWithColor). ViewBox scaling. 2054 LOC, 64 tests with real JB SVG icons. - SVG path data parser —
ParseSVGPath(d)all SVG commands (M/m, L/l, H/h, V/v, C/c, S/s, Q/q, T/t, A/a, Z/z). Arc-to-cubic conversion. 56 tests. - Transform-aware path rendering —
DrawPath,FillPath,StrokePathreplay parsed paths through current CTM.SetPath,AppendPath,Path.Appendfor pre-built paths. - ClearType LCD subpixel text pipeline — dual GPU pipeline (Skia pattern),
SetLCDLayout(LCDLayoutRGB/BGR/None)API. - LCD text example (
examples/lcd_text/)
Fixed
- BeginAcceleratorFrame ordering — moved from RenderDirect to Draw, prevents mid-frame content wipe (RENDER-DIRECT-003)
- Atlas sync diagnostic — warning log when text skipped due to unsynchronized atlas
- Nearest filtering for glyph mask bitmap atlas
- Buffer test MapRead|MapWrite — fixed WebGPU spec violation caught by wgpu v0.22.1
Dependencies
- wgpu v0.21.3 → v0.22.1
- gpucontext v0.10.0 → v0.11.0