Commit graph

10 commits

Author SHA1 Message Date
0342d5c145 perf(render): Shadow Baking + Glyph Blitting optimizado (v0.27.0-v0.27.1)
Shadow Baking:
- ShadowCache prerenderiza sombras blur (key: w,h,blur,radius,spread)
- initWithCache() habilita cache, deinit() lo libera
- 4.2x más rápido en Debug, 2.5x en ReleaseSafe

Glyph Blitting:
- Early exit si glifo fuera de clip
- Pre-cálculo región visible
- Acceso directo fb.pixels[]
- Aritmética u32 (sin structs Color)
- Fast path alpha=255

Correcciones:
- Integer overflow: saturating arithmetic (+|, -|, *|)
- u16→u32 en blitShadowCache

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 01:49:54 +01:00
8b90a1b285 feat: Integrar zcatttf para renderizado TTF
- build.zig.zon: Añadir zcatttf como dependencia local
- build.zig: Importar módulo zcatttf en todos los targets
- ttf.zig: Reescribir como wrapper de zcatttf (991→561 LOC)

Cambios en ttf.zig:
- Usa zcatttf.Font para parsing y rasterización
- Mantiene API pública compatible (TtfFont, drawText, etc.)
- Añade soporte UTF-8 completo en drawText
- Elimina código de rasterización propio (buggy)

Eliminado:
- cmap_debug.zig del build (herramienta de diagnóstico obsoleta)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 23:14:16 +01:00
0cdd44b8a0 fix: TTF ABGR format + herramienta diagnóstico cmap
Cambios:
- ttf.zig: Fix formato pixel ABGR (era RGBA invertido)
- cmap_debug.zig: Herramienta diagnóstico tabla cmap
- build.zig: Target cmap-debug para ejecutar diagnóstico
- docs/research/TTF_DEBUG_SESSION: Documentación sesión debug

Nota: El código base TTF funciona (cmap_debug lo confirma).
El bug de rendering sigue sin resolver en integración.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 22:00:54 +01:00
105e3c63d1 fix: UTF-8 support in TTF drawText
- drawText now decodes UTF-8 codepoints instead of iterating bytes
- Fixes rendering of accented characters (á, é, í, ó, ú, ñ, etc.)
- Uses std.unicode.utf8ByteSequenceLength + utf8Decode
- Invalid UTF-8 sequences are gracefully skipped

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:25:17 +01:00
222c4e1542 fix: DroidSans reemplaza AdwaitaSans (variable) + Y-flip TTF
- AdwaitaSans era fuente variable (fvar/gvar) incompatible con parser
- DroidSans.ttf: fuente estática 187KB (Apache 2.0)
- Y-flip en rasterización: TTF Y crece arriba, bitmap Y crece abajo
- Pendiente: UTF-8 multibyte en drawText

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 13:19:40 +01:00
22d5e51769 feat: Embeber fuente AdwaitaSans-Regular.ttf
- Añadir src/render/fonts/AdwaitaSans-Regular.ttf (860KB)
- Crear src/render/embedded_font.zig con @embedFile
- Añadir TtfFont.initEmbedded() para carga sin dependencias
- Exportar embedded_font en zcatgui.zig

Ahora cualquier programa que use zcatgui tiene TTF
disponible automáticamente sin archivos externos.

Licencia: SIL Open Font License (redistribución OK)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 01:21:28 +01:00
a11e1ea842 feat: zcatgui v0.16.0 - TTF rasterization con antialiasing
Cambios:
- TTF rasterization completo con bezier curves
- Antialiasing via supersampling 2x
- Integración TTF en SoftwareRenderer (setTtfFont)
- Fix ArrayListUnmanaged para Zig 0.15.2
- Documentación REFERENCE.md actualizada

CLAUDE.md actualizado con v0.16.0 y historial.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 01:05:48 +01:00
f2900d9dc2 test(ttf): Añadir tests con AdwaitaSans real
- Test carga fuente del sistema
- Verificar parsing de contornos para 'A'
- Verificar rasterización produce bitmap con datos
- Test múltiples caracteres (AaBb0123)
- Tests skip gracefully si fuente no disponible

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 00:42:51 +01:00
69745ba857 feat(ttf): Implementar rasterización TTF con antialiasing
- Añadir GlyphPoint, Contour, GlyphOutline para representar contornos
- Implementar getGlyphOutline() para parsear tabla glyf
- Implementar rasterizeGlyph() con supersampling 2x
- Scanline fill con non-zero winding rule
- Subdivisión de curvas Bezier cuadráticas
- Cache de glyphs por codepoint+size
- Alpha blending para antialiasing
- Reemplazar drawGlyphPlaceholder con renderizado real

El código parsea contornos TTF y los rasteriza con antialiasing.
Próximo paso: test visual con AdwaitaSans.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-16 00:42:02 +01:00
8adc93a345 feat: zcatgui v0.6.0 - Phase 1 Optimization Complete
Performance Infrastructure:
- FrameArena: O(1) per-frame allocator with automatic reset
- ObjectPool: Generic object pool for frequently allocated types
- CommandPool: Specialized pool for draw commands
- RingBuffer: Circular buffer for streaming data
- ScopedArena: RAII pattern for temporary allocations

Dirty Rectangle System:
- Context now tracks dirty regions for partial redraws
- Automatic rect merging to reduce overdraw
- invalidateRect(), needsRedraw(), getDirtyRects() API
- Falls back to full redraw when > 32 dirty rects

Benchmark Suite:
- Timer: High-resolution timing
- Benchmark: Stats collection (avg, min, max, stddev, median)
- FrameTimer: FPS and frame time tracking
- AllocationTracker: Memory usage monitoring
- Pre-built benchmarks for arena, pool, and commands

Context Improvements:
- Integrated FrameArena for zero-allocation hot paths
- frameAllocator() for per-frame widget allocations
- FrameStats for performance monitoring
- Context.init() now returns error union (breaking change)

New Widgets (from previous session):
- Slider: Horizontal/vertical with customization
- ScrollArea: Scrollable content region
- Tabs: Tab container with keyboard navigation
- RadioButton: Radio button groups
- Menu: Dropdown menus (foundation)

Theme System Expansion:
- 5 built-in themes: dark, light, high_contrast, nord, dracula
- ThemeManager with runtime switching
- TTF font support via stb_truetype

Documentation:
- DEVELOPMENT_PLAN.md: 9-phase roadmap to DVUI/Gio parity
- Updated WIDGET_COMPARISON.md with detailed analysis
- Lego Panels architecture documented

Stats: 17 widgets, 123 tests, 5 themes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 12:45:00 +01:00