Skip to content

refactor: use ComPtr more and clean up DCompPresenter#593

Merged
Aurumaker72 merged 5 commits intomainfrom
comptr-refactor
Apr 4, 2026
Merged

refactor: use ComPtr more and clean up DCompPresenter#593
Aurumaker72 merged 5 commits intomainfrom
comptr-refactor

Conversation

@Aurumaker72
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 3, 2026 21:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 from ViewHelpers.h and inlined ownership into DCompPresenter.
  • Converted GDIPresenter and DCompPresenter COM members to ComPtr and removed manual Release() calls.
  • Introduced a global ComPtr alias via stdafx.h and removed a redundant local alias in MGECompositor.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.

@Aurumaker72 Aurumaker72 merged commit 6f01ce8 into main Apr 4, 2026
14 of 15 checks passed
@Aurumaker72 Aurumaker72 deleted the comptr-refactor branch April 4, 2026 17:25
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.

2 participants