Repository navigation
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The interface extension can crash clients using older controls, and unresolved rendering issues affect memory limits, context recovery, and viewport bounds.
4 open issues
What changed in this PR
This PR adds runtime OpenGL capability checks and rendering controls to the ActiveX layer, while preserving GDI fallback and keeping graphics dependencies outside Core.
Changes:
- Exposes backend preference, active backend, and rendering diagnostics through COM.
- Adds framebuffer-size checks, a 64 MiB staging-size limit, single-buffer readback conversion, and context recovery.
- Extends native tests, sample-host checks, and architecture documentation.
Builds and tests were not run during this review. The PR reports native test success; interactive screen-pixel validation remains pending.
| File | Description |
|---|---|
| tests/MapWinGIS.Core.Tests/VectorLayerRendererTests.cpp | Tests preferences, diagnostics, and rendering limits. |
| tests/MapWinGIS.Core.Tests/ActiveXActivationTests.cpp | Tests new automation properties and preference validation. |
| src/MapWinGIS.ActiveX/VectorRenderBackend.h | Defines backend preferences. |
| src/MapWinGIS.ActiveX/VectorLayerRenderer.h | Adds preference and diagnostic state. |
| src/MapWinGIS.ActiveX/VectorLayerRenderer.cpp | Applies preferences and reports fallback status. |
| src/MapWinGIS.ActiveX/OpenGlVectorLayerRenderer.h | Declares limit checks and context-recovery state. |
| src/MapWinGIS.ActiveX/OpenGlVectorLayerRenderer.cpp | Implements capability checks, staging limits, recovery, and in-place conversion. |
| src/MapWinGIS.ActiveX/MapWinGISControl.h | Declares rendering automation accessors. |
| src/MapWinGIS.ActiveX/MapWinGISControl.cpp | Implements backend properties and preference parsing. |
| src/MapWinGIS.ActiveX/MapWinGIS.ActiveX.idl | Exposes rendering properties through COM. |
| samples/CSharp/ActiveXTestHost/MainForm.cs | Displays rendering status and verifies GDI selection. |
| docs/ARCHITECTURE.md | Documents backend selection, limits, and fallback behavior. |
Review effort: Balanced
- Move rendering properties to IMapWinGISControl2 (new IID) and keep IMapWinGISControl immutable. - Reject targets exceeding GL_MAX_VIEWPORT_DIMS as well as the renderbuffer limit. - Keep the invalid-context flag until a replacement initializes so recreation is retried. - Bound staging-buffer capacity and resize peaks to the 64 MiB budget. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
pmeems
left a comment
There was a problem hiding this comment.
One additional test-coverage concern: the automated host test changes the preference to GDI here and leaves it there. Since this check runs before the resize/repaint checks, those later checks exercise only GDI and no longer validate the default OpenGL path. Please restore the original preference after asserting GDI selection (ideally in a finally block), or add a separate fresh-control test that explicitly verifies OpenGL rendering.
The CPU backend check now restores the previous preference in a finally block so later resize and repaint checks exercise the default path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>


Phase 6 adds runtime OpenGL capability detection and bounded rendering resources while preserving GDI as a supported fallback. The control now exposes backend preference, active backend, and fallback diagnostics; one reusable 64 MiB staging buffer bounds readback memory.
No new dependencies were introduced. Debug x64 build completed without warnings and the native suite passed (144 passed, 2 skipped). The automated host verified activation, backend selection/status, layer loading, and resize; its screen-pixel check did not match in this noninteractive environment and needs an interactive desktop run.