Skip to content

MapWinGIS6 – Vector Rendering Performance Improvement Plan - #89

Open
pmeems wants to merge 2 commits into
developmentfrom
phase2-render-geometry-separation
Open

pmeems wants to merge 2 commits into
developmentfrom
phase2-render-geometry-separation

Conversation

@pmeems

@pmeems pmeems commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Motivation

Polygon triangulation accounted for most scene-preparation time even when the initial rendering path only needed source geometry or outlines.

Context

Implements Phase 2 of the vector rendering performance plan on top of the Phase 1 diagnostics and benchmark coverage.

Key design decisions

  • Scene creation now defaults to source rings and rendering metadata without GEOS triangulation.
  • Fill-mesh preparation remains explicitly available for fill-specific callers and preserves existing mesh failure behavior.
  • GDI fills or outlines directly from source rings. OpenGL can render outlines without meshes; requested OpenGL fills still require valid meshes and fall back to GDI when they are absent.
  • Updated .ai/memory/architecture/activex.md to record the mesh-free scene and outline behavior.

Dependencies and validation

Phase 3 will add lazy OpenGL fill triangulation, followed by cache work in Phase 4. CMake Debug x64 built successfully with no C++ warnings; CTest passed 451/451 non-interactive tests (four expected skips).

- Build polygon scenes without triangulation by default.
- Add mesh-free GDI and OpenGL outline rendering.
- Preserve explicit fill-mesh preparation and GDI fallback.

Co-authored-by: Copilot <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Two regression tests can pass or skip without exercising OpenGL, leaving staging-buffer preservation and outline validation inadequately verified.

2 open issues
What changed in this PR

Implements Phase 2 of the rendering performance plan by making polygon triangulation optional during scene creation. This avoids unnecessary preparation work for GDI rendering and OpenGL outlines.

Changes:

  • Makes fill meshes opt-in while preserving source rings and bounds.
  • Adds outline-only rendering through both backends, retaining GDI fallback for OpenGL fills without usable meshes.
  • Updates regression tests, benchmarks, documentation, and phase tracking.

Builds and tests were not run during this review.

File Description
tests/​MapWinGIS.Core.Tests/​VectorRenderSceneTests.cpp Checks that default scenes contain no fill meshes.
tests/​MapWinGIS.Core.Tests/​PolygonTriangulationTests.cpp Explicitly requests meshes for triangulation tests.
tests/​MapWinGIS.Core.Tests/​PerformanceDiagnosticsTests.cpp Distinguishes default preparation from requested triangulation.
tests/​MapWinGIS.Core.Tests/​MapViewTests.cpp Explicitly prepares meshes for viewport-reuse coverage.
tests/​MapWinGIS.Core.Tests/​MapRenderSceneTests.cpp Checks mesh-free defaults across visible layers.
tests/​MapWinGIS.ActiveX.Tests/​VectorLayerRendererTests.cpp Adds mesh-free outline and mode-specific support tests.
tests/​MapWinGIS.ActiveX.Tests/​RenderingBaselineTests.cpp Measures OpenGL outlines and explicitly prepared fills.
tests/​MapWinGIS.ActiveX.Tests/​OpenGlVectorLayerRendererTestAccess.h Exposes mode-aware support checks to tests.
src/​MapWinGIS.Core/​src/​rendering/​VectorRenderScene.cpp Updates the file header to describe optional triangulation.
src/​MapWinGIS.Core/​include/​mapwingis/​rendering/​VectorRenderScene.h Disables mesh preparation by default and documents the contract.
src/​MapWinGIS.Core/​include/​mapwingis/​rendering/​MapRenderScene.h Documents mesh-free map scene defaults.
src/​MapWinGIS.ActiveX/​VectorRenderBackend.h Defines fill and outline modes in the backend interface.
src/​MapWinGIS.ActiveX/​VectorLayerRenderer.h Adds a render-mode argument to the coordinator.
src/​MapWinGIS.ActiveX/​VectorLayerRenderer.cpp Forwards the requested mode to both backends.
src/​MapWinGIS.ActiveX/​OpenGlVectorLayerRenderer.h Declares mode-aware validation and rendering.
src/​MapWinGIS.ActiveX/​OpenGlVectorLayerRenderer.cpp Draws outlines without requiring or submitting fill meshes.
src/​MapWinGIS.ActiveX/​GdiVectorLayerRenderer.h Accepts the render-mode argument.
src/​MapWinGIS.ActiveX/​GdiVectorLayerRenderer.cpp Uses a null brush for outline-only drawing.
docs/​TESTING.md Updates benchmark behavior and historical context.
docs/​ARCHITECTURE.md Documents optional meshes and backend fallback behavior.
.github/​plans/​Vector-Rendering-Performance-Improvement.md Marks Phase 2 complete and records deferred work.
.ai/​memory/​architecture/​activex.md Records mesh-free scenes and OpenGL outline support.

Review effort: Balanced

@pmeems pmeems left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review. Final decision is with the human reviewer.

No additional findings beyond the two existing open OpenGL test-coverage comments. Their line findings were not duplicated.

- Seed an explicitly triangulated layer for scaled-draw staging checks.

- Require outline rendering after an OpenGL availability probe succeeds.

Co-authored-by: Copilot <[email protected]>

@Julian-MW Julian-MW left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review. Final decision is with the human reviewer.

I reviewed the changed files and the surrounding rendering paths, including the mesh-preparation default, GDI/OpenGL fill and outline behavior, backend fallback, and the tests added/updated for the new behavior. I found no new actionable issues.

@pmeems
pmeems enabled auto-merge (squash) November 20, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants