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

WASM/WebAssembly Support #25

Open
davidkutas opened this issue Oct 14, 2024 · 8 comments
Open

WASM/WebAssembly Support #25

davidkutas opened this issue Oct 14, 2024 · 8 comments

Comments

@davidkutas
Copy link

This is a wonderful project.

Are there any tutorials out there to use this with WASM/WebAssembly/esmjs?

@djowel
Copy link
Member

djowel commented Oct 14, 2024

I'm sorry, but the project does not (yet) support WASM/WebAssembly/esmjs.

@bruno-j-nicoletti
Copy link

I'd be very interested in a WASM/Web build as well. Skia does provide a Wasm build so you can call it from JS, which in theory means it should be possible to backend artist onto Wasm build of Skia so artist/elements based apps will run in the browser. I'm going to have a play with the skia Wasm build and see how much hair I lose in the process of making something work.

https://skia.org/docs/user/modules/canvaskit/

@djowel
Copy link
Member

djowel commented Oct 28, 2024

I'd be happy if someone could take the lead on implementing this. Unfortunately, I'm swamped with other projects at the moment.

@bruno-j-nicoletti
Copy link

I've spent a fruitless day just trying to figure out google's build system used for Skia. I've gone and asked their mailing list to see if anyone else has had success making a Wasm verions of the skia libs you can link against.

@djowel
Copy link
Member

djowel commented Oct 29, 2024

I've spent a fruitless day just trying to figure out google's build system used for Skia. I've gone and asked their mailing list to see if anyone else has had success making a Wasm verions of the skia libs you can link against.

Skia's build system is a PITA! I'll tell you that.

@bruno-j-nicoletti
Copy link

bruno-j-nicoletti commented Nov 7, 2024

I'm currently working on a library that will return a C++ Skia::Surface which will draw onto an HTML canvas. I'll package this all up into a new repo. That will at least be the start of a WASM/Web port of elements.

Currently I've bodged something that does call into C++ compiled to WASM to do the drawing, but it's ugly and hacked out of a cut down version of their CanvasKit JS module, which gives JavaScript bindings to Skia. I've a screenshot of it in action.

FWIW, someone has just put together a repo that simplifies the building of skia on all platforms, see https://github.com/olilarkin/skia-builder.

Screenshot 2024-11-07 at 16 26 50

@bruno-j-nicoletti
Copy link

That was a more surprisingly horrible task than I thought it would be, even though I knew it was going to horrible.

In my spare time I've put a C++ library together than packages up all the skia web binding code and let you run a C++ program that pipes skia calls to a browser canvas. Still a work in progress, but getting close. I need to incorporate skia into the build process as it currently relies on an external canvaskit wasm build of skia.

https://github.com/bruno-j-nicoletti/SkiaWebBind

@djowel
Copy link
Member

djowel commented Nov 21, 2024

That was a more surprisingly horrible task than I thought it would be, even though I knew it was going to horrible.

In my spare time I've put a C++ library together than packages up all the skia web binding code and let you run a C++ program that pipes skia calls to a browser canvas. Still a work in progress, but getting close. I need to incorporate skia into the build process as it currently relies on an external canvaskit wasm build of skia.

https://github.com/bruno-j-nicoletti/SkiaWebBind

Wow, I can imagine what a horrible task that would be!

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

3 participants