skia2/site/user/modules/canvaskit.md
Kevin Lubick 8e9750d3c5 Add CanvasKit build
Building CanvasKit uses very similar logic to PathKit, so there
was a fair amount of copy/paste/customize.

Fixes the name of skia.js/wasm -> canvaskit.js/wasm and
adds a package.json to formally track versions.

Also move PathKit helper scripts to align better.

Docs-Preview: https://skia.org/?cl=160463
Bug: skia:
Change-Id: Ie75b30592dcc4d520dca41f6f5579006aaa8849b
Reviewed-on: https://skia-review.googlesource.com/c/160463
Reviewed-by: Eric Boren <borenet@google.com>
2018-10-09 13:56:56 +00:00

11 KiB

CanvasKit - Skia + WebAssembly

Skia now offers a WebAssembly build for easy deployment of our graphics APIs on the web.

CanvasKit provides a playground for testing new Canvas and SVG platform APIs, enabling fast-paced development on the web platform. It can also be used as a deployment mechanism for custom web apps requiring cutting-edge features, like Skia's Lottie animation support.

Features

  • WebGL context encapsulated as an SkSurface, allowing for direct drawing to an HTML canvas
  • Core set of Skia canvas/paint/path/text APIs available, see bindings
  • Draws to a hardware-accelerated backend
  • Security tested with Skia's fuzzers

Samples

An Interactive Path

Star JSFiddle
Ink JSFiddle

Skottie (click for fiddles)

Lottie files courtesy of the lottiefiles.com community: Lego Loader, I'm thirsty, Confetti, Onboarding

Test server

Test your code on our CanvasKit Fiddle

Download

Work is underway on an npm download. Check back soon.