Skip to content

Conversation

@MartyIX
Copy link
Contributor

@MartyIX MartyIX commented Sep 22, 2025

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

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Sep 22, 2025
@dotnet-policy-service
Copy link
Contributor

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.

@jfversluis
Copy link
Member

jfversluis commented Sep 22, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz jsuarezruiz added platform/windows area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing labels Sep 23, 2025
jsuarezruiz
jsuarezruiz previously approved these changes Sep 23, 2025
else if (element is FrameworkElement frameworkElement)
if (!isClipped && element is ContentPanel contentPanel)
{
return contentPanel.BorderPath?.GetAlphaMask();
Copy link
Contributor Author

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

  1. 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.

Copy link

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.

Copy link
Contributor Author

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:

  1. Merge the PR even though the shadows are worse with the reasoning that "slow shadows produce worse user experience than slightly off shadows".
  2. 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.

@StephaneDelcroix
Copy link
Contributor

can we move this back to draft ?

@MartyIX MartyIX marked this pull request as draft October 15, 2025 07:37
@PureWeen PureWeen dismissed jsuarezruiz’s stale review October 31, 2025 20:34

changes still needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing community ✨ Community Contribution platform/windows

Projects

None yet

6 participants