Skip to content
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

[Uno] Use SKSwapChainPanel whenever possible #2629

Open
jeromelaban opened this issue May 10, 2024 · 2 comments
Open

[Uno] Use SKSwapChainPanel whenever possible #2629

jeromelaban opened this issue May 10, 2024 · 2 comments

Comments

@jeromelaban
Copy link

jeromelaban commented May 10, 2024

The problem

The current implementation for WinUI and Uno Platform relies on SKXamlCanvas:

private readonly SKXamlCanvas _canvas = CreateRenderTarget();

SKXamlCanvas is using software rendering (except on Uno Platform Skia Desktop targets) which get as slower as the size it is rendered to, which is particularly visible on 4K screens.

The proposed solution

Use SKSwapChainPanel on supported platforms, being iOS/Android targets (catalyst does not support OpenGL) and WebAssembly. On Skia targets, SKSwapChainPanel automatically uses hardware acceleration.

On Windows, AngleSwapChainPanel will be available for WinAppSDK in SkiaSharp 3.0.

Here's an usage example for both canvases.

@jeromelaban jeromelaban changed the title Use SKSwapChainPanel whenever possible [Uno] Use SKSwapChainPanel whenever possible May 10, 2024
@inforithmics
Copy link
Contributor

Intresting, I think it can be implemented like in MAUI with UseGPU property. Where the default is depending on the running platform.

@inforithmics
Copy link
Contributor

pull request: #2629

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants