Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .ai/memory/architecture/activex.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ replacement initialization must retain its failure state for the 60-draw
retry delay. A size change bypasses the delay.
See `OpenGlVectorLayerRenderer::Draw` and the renderer/control regression tests.

The OpenGL lazy fill-mesh cache belongs to the renderer and is shared with
temporary renderers. It is keyed by `LayerId` and the immutable scene identity:
reordering, hiding, viewport changes, and backend selection preserve entries,
while a changed scene for one layer invalidates only that entry. The coordinator
prunes removed IDs before every backend choice, and explicit layer or scene
invalidation releases the retained CPU mesh storage.

Core objects are not thread-safe by default. The control serializes their use.
ActiveX-specific implementation units are also compiled into
`MapWinGIS.ActiveX.Impl.lib`, allowing native tests to exercise them without
Expand All @@ -67,10 +74,11 @@ The control exposes a deliberately small v6 automation API. It does not expose
the broad MapWinGIS 5 map, layer, shape, event, or editing surface. The current
render scene is built in source coordinates, without reprojection; backend
support differs: GDI draws the original rings with an alternate fill rule,
while OpenGL fill draws require explicitly prepared meshes. Normal Core scene
creation is mesh-free; fill operations without usable meshes fall back to
GDI, which fills the original rings. The OpenGL renderer also has an
outline mode that draws those rings without triangulation.
while OpenGL fill draws require triangle meshes. Normal Core scene
creation is mesh-free; OpenGL fills prepare missing meshes lazily and fall
back to GDI if preparation fails or an explicitly prepared mesh is unusable.
GDI fills the original rings. The OpenGL renderer also has an outline mode
that draws those rings without triangulation.
Consult the current implementation and architecture documentation before
assuming a capability or compatibility guarantee.

Expand Down
5 changes: 4 additions & 1 deletion .github/plans/Vector-Rendering-Performance-Improvement.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ Copilot: Update this checklist as each phase is implemented. Only mark a phase c
- Explicitly prepared meshes remain preferred; outline and GDI paths continue to use source rings without requiring fill meshes.
- Triangulation failures, including exceptions from GDAL logging callbacks, return to the coordinator for GDI fallback without preventing outline rendering.
- Limitation: triangulation remains synchronous, and broader cache ownership, memory limits, and invalidation rules remain Phase 4 work.
- [ ] **Phase 4 – Add intelligent caching and invalidation** (PR 4)
- [x] **Phase 4 – Add intelligent caching and invalidation** (PR 4)
- OpenGL lazy fill meshes are cached per stable layer ID and immutable scene identity, surviving viewport changes, layer reordering, temporary draws, visibility changes, and backend selection.
- Scene replacement, explicit per-layer invalidation, removed-layer pruning, and clear-all invalidation release only the affected generated mesh storage; retained mesh bytes are tracked for tests.
- Limitation: no cache-size limit or eviction policy was added because measurements did not establish that the additional complexity is justified.
- [ ] **Phase 5 – Introduce viewport-aware geometry processing** (PR 5)
- [ ] **Phase 6 – Optimize OpenGL rendering and data transfer** (PR 6)
- [ ] **Phase 7 – Testing and regression prevention** (PR 7)
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ release the loaded datasets before switching or refreshing them.
Core stores polygon coordinates in flat buffers and caches prepared geometry
per map layer. Visibility changes reuse that geometry without rereading
datasets or triangulating polygons again. OpenGL generates missing fill
meshes on the first fill draw and reuses them for that render scene.
meshes on the first fill draw and caches them per stable map layer. Viewport
changes, backend selection, layer reordering, and temporary draws reuse valid
entries; changed or removed layers release or replace only their own meshes.

## Build and test

Expand Down
5 changes: 5 additions & 0 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,11 @@ cache directly. Layer scenes are immutable and shared through
`std::shared_ptr<const VectorRenderScene>`, so assembling the map snapshot
shares cached coordinates and meshes instead of copying them; peak memory
stays at one copy of each layer's geometry.
OpenGL's lazily generated fill meshes have a second, backend-owned cache keyed
by stable `LayerId` and the immutable scene identity. Reordering, hiding,
redrawing, viewport changes, and backend selection retain valid entries.
Replacing one layer scene invalidates only that layer's entry; removed layers
and explicit invalidation release their generated mesh storage.
When a driver cannot provide a fast extent, scene preparation computes bounds
during the geometry traversal. It caches those bounds on the vector layer,
so a later map fit does not scan the layer again.
Expand Down
Loading