-
Notifications
You must be signed in to change notification settings - Fork 540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[UWP]: Renderer [WRL] -> [WinRT] #6794
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking like a really great start! A few things noted - bunch of TODOs that need addressing, one comment about converting an E_FAIL/return-out-to-caller to an access-violation, and a few nits on the change.
If it's set correctly. I don't think you need rtxaml anywhere. just winrt::Thickness. In reply to: 982875118 In reply to: 982875118 Refers to: source/uwp/Renderer/lib/ActionHelpers.cpp:15 in a74771b. [](commit_id = a74771b, deletion_comment = False) |
in WinUI, some magic played in microsoft-ui-xaml\dev\inc\CppWinRTIncludes.h.
In reply to: 982875118 Refers to: source/uwp/Renderer/lib/ActionHelpers.cpp:15 in a74771b. [](commit_id = a74771b, deletion_comment = False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕐
I'll have a look as to how organize namespaces before merging:) |
Can you double check this? I'm wondering it may cause memory leak. when we set callback handler, we may need to use auto_revoke or something. possible call:
Refers to: source/uwp/Renderer/lib/ActionHelpers.cpp:578 in 394589e. [](commit_id = 394589e, deletion_comment = False) |
It applies to all event callback if you have In reply to: 1021532853 Refers to: source/uwp/Renderer/lib/ActionHelpers.cpp:578 in 394589e. [](commit_id = 394589e, deletion_comment = False) |
What's peek_innards? if it's weak to strong ref convert, you may need nullptr check here Refers to: source/uwp/Renderer/lib/XamlHelpers.h:58 in 394589e. [](commit_id = 394589e, deletion_comment = False) |
false /* wrap */ In reply to: 1021678384 Refers to: source/uwp/Renderer/lib/XamlHelpers.h:72 in 394589e. [](commit_id = 394589e, deletion_comment = False) |
move
In reply to: 1021681055 Refers to: source/uwp/Renderer/lib/XamlHelpers.h:85 in 394589e. [](commit_id = 394589e, deletion_comment = False) |
nit: In reply to: 1021683309 In reply to: 1021683309 Refers to: source/uwp/Renderer/lib/XamlHelpers.cpp:67 in 394589e. [](commit_id = 394589e, deletion_comment = False) |
nit: tab to space In reply to: 1021694975 In reply to: 1021694975 Refers to: source/uwp/Renderer/lib/XamlHelpers.cpp:802 in 394589e. [](commit_id = 394589e, deletion_comment = False) |
it's too hacky to convert "stretch" to double. for example: if (width == L"stretch") { } else ... { In reply to: 1021702420 Refers to: source/uwp/Renderer/lib/XamlHelpers.cpp:214 in 394589e. [](commit_id = 394589e, deletion_comment = False) |
if (!fallbackControl) In reply to: 1021705591 Refers to: source/uwp/Renderer/lib/XamlHelpers.cpp:323 in 394589e. [](commit_id = 394589e, deletion_comment = False) |
peek_innards is the same as winrt:;get_self for our own implementations but with additional GUID check to make sure that the implementation is our own and not something coming from outside :) |
I agree there is a better way to deal with this but CalculateColumnWidth will deal with these scenarios for now:) |
leak shouldn't happen in any of these scenarios because both the subscriber (class to which method belongs, in this case lambda is most likely compiled to the member class method of the class that's subscribing) and publisher (button) have the same lifetimes. Once the rendered card is disposed, the button will be disposed of, and when doing so, it will release the ref on the subscriber :) |
Related Issue
This PR closes #6323.
Description
I've converted UWP Renderer to WinRT.
How Verified
In the process of verification
I've introduced some regressions and still working on them.
There are a lot of spacing issues, not sure why clang formatter haven't dealt with them or may be I didn't run it on everything yet - I'm still working on it (I apologize for that).
Reviewing
I've left a lot of comments where I'm unsure of what I've done with the mark TODO.
Everybody who's reviewing the changes, could you please carefully look at those comments and respond if you know how to do it correctly :)
Branch with the history and comments if anybody is curious: https://github.com/microsoft/AdaptiveCards/tree/u/vsiliush/renderer-winrt
Compilation Warnings
I've turned off all Warnings for now as well as removed treating warnings as errors (/Wall and /WX are turned off). I'll restore it in the end when the PR is ready to merge.
Microsoft Reviewers: Open in CodeFlow