-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Windows] Fix performance issue using Shadows [TEST][NO MERGE] #31713
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
base: main
Are you sure you want to change the base?
Conversation
…172.cs Co-authored-by: Copilot <[email protected]>
# Conflicts: # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/Issue24414Test_4.png # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/Issue24414Test_5.png
|
Hey there @@MartyIX! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
Azure Pipelines successfully started running 3 pipeline(s). |
| else if (element is FrameworkElement frameworkElement) | ||
| if (!isClipped && element is ContentPanel contentPanel) | ||
| { | ||
| return contentPanel.BorderPath?.GetAlphaMask(); |
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.
Note: The performance improvement comes from this line of code. However, this is also the reason why the shadows moved a bit1.
In the end, I wonder if this line is even correct as the source of data for the shadow is just the border path and not the complete content panel.
Footnotes
-
I did try to comment out this line and the shadows and the result is that the shadows look more like on other platforms but the performance is very unsatisfactory. ↩
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.
Maybe you can add a comment around this line so that things can be revisited in the future without extensive investigation.
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.
@hez2010 A comment can be added, though it's not surprising because operations below
var pixels = await bitmap.GetPixelsAsync();
// ..
using (var softwareBitmap = SoftwareBitmap.CreateCopyFromBuffer(can be easily guessed as slow and they are slow.
However, I think the main question now is: "What's the next step?" This PR makes shadows faster but the shadow is "worse" in quality (it's shifted). I personally played with code but I'm not sure how to fix it.
There are two options:
- Merge the PR even though the shadows are worse with the reasoning that "slow shadows produce worse user experience than slightly off shadows".
- Somebody must figure out how to fix shadow offsets to be correct. But I don't have free cycles to do in the near future.
|
can we move this back to draft ? |
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description of Change
This PR is #18337 with fixed conflicts.
Issues Fixed
Fixes #18205