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

[FEATURE] WebAssembly Support #1219

Closed
mattleibow opened this issue Apr 8, 2020 · 11 comments
Closed

[FEATURE] WebAssembly Support #1219

mattleibow opened this issue Apr 8, 2020 · 11 comments
Labels
os/WASM Issues running on WebAssembly (ASP.NET Blazor or Uno Platform) type/enhancement type/feature-request
Milestone

Comments

@mattleibow
Copy link
Contributor

mattleibow commented Apr 8, 2020

The is the issue to track the main WebAssembly support. Several issues have already been opened on this topic in various parts:

We already have a running build of the required versions in #986 and have published that to the internal feed as 2.80.0-pr.986.37.

There are a few missing things on that build (see the PR) but we can now start to work on the more general WASM builds.

Some issues that are relevant/related:

@RChrisCoble
Copy link

RChrisCoble commented Apr 8, 2020

Regarding:

[FEATURE] Support SkiaSharp as a Blazor Extension (#1194)
This is what we are going to be doing here.

When it's a Blazor Extension you can utilize the SkiaSharp API on the Client or Server Blazor deployment model. I believe what you are doing here is akin to the forked Uno repo, allowing Skia/SkiaSharp to work properly when running under WASM in a client browser. My specific feature request around making it a Blazor Extension was to also allow the API to run on the server with the rendering happening on the client.

This would most likely mean Skia (and maybe SkiaSharp) would need to be running in the Client Browser, with the SkiaSharp API calls being packaged up and marshaled over the Blazor SignalR connection when the Blazor Extension was running on the server.

An example of this was done with the HTML5 Canvas here: https://github.com/BlazorExtensions/Canvas

If you look at that GitHub example, they wrote a wrapper around the HTML5 canvas API's which ended up doing one of the following: (1) If the Blazor Extension was running in a client browser, issued the draw call directly or (2) If the Blazor Extension was running on the server, marshaled the call over the SignalR connection to the client to be executed.

The Blazor server deployment model is valuable in situations where you can't deploy multiple MB's of DLL's down to the client just to draw anything. (with that multiple MB's NOT being Skia/SkiaSharp, but the business logic using the SkiSharp API.)

@hawkerm
Copy link

hawkerm commented Jun 1, 2020

Any updates on this issue? I found this feed https://aka.ms/skiasharp-eap/index.json from another issue, assume that has the same bits called out above?

Is there any sample project in the develop branch that shows how to use the WASM bits yet?

I'm interested in testing out SkiaSharp for a Blazor WebAssembly Client App.

Thanks!

@michaldobrodenka
Copy link
Contributor

Maybe stupid question, I haven't tried it yet - is also HarfBuzz supported on wasm?

@mattleibow
Copy link
Contributor Author

I think so... I don't think I have a build for that today, but was @Gillibald having a look... Need to check discord again on that one. But I recall that someone managed to get a build of it.

@Gillibald
Copy link
Contributor

Y I could successfully build it for wasm. We had some linker issues that got resolved I guess. We still need the auto generated API bits to run it successfully. We are not far away.

@mattleibow
Copy link
Contributor Author

Another related issue for getting better WASM support: dotnet/runtime#44636

@nor0x
Copy link

nor0x commented Apr 22, 2021

Hi @Gillibald 👋
is there an update about HarfBuzz on WebAssembly? I'm working on an UNO application and currently get System.DllNotFoundException: libHarfBuzzSharp

@Gillibald
Copy link
Contributor

The next release of SkiaSharp should contain all the native bits you need. There should be a preview out if I am not mistaken.

@Gillibald
Copy link
Contributor

@nor0x
Copy link

nor0x commented Apr 22, 2021

nice! thanks for info. I will try the HarfBuzzSharp.NativeAssets.WebAssembly package

@mattleibow
Copy link
Contributor Author

This has just been merged in #1811

@mattleibow mattleibow added this to the v2.88.0 milestone May 22, 2022
@mattleibow mattleibow moved this to Done in SkiaSharp Backlog May 22, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
os/WASM Issues running on WebAssembly (ASP.NET Blazor or Uno Platform) type/enhancement type/feature-request
Projects
Status: Done
Development

No branches or pull requests

6 participants