-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Enable antialiasing based on EdgeMode in DrawBitmap #20116
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
Enable antialiasing based on EdgeMode in DrawBitmap #20116
Conversation
|
Thank you! Could you please add a matching render test? |
|
I'm sorry, I'm not very familiar with rendering test, so adding tests might take a long time. Or could someone take over the testing part?😅 |
|
You can test this PR using the following package version. |
|
I have attempted to add rendering tests. |
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.
Thanks for adding the tests :)
LGTM, thank you!
|
Note: we're removing Direct2D in #20132, the Direct2D tests can be removed from this PR (I'll do it if you don't @snowflysky). |
This reverts commit 63dd671.
Okay, I have deleted the Direct2D tests. |
|
You can test this PR using the following package version. |
What does the pull request do?
This PR addresses the issue where Image controls exhibit jagged/aliased edges when a transform (such as RotateTransform) is applied in the Skia backend.
It enables antialiasing for bitmap drawing operations by configuring the
SKPaint.IsAntialiasproperty, while still respectingRenderOptions.EdgeMode.What is the current behavior?
Currently, when drawing a Bitmap via DrawingContext.DrawImage, the
SKPaintused defaults toIsAntialias = false.This causes the edges of the bitmap to appear jagged (aliased) when the image is rotated or drawn off the pixel grid, even if
RenderOptions.BitmapInterpolationModeis set toHighQuality.What is the updated/expected behavior with this PR?
Checklist
Breaking changes
None. This is a visual improvement. Users who specifically require aliased edges can still achieve them by setting RenderOptions.EdgeMode="Aliased"
Fixed issues
Fixes #20079