Skip to content

perf(images): use mipmapping when downscaling instead of bicubic or Lanczos samplers - #20663

Merged
agneszitte merged 9 commits into
unoplatform:masterfrom
ramezgerges:skia_mipmap
Jun 4, 2025
Merged

agneszitte merged 9 commits into
unoplatform:masterfrom
ramezgerges:skia_mipmap

Conversation

@ramezgerges

Copy link
Copy Markdown
Contributor

GitHub Issue (If applicable): closes #17325

PR Type

What kind of change does this PR introduce?

What is the current behavior?

What is the new behavior?

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@github-actions github-actions Bot added the area/skia ✏️ Categorizes an issue or PR as relevant to Skia label May 30, 2025
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot added the area/automation Categorizes an issue or PR as relevant to project automation label May 30, 2025
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 167319 has failed on Uno.UI - CI.

@jeromelaban
jeromelaban requested a review from Copilot June 2, 2025 12:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves image downscaling performance by switching to mipmapping instead of using bicubic or Lanczos samplers. Key changes include adjusting offset values in image brush tests, replacing custom downsampling shader logic with SKSamplingOptions that leverage mipmapping, and adding new performance tests to assess the improvements.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Media/Given_ImageBrush.cs Adjusted border offset logic for APPLE_UIKIT and SKIA platforms
src/Uno.UI.Composition/Composition/CompositionSurfaceBrush.skia.cs Updated downsampling path to use mipmapping instead of a custom shader implementation
src/SamplesApp/UITests.Shared/Windows_UI_Xaml/Performance/Performance_ManyImages.xaml.cs Added performance test for rendering many images
src/SamplesApp/UITests.Shared/Windows_UI_Xaml/Performance/Performance_ManyImages.xaml New XAML page for performance testing
src/SamplesApp/UITests.Shared/UITests.Shared.projitems Included new files in the project build
Comments suppressed due to low confidence (1)

src/Uno.UI.Composition/Composition/CompositionSurfaceBrush.skia.cs:116

  • The condition for choosing the downsampling path has changed from comparing sigma values to a direct comparison of image and bounds dimensions; please confirm that this new logic aligns with the intended quality and performance goals.
if (scs.Image.Width < bounds.Width || scs.Image.Height < bounds.Height)

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 167463 has failed on Uno.UI - CI.

@jeromelaban jeromelaban left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Works very nicely!!

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 167554 has failed on Uno.UI - CI.

@ramezgerges
ramezgerges enabled auto-merge June 4, 2025 12:46
@agneszitte
agneszitte disabled auto-merge June 4, 2025 14:44
@agneszitte
agneszitte merged commit 0a75939 into unoplatform:master Jun 4, 2025
@ramezgerges
ramezgerges deleted the skia_mipmap branch June 4, 2025 14:50
@jeromelaban jeromelaban mentioned this pull request Jun 6, 2025
1 of 2 tasks
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area/automation Categorizes an issue or PR as relevant to project automation area/skia ✏️ Categorizes an issue or PR as relevant to Skia

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Skia] downscaling images is very blurry

5 participants