skia2/site/user/modules/canvaskit.md
Nathaniel Nifong b1525c721e Update canvaskit fiddle shader example
Change-Id: I6955bdd6e2e7040dfe151d43ea925d8d7e8f9498
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270067
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-02-11 17:13:57 +00:00

16 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

Go beyond the HTML Canvas2D

Star JSFiddle
Ink JSFiddle

Skottie (click for fiddles)

SkParagraph (using ICU and Harfbuzz)

SkParagraph JSFiddle

SKSL for writing custom shaders

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

Get CanvasKit on NPM