fix(webgl): Add ClearTarget and always rebuild in test script

1. gal_webgl_test.cpp: Add ClearTarget(TARGET_NONCACHED) before ClearScreen()
   - Matches native test harness behavior
   - Fixes accumulated content from previous scenarios
   - arc-segments now 10% different (was 86% due to content accumulation)

2. test-gal-regression.sh: Remove "skip if already built" check
   - Always rebuild to pick up code changes
   - Single script is the source of truth for full test cycle

Current results:
- 3 scenarios MATCH (<1%): basic-lines, arcs, transforms
- Many scenarios close (~10%): arc-segments, circles, hole-walls, etc.
- Some features not implemented (97-100%): glyphs, text-attrs, bitmap

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Viktor Vaczi 2026-01-08 11:37:41 +01:00
commit 92466d728c
2 changed files with 4 additions and 8 deletions

View file

@ -57,7 +57,10 @@ void renderCurrentScenario() {
// Set target to non-cached for immediate rendering
g_gal->SetTarget(KIGFX::TARGET_NONCACHED);
// Clear the screen
// Clear the target buffer first (clears the FBO where content is rendered)
g_gal->ClearTarget(KIGFX::TARGET_NONCACHED);
// Clear the screen (clears the direct rendering buffer)
g_gal->ClearScreen();
// Render the scenario