1fa54044ef
Cached references to the WASM heap buffer are invalid following memory growth: https://github.com/emscripten-core/emscripten/issues/6747#issuecomment-400081465. This change replaces references to the cached CanvasKit.buffer with direct references to CanvasKit.HEAPU8.buffer. The symptom of this bug is a Javascript error thrown in the Chrome console: "Uncaught TypeError: Cannot perform Construct on a neutered ArrayBuffer", causing the operation in question to fail. Bug: NONE Change-Id: I27462e80db1d33e0e77ee7295b25039c9036d2e2 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264477 Reviewed-by: Kevin Lubick <kjlubick@google.com> |
||
---|---|---|
.. | ||
canvaskit | ||
fonts | ||
htmlcanvas | ||
perf | ||
tests | ||
.gitignore | ||
canvaskit_bindings.cpp | ||
CHANGELOG.md | ||
compile.sh | ||
cpu.js | ||
debug.js | ||
externs.js | ||
font.js | ||
gpu.js | ||
helper.js | ||
interface.js | ||
karma.bench.conf.js | ||
karma.conf.js | ||
Makefile | ||
package.json | ||
paragraph_bindings.cpp | ||
paragraph.js | ||
particles_bindings.cpp | ||
particles.js | ||
pathops.js | ||
postamble.js | ||
preamble.js | ||
README.md | ||
ready.js | ||
release.js | ||
rt_shader.js | ||
serve.py | ||
skottie_bindings.cpp | ||
skottie.js | ||
skp.js | ||
WasmAliases.h |
Prerequisites
To compile CanvasKit, you will first need to install emscripten
. This
will set the environment EMSDK
(among others) which is required for
compilation.
Compile and Test Locally
make release
make local-example
This will print a local endpoint for viewing the example. You can experiment
with the CanvasKit API by modifying ./canvaskit/example.html
and refreshing
the page. For some more experimental APIs, there's also ./canvaskit/extra.html
.
For other available build targets, see Makefile
and compile.sh
.
For example, building a stripped-down version of CanvasKit with no text support or
any of the "extras", one might run:
./compile.sh no_skottie no_particles no_font
Such a stripped-down version is about half the size of the default release build.