Extract canvas stroke runtime and preview draw shells

This commit is contained in:
2026-06-16 20:22:01 +02:00
parent d6a7512b94
commit a05afb24f3
11 changed files with 1159 additions and 971 deletions

View File

@@ -91,7 +91,8 @@ Status: In Progress
Why now:
`src/canvas.cpp` is still the biggest single architectural blocker at about
1271 lines, with `src/canvas_modes.cpp` still large at about 720 lines.
1010 lines, with `src/canvas_modes.cpp` now materially thinner and the next
remaining render-shell pressure shifting toward preview/canvas nodes.
Current slice:
- Canvas state-management helpers for picking, clear/clear-all, layer
@@ -135,6 +136,12 @@ Current slice:
`src/legacy_canvas_layer_services.cpp` instead of staying inline in
`src/canvas.cpp`, which trims another coherent retained layer/fill workflow
pocket from the live canvas shell.
- `Canvas::stroke_end(...)`, `Canvas::stroke_cancel(...)`,
`Canvas::stroke_draw_mix(...)`, `Canvas::stroke_draw_project(...)`,
`Canvas::stroke_update(...)`, and `Canvas::stroke_start(...)` now also live
in `src/legacy_canvas_stroke_runtime_services.*` instead of staying inline in
`src/canvas.cpp`, which trims another large retained live stroke/runtime
pocket from the canvas shell.
- The `CanvasModePen` and `CanvasModeLine` interaction families now also live
in `src/legacy_canvas_mode_pen_line.cpp` instead of staying inline in
`src/canvas_modes.cpp`, which materially thins another retained pen/line
@@ -307,6 +314,16 @@ Current slice:
live in `src/legacy_node_canvas_state_services.*` instead of staying inline
in `src/node_canvas.cpp`, which materially thins another retained
state/control pocket without reopening the draw path.
- `NodeStrokePreview` retained lifecycle, worker-thread shell, render-to-image,
on-screen handling, and preview texture ownership now also live in
`src/legacy_node_stroke_preview_runtime_services.cpp` instead of staying
inline in `src/node_stroke_preview.cpp`, which materially thins the preview
node around its runtime-facing shell even though live pass execution still
remains.
- `NodeCanvas::init()` plus the remaining `NodeCanvas::draw()` outer shell now
also live in `src/legacy_node_canvas_draw_services.*` instead of staying
inline in `src/node_canvas.cpp`, which materially reduces the live node to a
thinner controller surface around event routing and state wrappers.
Write scope:
- `src/node_stroke_preview.cpp`