Move Win32 async context ownership and trim canvas draw setup

This commit is contained in:
2026-06-16 08:49:31 +02:00
parent d5b137c9ff
commit 667589f1f6
7 changed files with 181 additions and 93 deletions

View File

@@ -18,6 +18,17 @@ agent or engineer to remove them without reconstructing context from chat.
## Reductions
- 2026-06-16: `DEBT-0003` was narrowed again. The Win32 async GL/context lock
state now lives in `src/platform_windows/windows_platform_services.cpp`
instead of `src/main.cpp` retained state, and `main.cpp` only seeds the
created `HDC`/`HGLRC` into that platform-owned helper during initialization
and context recreation; broader Win32 bootstrap/runtime ownership remains.
- 2026-06-16: `DEBT-0036` was narrowed again. `NodeCanvas` merged-path
per-plane merged-texture draw callback setup now routes through
`make_legacy_canvas_draw_merge_layer_texture_draw(...)` in
`src/legacy_canvas_draw_merge_services.h` instead of keeping that callback
setup inline in `NodeCanvas::draw()`; broader canvas draw orchestration and
retained GL resource ownership remain.
- 2026-06-16: `DEBT-0037` was narrowed again. `App::rec_loop()` in
`src/app.cpp` now delegates recording worker iteration orchestration into
`process_legacy_recording_worker_iteration(...)` in

View File

@@ -117,9 +117,9 @@ Current architecture mismatches that must be treated as real blockers:
checkerboard background setup now route through retained draw-merge helpers,
with the cache-to-screen checkerboard-plane callback setup also reduced and
the merged-path checkerboard background-plane callback plus per-plane
merged-texture draw plus the smoothing-mask face shader/draw pass plus
heightmap, current-mode, and grid-mode callback setup now routed through the
same retained helper family.
merged-texture draw callback plus the smoothing-mask face shader/draw pass
plus heightmap, current-mode, and grid-mode callback setup now routed
through the same retained helper family.
- `app_layout.cpp` and `app_dialogs.cpp` are still mixed shell/controller files
rather than thin composition/binding surfaces.
- `App`, `Canvas`, `Node`, retained workers, and platform entrypoints still use
@@ -135,13 +135,15 @@ Current architecture mismatches that must be treated as real blockers:
coordination flags now use `std::atomic` instead of unsynchronized globals,
while the main Win32 entrypoint now groups window/GL/task/VR state behind a
retained local state object instead of separate process-wide globals, the
canvas async worker now sits behind a named retained local worker-state
helper instead of a bare static accessor, the prepared-file worker and the
canvas async import/export/save/open worker now live under `AppRuntime`
instead of retained static app-events/canvas workers, and `App::rec_loop()`
now delegates worker-iteration orchestration into the retained recording
bridge even though that retained recording path still owns the worker-side
readback flow.
Win32 async GL/context lock state now lives under
`src/platform_windows/windows_platform_services.cpp` instead of `main.cpp`
retained state, the canvas async worker now sits behind a named retained
local worker-state helper instead of a bare static accessor, the
prepared-file worker and the canvas async import/export/save/open worker now
live under `AppRuntime` instead of retained static app-events/canvas
workers, and `App::rec_loop()` now delegates worker-iteration orchestration
into the retained recording bridge even though that retained recording path
still owns the worker-side readback flow.
- Modern C++23 usage exists in extracted components, especially `std::span`,
explicit result/status objects, and a few concepts, but the live app still
does not consistently express ownership, thread affinity, or renderer

View File

@@ -155,6 +155,10 @@ Current slice:
through `make_legacy_canvas_draw_merge_background_checkerboard_plane(...)`,
but the node still owns broader live layer traversal and renderer-state
sequencing.
- `NodeCanvas` merged-path per-plane merged-texture draw callback setup now
also routes through `make_legacy_canvas_draw_merge_layer_texture_draw(...)`,
but the node still owns broader live layer traversal and renderer-state
sequencing.
- `NodeCanvas` smoothing-mask face shader setup plus per-face draw execution
now also route through
`execute_legacy_canvas_draw_merge_smask_faces(...)`, but the node still owns
@@ -356,6 +360,10 @@ Current slice:
- `main.cpp` Win32 window handles, GL task/mutex state, splash-dialog state,
stylus timers, and VR worker state now sit behind one retained local state
object instead of separate file-scope globals
- Win32 async GL/context lock state now lives in
`src/platform_windows/windows_platform_services.cpp` instead of `main.cpp`
retained state, and `main.cpp` only seeds that platform-owned context handle
pair during initialization and context recreation
- prepared-file background work now runs through an `AppRuntime`-owned worker
queue instead of a retained static worker in `src/app_events.cpp`
- canvas async import/export/save/open background work now also runs through an