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

Add support for SKXamlCanvas on Uno Platform SkiaSharp backends #1634

Closed
wants to merge 14 commits into from

Conversation

jeromelaban
Copy link
Contributor

@jeromelaban jeromelaban commented Feb 17, 2021

Description of Change

Add support for SKXamlCanvas on Uno Platform SkiaSharp backends, by using software rendering onto an off-screen surface.

While the SKSwapChainPanel is present (as it is part of the reference API shared with WebAssembly), it is currently not implemented.

In order to support this change, the SKXamlCanvas which was incorrectly inheriting from FrameworkElement, is now inheriting from Canvas, which exposes the Background property. It is a breaking change, but all the properties of FrameworkElement are also present on Canvas, which will not break existing code.

Note that non-breaking fixes are needed in Uno for this change to work properly (unoplatform/uno#5266), those will be included as part of Uno 3.5.x and 3.6.

API Changes

Changed:

  • SKXamlCanvas : FrameworkElement -> SKXamlCanvas : Canvas

Behavioral Changes

None.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Changes adhere to coding standard
  • Updated documentation

@jeromelaban
Copy link
Contributor Author

Looks like the rebuild passed most of the tests :) The rest is likely azure devops security from forks. @mattleibow Is there something I can help you with ?

@mattleibow
Copy link
Contributor

Sorry about the incredibly delay, MAUI was a bit of beast :)

Is it possible to add a sample for the Skia backends? Only has to be a basic sample in say samples\Basic\Uno\SkiaSharpSample.Xxx? The WASM sample probably will be the easiest to copy for the targets and props - if they are needed.

I notice there is a targets file to set the UnoRuntimeEnabledPackage property. If one is needed (very likely if I understand), then just move it to the source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno folder and link both WASM and the skia backends to copy it. That way all the samples can get it instead of having to build a specific one.

Now that I got some time, I hope to merge this and release a preview.

@jeromelaban jeromelaban marked this pull request as draft March 25, 2021 15:01
@jeromelaban jeromelaban force-pushed the dev/jela/skia-on-skia branch 2 times, most recently from 2ded64d to bb8b8c2 Compare April 19, 2021 19:10
@jeromelaban jeromelaban marked this pull request as ready for review April 19, 2021 19:12
@jeromelaban
Copy link
Contributor Author

@mattleibow do you know what the build errors are ? I'd guess it's fork-related authorizations :)

@MaksimNikonovOrioninc
Copy link

@mattleibow Is it possible to approve this pool request? our team are waiting for that!

…ckends

This enables SKXamlCanvas for Uno Platform's support for for GTK (Linux, Windows, macOS), WPF and Tizen, for Uno 3.6 and later.
@jeromelaban
Copy link
Contributor Author

Closing in favor of #1704

@jeromelaban jeromelaban closed this Jun 8, 2021
mattleibow added a commit that referenced this pull request Jun 11, 2021
…1634) (#1704)

* fix: [Uno] SKXamlCanvas is now a Canvas
* feat: Add support for SKXamlCanvas when running on SkiaSharp based backends
   This enables SKXamlCanvas for Uno Platform's support for for GTK (Linux, Windows, macOS), WPF and Tizen, for Uno 3.6 and later.
* feat: Add Uno Skia samples
* bump uno samples to latest uno.ui for VS 16.10 pre3 changes
* Update Uno all packages
* ci: adjust for wasm net5
* fix: Update WPF sample
* Remove unsupported tizen sample
* chore: Update to Uno.UI 3.7.6 to fix invalid SkiaSharp.Views dependency
* Update llvm to v11.1


Co-authored-by: Jerome Laban <jerome.laban@nventive.com>
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

Successfully merging this pull request may close these issues.

3 participants