skia2/experimental/pathkit
Kevin Lubick 644d8e7175 [PathKit] Add PathOps Op and Simplify tests imported from the C++ tests.
Because of https://skia-review.googlesource.com/c/skia/+/146165 and
https://skia-review.googlesource.com/c/skia/+/146100 we have a way
to turn PathOps tests into JSON, which has input paths (as Cmd arrays),
combination verb and expected output.

In this CL, we make tests from the JSON, compare them to the expected
output and, optionally, create SVGs to visualize the difference if any.

API changes (nothing breaking on release builds):
 - Exposes SkRect as a JS Object.  No need to call delete() on this.
 - expose path.getBounds() and path.computeTightBounds()
 - Remove SkRegion exposure (debug/test only), which was going to be
used for this purpose, but the approach in this CL works fine.
 - Add loadCmdsTypedArray(cmd) helper function to JS [see helper.js].
This was previously known as `floatTypedArrayFrom2D` in the
old shell.html, and is now exposed to avoid clients having to
implement this boilerplate by themselves.
 - Add set/getFillType - mostly for testing the difference between
a Winding and an EvenOdd path.

Bug: skia:8216
Change-Id: I2cd25ce2e1e7f285c79c596678678e62135963f0
Reviewed-on: https://skia-review.googlesource.com/146524
Reviewed-by: Cary Clark <caryclark@google.com>
2018-08-09 18:13:48 +00:00
..
docker [Pathkit] Add recipe for running JS tests using Docker 2018-08-09 14:17:28 +00:00
npm-wasm [PathKit] Add PathOps Op and Simplify tests imported from the C++ tests. 2018-08-09 18:13:48 +00:00
tests [PathKit] Add PathOps Op and Simplify tests imported from the C++ tests. 2018-08-09 18:13:48 +00:00
.gitignore
compile.sh [PathKit] Add PathOps Op and Simplify tests imported from the C++ tests. 2018-08-09 18:13:48 +00:00
helper_externs.js [PathKit] Add PathOps Op and Simplify tests imported from the C++ tests. 2018-08-09 18:13:48 +00:00
helper.js [PathKit] Add PathOps Op and Simplify tests imported from the C++ tests. 2018-08-09 18:13:48 +00:00
karma-docker.conf.js [Pathkit] Add recipe for running JS tests using Docker 2018-08-09 14:17:28 +00:00
karma.conf.js [Pathkit] Add recipe for running JS tests using Docker 2018-08-09 14:17:28 +00:00
Makefile [Pathkit] Add recipe for running JS tests using Docker 2018-08-09 14:17:28 +00:00
package.json [Pathkit] Add recipe for running JS tests using Docker 2018-08-09 14:17:28 +00:00
pathkit_wasm_bindings.cpp [PathKit] Add PathOps Op and Simplify tests imported from the C++ tests. 2018-08-09 18:13:48 +00:00
README.md
serve.py

PathKit WASM API

This library lets you use Skia's feature-rich PathOps API in the browser.

Compiling the source

Download the Enscriptem SDK.

Set the EMSDK environment variable to the directory you installed it to.

Run ./experimental/pathkit/compile.sh to compile a production, WASM build to $SKIA_HOME/out/pathkit. Add "--help" for more options.