refactor: use ComPtr more and clean up DCompPresenter#593
Merged
Aurumaker72 merged 5 commits intomainfrom Apr 4, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the Win32 Lua presenters to rely more consistently on Microsoft::WRL::ComPtr for COM lifetime management, and removes the old shared DirectComposition context helper from ViewHelpers.h as part of cleaning up DCompPresenter.
Changes:
- Removed the old
CompositionContext/create_composition_context()helper fromViewHelpers.hand inlined ownership intoDCompPresenter. - Converted
GDIPresenterandDCompPresenterCOM members toComPtrand removed manualRelease()calls. - Introduced a global
ComPtralias viastdafx.hand removed a redundant local alias inMGECompositor.cpp.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Views.Win32/ViewHelpers.h | Removes the old DirectComposition helper context struct/function. |
| src/Views.Win32/stdafx.h | Adds a global ComPtr alias for Views.Win32 compilation units. |
| src/Views.Win32/lua/presenters/GDIPresenter.h | Switches D2D members to ComPtr. |
| src/Views.Win32/lua/presenters/GDIPresenter.cpp | Removes manual COM releases; updates ComPtr usage. |
| src/Views.Win32/lua/presenters/DCompPresenter.h | Replaces CompositionContext with explicit ComPtr members + helper method. |
| src/Views.Win32/lua/presenters/DCompPresenter.cpp | Reworks initialization/resize/present paths to use ComPtr fields. |
| src/Views.Win32/components/MGECompositor.cpp | Drops now-redundant using Microsoft::WRL::ComPtr;. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.