Running a native Skia App in Browser using WASM

35 views
Skip to first unread message

soh...@chromium.org

unread,
Jul 25, 2022, 10:27:53 AMJul 25
to skia-discuss
Hi !

We were planning to experiment with running a native skia app via wasm in browser.
Although, Canvaskit is a good direction. But, we plan to have the application written in C++.

Is there any sample code (and std tooling like using emscripten etc.) in the skia repo (to run the sk_app for example) ?

Br,
Sohan

Micha

unread,
Jul 31, 2022, 3:07:45 PMJul 31
to skia-discuss
Hi Sohan,
we're planning the same. We have a large c++ win32 codebase, part of it related to 2d drawing, and want to offer some functionality in the browser. We are thinking of moving our c++ drawing code to skia. In the browser, CanvasKit offers quite the same drawing primitives and drawing concepts like c++ skia,  but ... JavaScript is another programming language, so it's not really shared code.
Br, Michael.

Sohan Jyoti Ghosh

unread,
Aug 8, 2022, 1:06:54 PM (8 days ago) Aug 8
to skia-d...@googlegroups.com
Hi !

After digging around the source repo, it seems there is some experimental code at https://source.chromium.org/chromium/chromium/src/+/main:third_party/skia/experimental/wasm-hello-world/ to try the tooling for custom C++-Skia project to WASM.
Does anyone know if this is maintained ? And how the drawing surface could be mapped from Linux x-window to the browser window ?

Br,
Sohan

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/be419edf-d4c9-4122-b3c8-61b83a990d8an%40googlegroups.com.

Brian Salomon

unread,
Aug 8, 2022, 2:15:21 PM (8 days ago) Aug 8
to skia-d...@googlegroups.com
Hi, I had considered porting our "viewer" app that is based on sk_app to WASM. My approach was to first port sk_app to SDL2 and then use the emscripten bindings for SDL2. I started this but didn't have time to take it very far. Here is an old patch that accomplished most of the first step of getting sk_app running on SDL2:


If you want to pursue this we would consider taking upstreaming patches.



--

Brian Salomon | Office Hours: go/bsalomon-office | bsal...@google.com

Sohan Jyoti Ghosh

unread,
Aug 9, 2022, 3:58:03 AM (8 days ago) Aug 9
to skia-d...@googlegroups.com
Hi !

Thanks for the pointers, we will surely have a look. And keep the upstreaming in mind.

Br,
Sohan

Reply all
Reply to author
Forward
0 new messages