skia2/modules/pathkit
Kevin Lubick 67c905ce6b Fixing a bug in SkOpEdgeBuilder::walk that causes pathOps to fail when cubic segment is reducable
Inside SkOpEdgeBuilder::walk(), when current segment is cubic curve, its shape may be reduced, therefore, the curve points should be determined by the reduction result ‘split->fVerb’ instead of ‘verb’.

Actually, inside this switch case, ‘verb’ is always ‘SkPath::kCubic_Verb’, which makes the ‘fCanAdd’ always true. The outcome of this bug makes the subsequent logic which depends on ‘fCanAdd’ (L301-332) incorrect, and in some cases, fails the whole boolean operation at L329.

The Fiddle below demonstrates how this bug fails a union operation of two paths, by returning an empty path.
https://fiddle.skia.org/c/e528567b62bc338cd99f4a89f0c5342e

Screen shot of the fiddle:
https://www.dropbox.com/s/4bnzlponq6gen27/pathOpsBug.png?dl=0

2nd Fiddle drawing the results (larger)
https://fiddle.skia.org/c/1f2a513c2ee0395b9d05fb1eb987b01f

Change-Id: If07f54cef1b9409f9b6db27d6294a3e3461b0181
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284426
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-04-21 16:56:54 +00:00
..
npm-asmjs [pathkit][canvaskit] roll versions 2019-02-25 21:53:53 +00:00
npm-wasm [pathkit][canvaskit] roll versions 2019-02-25 21:53:53 +00:00
perf [canvaskit] Roll chrome version for testing 2019-10-18 17:37:52 +00:00
tests Fixing a bug in SkOpEdgeBuilder::walk that causes pathOps to fail when cubic segment is reducable 2020-04-21 16:56:54 +00:00
.gitignore
chaining.js
CHANGELOG.md [canvaskit] Update build script to support latest Emscripten 2020-01-28 15:41:58 +00:00
compile.sh Fix wasm builds 2020-01-28 19:03:49 +00:00
externs.js
helper.js
karma.bench.conf.js [canvaskit] Try some things to reduce GPU test flakiness 2019-11-21 20:56:42 +00:00
karma.conf.js [canvaskit] Try some things to reduce GPU test flakiness 2019-11-21 20:56:42 +00:00
Makefile [canvaskit] Update to build with emscripten 1.38.47 2019-10-09 15:08:10 +00:00
package.json
pathkit_wasm_bindings.cpp remove dead code around old SkPath enums 2019-12-14 01:58:10 +00:00
README.md
ready.js [pathkit][canvaskit] roll versions 2019-02-25 21:53:53 +00:00
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 ./compile.sh to compile a production, WASM build to $SKIA_HOME/out/pathkit. Add "--help" for more options.

Deploying to npm

# Build all 3 versions (release, test, debug) for both asmjs and WASM
# These binaries will be placed in the proper places of npm-*/bin
# This takes 5-10 minutes.
make npm

# Update the package.json files of both npm-asmjs and npm-wasm
make update-patch  # or update-minor or update-major

# Publish both repos
make publish