2018-08-02 15:30:33 +00:00
|
|
|
build:
|
|
|
|
./compile.sh
|
|
|
|
|
|
|
|
npm:
|
|
|
|
mkdir -p ./npm-wasm/bin
|
|
|
|
mkdir -p ./npm-asmjs/bin
|
|
|
|
./compile.sh
|
|
|
|
cp ../../out/pathkit/pathkit.js ./npm-wasm/bin
|
|
|
|
cp ../../out/pathkit/pathkit.wasm ./npm-wasm/bin
|
[PathKit] Add more Path2D functionality and move some methods to be members
Adds arc, arcTo, rect and Path2D names for quadTo, cubicTo, close.
Adds conic verb support (approximated with 2 quads).
Breaking changes:
Some functions have been moved to be member functions:
PathKit.Simplify(path) -> path.simplify()
PathKit.ToCanvas(path, ctx) -> path.toCanvas(ctx)
PathKit.ToSVGString(path) -> path.toSVGString()
PathKit.ToPath2D(path) -> path.toPath2D()
PathKit.ToCmds(path) -> path.toCmds()
PathKit.ResolveBuilder(builder) -> builder.resolve()
PathKit.GetBoundaryPathFromRegion(region) -> region.getBoundaryPath()
Pathkit.ApplyPathOp(pathOne, pathTwo, op) still exists, but there's
now also pathOne.op(pathTwo, op) for cases when that's easier.
As per custom with version 0.x.y projects, I'm bumping the
minor version (in npm) for these breaking changes instead of the
major version (which will happen when we are version >= 1.0.0).
This also has some small improvements to the output code size.
The biggest jump was from enabling the closure compiler on the
helper JS, which trimmed it down by about 40%. Using the closure
compiler requires the JRE on the bots, which prompted the emsdk-base
image change.
Bug: skia:8216
Change-Id: I40902d23380093c34d1679df0255bcb0eaa77b01
Reviewed-on: https://skia-review.googlesource.com/145420
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-08-06 18:49:39 +00:00
|
|
|
|
|
|
|
mkdir -p ./npm-wasm/bin/test
|
|
|
|
mkdir -p ./npm-asmjs/bin/test
|
|
|
|
./compile.sh test
|
|
|
|
cp ../../out/pathkit/pathkit.js ./npm-wasm/bin/test/pathkit.js
|
|
|
|
cp ../../out/pathkit/pathkit.wasm ./npm-wasm/bin/test/pathkit.wasm
|
2018-08-02 15:30:33 +00:00
|
|
|
|
2018-08-03 16:24:06 +00:00
|
|
|
mkdir -p ./npm-wasm/bin/debug
|
|
|
|
mkdir -p ./npm-asmjs/bin/debug
|
[PathKit] Add more Path2D functionality and move some methods to be members
Adds arc, arcTo, rect and Path2D names for quadTo, cubicTo, close.
Adds conic verb support (approximated with 2 quads).
Breaking changes:
Some functions have been moved to be member functions:
PathKit.Simplify(path) -> path.simplify()
PathKit.ToCanvas(path, ctx) -> path.toCanvas(ctx)
PathKit.ToSVGString(path) -> path.toSVGString()
PathKit.ToPath2D(path) -> path.toPath2D()
PathKit.ToCmds(path) -> path.toCmds()
PathKit.ResolveBuilder(builder) -> builder.resolve()
PathKit.GetBoundaryPathFromRegion(region) -> region.getBoundaryPath()
Pathkit.ApplyPathOp(pathOne, pathTwo, op) still exists, but there's
now also pathOne.op(pathTwo, op) for cases when that's easier.
As per custom with version 0.x.y projects, I'm bumping the
minor version (in npm) for these breaking changes instead of the
major version (which will happen when we are version >= 1.0.0).
This also has some small improvements to the output code size.
The biggest jump was from enabling the closure compiler on the
helper JS, which trimmed it down by about 40%. Using the closure
compiler requires the JRE on the bots, which prompted the emsdk-base
image change.
Bug: skia:8216
Change-Id: I40902d23380093c34d1679df0255bcb0eaa77b01
Reviewed-on: https://skia-review.googlesource.com/145420
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-08-06 18:49:39 +00:00
|
|
|
./compile.sh debug
|
2018-08-03 16:24:06 +00:00
|
|
|
cp ../../out/pathkit/pathkit.js ./npm-wasm/bin/debug/pathkit.js
|
|
|
|
cp ../../out/pathkit/pathkit.wasm ./npm-wasm/bin/debug/pathkit.wasm
|
|
|
|
#./compile.sh asm.js TODO
|
|
|
|
|
2018-08-02 15:30:33 +00:00
|
|
|
publish:
|
|
|
|
cd npm-wasm; npm publish
|
|
|
|
|
|
|
|
update-major:
|
|
|
|
cd npm-wasm; npm version major
|
|
|
|
echo "Don't forget to publish."
|
|
|
|
|
|
|
|
update-minor:
|
|
|
|
cd npm-wasm; npm version minor
|
|
|
|
echo "Don't forget to publish."
|
|
|
|
|
|
|
|
update-patch:
|
|
|
|
cd npm-wasm; npm version patch
|
|
|
|
echo "Don't forget to publish."
|
|
|
|
|
2018-08-09 14:00:02 +00:00
|
|
|
# Build the library and run the tests. If developing locally, test-continuous is better
|
|
|
|
# suited for that, although if you make changes to the C++/WASM code, you will need
|
|
|
|
# to manually call make npm-test to re-build.
|
|
|
|
test: npm-test
|
|
|
|
npm install
|
|
|
|
npx karma start ./karma.conf.js --single-run
|
|
|
|
|
|
|
|
test-continuous:
|
|
|
|
echo "Assuming npm install has been run by user"
|
|
|
|
echo "Also assuming make npm-test has also been run by a user (if needed)"
|
|
|
|
npx karma start ./karma.conf.js --no-single-run --watch-poll
|
|
|
|
|
|
|
|
# Build the library and run the tests using the docker image. If developing locally,
|
|
|
|
# test-docker-continuous is better, although if you make changes to the C++/WASM code,
|
|
|
|
# you will need to manually call make npm-test to re-build.
|
|
|
|
test-docker: npm-test
|
[PathKit] Adding test infrastructure to support Gold output
To get the gold images out of the browser tests, this adds
testReporter.js and pathkit_aggregator.go. testReporter bundles
up the output as a base64 encoded PNG and sends it over the local
network to pathkit_aggregator. pathkit_aggregator will keep
a list of test results reported in this way and write the PNGs
to /OUT of the container (which is the swarming output directory).
Finally, after all the tests are run, the helper script "test_pathkit.sh"
makes a POST request that creates the JSON file that gold expects
(following the schema https://github.com/google/skia-buildbot/blob/master/golden/docs/INGESTION.md)
pathkit_aggregator takes many command line arguments which control
the keys that Gold needs in order to ingest and handle the data.
Of note, this creates a new set (i.e. source_type) of gold images
called "pathkit", which will distinguish it from "gm", "image", etc.
There will be at least 2 sub-sets of "pathkit" images, "canvas" and "svg",
(representing the 2 output types of PathKit). This CL doesn't
quite handle SVG yet, as it needs a way to convert SVG to PNG in the
browser and will be addressed in a follow up CL.
A "standard" gm is sized at 600x600. This was arbitrarily picked.
Note that the functions in testReporter.js return Promises based
on the fetch requests to post the data. This eliminates the race
condition between the /report_gold_data and /dump_json since
running the karma tests won't return until all reports are done.
Other changes of note:
- Adds go to karma-chrome-tests container.
- renames recipe_modules/build/wasm.py -> pathkit.py to be consistent with
the name of test_pathkit.py and make for easier grepping.
- Increases the JS test timeout to 10s (up from 5) to hopefully avoid
the flakes seen in the Debug Test.
Bug: skia:8216
Change-Id: Ic2cad54f3d19cc16601cf2e9a87798db1e6887a2
Reviewed-on: https://skia-review.googlesource.com/147042
Reviewed-by: Stephan Altmueller <stephana@google.com>
2018-08-15 17:45:28 +00:00
|
|
|
docker run --shm-size=2gb -v $$SKIA_ROOT:/SRC gcr.io/skia-public/karma-chrome-tests:68.0.3440.106_v3 \
|
2018-08-09 14:00:02 +00:00
|
|
|
karma start /SRC/experimental/pathkit/karma-docker.conf.js --single-run
|
|
|
|
|
|
|
|
test-docker-continuous:
|
|
|
|
echo "Assuming make npm-test has also been run by a user (if needed)"
|
[PathKit] Adding test infrastructure to support Gold output
To get the gold images out of the browser tests, this adds
testReporter.js and pathkit_aggregator.go. testReporter bundles
up the output as a base64 encoded PNG and sends it over the local
network to pathkit_aggregator. pathkit_aggregator will keep
a list of test results reported in this way and write the PNGs
to /OUT of the container (which is the swarming output directory).
Finally, after all the tests are run, the helper script "test_pathkit.sh"
makes a POST request that creates the JSON file that gold expects
(following the schema https://github.com/google/skia-buildbot/blob/master/golden/docs/INGESTION.md)
pathkit_aggregator takes many command line arguments which control
the keys that Gold needs in order to ingest and handle the data.
Of note, this creates a new set (i.e. source_type) of gold images
called "pathkit", which will distinguish it from "gm", "image", etc.
There will be at least 2 sub-sets of "pathkit" images, "canvas" and "svg",
(representing the 2 output types of PathKit). This CL doesn't
quite handle SVG yet, as it needs a way to convert SVG to PNG in the
browser and will be addressed in a follow up CL.
A "standard" gm is sized at 600x600. This was arbitrarily picked.
Note that the functions in testReporter.js return Promises based
on the fetch requests to post the data. This eliminates the race
condition between the /report_gold_data and /dump_json since
running the karma tests won't return until all reports are done.
Other changes of note:
- Adds go to karma-chrome-tests container.
- renames recipe_modules/build/wasm.py -> pathkit.py to be consistent with
the name of test_pathkit.py and make for easier grepping.
- Increases the JS test timeout to 10s (up from 5) to hopefully avoid
the flakes seen in the Debug Test.
Bug: skia:8216
Change-Id: Ic2cad54f3d19cc16601cf2e9a87798db1e6887a2
Reviewed-on: https://skia-review.googlesource.com/147042
Reviewed-by: Stephan Altmueller <stephana@google.com>
2018-08-15 17:45:28 +00:00
|
|
|
docker run --shm-size=2gb -v $$SKIA_ROOT:/SRC gcr.io/skia-public/karma-chrome-tests:68.0.3440.106_v3 \
|
2018-08-09 14:00:02 +00:00
|
|
|
karma start /SRC/experimental/pathkit/karma-docker.conf.js --no-single-run
|
[PathKit] Add more Path2D functionality and move some methods to be members
Adds arc, arcTo, rect and Path2D names for quadTo, cubicTo, close.
Adds conic verb support (approximated with 2 quads).
Breaking changes:
Some functions have been moved to be member functions:
PathKit.Simplify(path) -> path.simplify()
PathKit.ToCanvas(path, ctx) -> path.toCanvas(ctx)
PathKit.ToSVGString(path) -> path.toSVGString()
PathKit.ToPath2D(path) -> path.toPath2D()
PathKit.ToCmds(path) -> path.toCmds()
PathKit.ResolveBuilder(builder) -> builder.resolve()
PathKit.GetBoundaryPathFromRegion(region) -> region.getBoundaryPath()
Pathkit.ApplyPathOp(pathOne, pathTwo, op) still exists, but there's
now also pathOne.op(pathTwo, op) for cases when that's easier.
As per custom with version 0.x.y projects, I'm bumping the
minor version (in npm) for these breaking changes instead of the
major version (which will happen when we are version >= 1.0.0).
This also has some small improvements to the output code size.
The biggest jump was from enabling the closure compiler on the
helper JS, which trimmed it down by about 40%. Using the closure
compiler requires the JRE on the bots, which prompted the emsdk-base
image change.
Bug: skia:8216
Change-Id: I40902d23380093c34d1679df0255bcb0eaa77b01
Reviewed-on: https://skia-review.googlesource.com/145420
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-08-06 18:49:39 +00:00
|
|
|
|
|
|
|
npm-test:
|
|
|
|
# This compile time is typically faster than release and good for use with
|
|
|
|
# local-example-test
|
|
|
|
mkdir -p ./npm-wasm/bin/test
|
|
|
|
mkdir -p ./npm-asmjs/bin/test
|
|
|
|
./compile.sh test
|
|
|
|
cp ../../out/pathkit/pathkit.js ./npm-wasm/bin/test/pathkit.js
|
|
|
|
cp ../../out/pathkit/pathkit.wasm ./npm-wasm/bin/test/pathkit.wasm
|
|
|
|
|
|
|
|
npm-debug:
|
|
|
|
# This compile time is typically faster than release and good for use with
|
|
|
|
# local-example-test
|
|
|
|
mkdir -p ./npm-wasm/bin/debug
|
|
|
|
mkdir -p ./npm-asmjs/bin/debug
|
|
|
|
./compile.sh debug
|
|
|
|
cp ../../out/pathkit/pathkit.js ./npm-wasm/bin/debug/pathkit.js
|
|
|
|
cp ../../out/pathkit/pathkit.wasm ./npm-wasm/bin/debug/pathkit.wasm
|
2018-08-02 15:30:33 +00:00
|
|
|
|
|
|
|
example:
|
|
|
|
npm install experimental-pathkit-wasm
|
|
|
|
echo "Go check out localhost:8000/npm-wasm/example.html"
|
2018-08-03 16:24:06 +00:00
|
|
|
python serve.py
|
|
|
|
|
|
|
|
local-example:
|
[PathKit] Rework API to avoid extra copies unless explicitly called for.
Breaking Changes:
- All method calls that mutate a path now return the same JS path
object to allow chaining (moveTo, lineTo, trim, op, simplify, etc).
Pre-existing code likely will need to have some delete() methods
removed because the path will be deleted multiple times. See
chaining.js for this code (basically, we wrote our own binding code
since the default code wasn't quite flexible enough)
- GetCanvasFillType -> GetFillTypeString (Was in https://skia-review.googlesource.com/c/skia/+/147209)
Since Canvas and SVG use the same strings, it seemed logical to make
them share.
- stroke() now takes a single object instead of 3 params. This object
currently can have up to 4 params, cap, join, width, miter_limit.
This object can be expanded on in future versions as more configuration
options are added.
As per custom with v0 software, we bump the minor version to 0.2.X
to indicate breaking changes in a pre-release software package.
Other changes of note:
- Simple tests added for effects (see effects.specs.js) A follow up
CL will handle the Gold (correctness tests)
- Simple tests added for equals and copy constructors (from https://skia-review.googlesource.com/c/skia/+/147209)
- Added transform() to allow for arbitrary matrix transforms
- Added SimpleMatrix as a value_array, which means users can
provide a 9 element array which will be converted to SimpleMatrix
and then SkMatrix on the C++ side.
- Renamed helpers_externs.js to externs.js and expanded it greatly.
This was necessitated by the code written in chaining.js
- Fixed a few bugs in previous tests (svg gold test race condition,
uncaught exception in svg reporting)
See also https://skia-review.googlesource.com/c/skia/+/147209 which
allows .moveTo .lineTo, etc to chain on the C++ SkPath.
Bug: skia:8216
Change-Id: I7450cd8b7b5377cf15c962b02d161677b62d7e15
Reviewed-on: https://skia-review.googlesource.com/147115
Reviewed-by: Mike Reed <reed@google.com>
2018-08-17 17:52:56 +00:00
|
|
|
rm -rf node_modules/experimental-pathkit-wasm
|
2018-08-03 16:24:06 +00:00
|
|
|
mkdir -p node_modules
|
|
|
|
ln -s -T ../npm-wasm node_modules/experimental-pathkit-wasm
|
|
|
|
echo "Go check out localhost:8000/npm-wasm/example.html"
|
|
|
|
python serve.py
|
|
|
|
|
[PathKit] Add more Path2D functionality and move some methods to be members
Adds arc, arcTo, rect and Path2D names for quadTo, cubicTo, close.
Adds conic verb support (approximated with 2 quads).
Breaking changes:
Some functions have been moved to be member functions:
PathKit.Simplify(path) -> path.simplify()
PathKit.ToCanvas(path, ctx) -> path.toCanvas(ctx)
PathKit.ToSVGString(path) -> path.toSVGString()
PathKit.ToPath2D(path) -> path.toPath2D()
PathKit.ToCmds(path) -> path.toCmds()
PathKit.ResolveBuilder(builder) -> builder.resolve()
PathKit.GetBoundaryPathFromRegion(region) -> region.getBoundaryPath()
Pathkit.ApplyPathOp(pathOne, pathTwo, op) still exists, but there's
now also pathOne.op(pathTwo, op) for cases when that's easier.
As per custom with version 0.x.y projects, I'm bumping the
minor version (in npm) for these breaking changes instead of the
major version (which will happen when we are version >= 1.0.0).
This also has some small improvements to the output code size.
The biggest jump was from enabling the closure compiler on the
helper JS, which trimmed it down by about 40%. Using the closure
compiler requires the JRE on the bots, which prompted the emsdk-base
image change.
Bug: skia:8216
Change-Id: I40902d23380093c34d1679df0255bcb0eaa77b01
Reviewed-on: https://skia-review.googlesource.com/145420
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-08-06 18:49:39 +00:00
|
|
|
local-example-test:
|
[PathKit] Rework API to avoid extra copies unless explicitly called for.
Breaking Changes:
- All method calls that mutate a path now return the same JS path
object to allow chaining (moveTo, lineTo, trim, op, simplify, etc).
Pre-existing code likely will need to have some delete() methods
removed because the path will be deleted multiple times. See
chaining.js for this code (basically, we wrote our own binding code
since the default code wasn't quite flexible enough)
- GetCanvasFillType -> GetFillTypeString (Was in https://skia-review.googlesource.com/c/skia/+/147209)
Since Canvas and SVG use the same strings, it seemed logical to make
them share.
- stroke() now takes a single object instead of 3 params. This object
currently can have up to 4 params, cap, join, width, miter_limit.
This object can be expanded on in future versions as more configuration
options are added.
As per custom with v0 software, we bump the minor version to 0.2.X
to indicate breaking changes in a pre-release software package.
Other changes of note:
- Simple tests added for effects (see effects.specs.js) A follow up
CL will handle the Gold (correctness tests)
- Simple tests added for equals and copy constructors (from https://skia-review.googlesource.com/c/skia/+/147209)
- Added transform() to allow for arbitrary matrix transforms
- Added SimpleMatrix as a value_array, which means users can
provide a 9 element array which will be converted to SimpleMatrix
and then SkMatrix on the C++ side.
- Renamed helpers_externs.js to externs.js and expanded it greatly.
This was necessitated by the code written in chaining.js
- Fixed a few bugs in previous tests (svg gold test race condition,
uncaught exception in svg reporting)
See also https://skia-review.googlesource.com/c/skia/+/147209 which
allows .moveTo .lineTo, etc to chain on the C++ SkPath.
Bug: skia:8216
Change-Id: I7450cd8b7b5377cf15c962b02d161677b62d7e15
Reviewed-on: https://skia-review.googlesource.com/147115
Reviewed-by: Mike Reed <reed@google.com>
2018-08-17 17:52:56 +00:00
|
|
|
rm -rf node_modules/experimental-pathkit-wasm
|
[PathKit] Add more Path2D functionality and move some methods to be members
Adds arc, arcTo, rect and Path2D names for quadTo, cubicTo, close.
Adds conic verb support (approximated with 2 quads).
Breaking changes:
Some functions have been moved to be member functions:
PathKit.Simplify(path) -> path.simplify()
PathKit.ToCanvas(path, ctx) -> path.toCanvas(ctx)
PathKit.ToSVGString(path) -> path.toSVGString()
PathKit.ToPath2D(path) -> path.toPath2D()
PathKit.ToCmds(path) -> path.toCmds()
PathKit.ResolveBuilder(builder) -> builder.resolve()
PathKit.GetBoundaryPathFromRegion(region) -> region.getBoundaryPath()
Pathkit.ApplyPathOp(pathOne, pathTwo, op) still exists, but there's
now also pathOne.op(pathTwo, op) for cases when that's easier.
As per custom with version 0.x.y projects, I'm bumping the
minor version (in npm) for these breaking changes instead of the
major version (which will happen when we are version >= 1.0.0).
This also has some small improvements to the output code size.
The biggest jump was from enabling the closure compiler on the
helper JS, which trimmed it down by about 40%. Using the closure
compiler requires the JRE on the bots, which prompted the emsdk-base
image change.
Bug: skia:8216
Change-Id: I40902d23380093c34d1679df0255bcb0eaa77b01
Reviewed-on: https://skia-review.googlesource.com/145420
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-08-06 18:49:39 +00:00
|
|
|
mkdir -p node_modules/experimental-pathkit-wasm
|
|
|
|
ln -s -T ../../npm-wasm/bin/test node_modules/experimental-pathkit-wasm/bin
|
|
|
|
echo "Go check out localhost:8000/npm-wasm/example.html"
|
|
|
|
python serve.py
|
|
|
|
|
2018-08-03 16:24:06 +00:00
|
|
|
local-example-debug:
|
[PathKit] Rework API to avoid extra copies unless explicitly called for.
Breaking Changes:
- All method calls that mutate a path now return the same JS path
object to allow chaining (moveTo, lineTo, trim, op, simplify, etc).
Pre-existing code likely will need to have some delete() methods
removed because the path will be deleted multiple times. See
chaining.js for this code (basically, we wrote our own binding code
since the default code wasn't quite flexible enough)
- GetCanvasFillType -> GetFillTypeString (Was in https://skia-review.googlesource.com/c/skia/+/147209)
Since Canvas and SVG use the same strings, it seemed logical to make
them share.
- stroke() now takes a single object instead of 3 params. This object
currently can have up to 4 params, cap, join, width, miter_limit.
This object can be expanded on in future versions as more configuration
options are added.
As per custom with v0 software, we bump the minor version to 0.2.X
to indicate breaking changes in a pre-release software package.
Other changes of note:
- Simple tests added for effects (see effects.specs.js) A follow up
CL will handle the Gold (correctness tests)
- Simple tests added for equals and copy constructors (from https://skia-review.googlesource.com/c/skia/+/147209)
- Added transform() to allow for arbitrary matrix transforms
- Added SimpleMatrix as a value_array, which means users can
provide a 9 element array which will be converted to SimpleMatrix
and then SkMatrix on the C++ side.
- Renamed helpers_externs.js to externs.js and expanded it greatly.
This was necessitated by the code written in chaining.js
- Fixed a few bugs in previous tests (svg gold test race condition,
uncaught exception in svg reporting)
See also https://skia-review.googlesource.com/c/skia/+/147209 which
allows .moveTo .lineTo, etc to chain on the C++ SkPath.
Bug: skia:8216
Change-Id: I7450cd8b7b5377cf15c962b02d161677b62d7e15
Reviewed-on: https://skia-review.googlesource.com/147115
Reviewed-by: Mike Reed <reed@google.com>
2018-08-17 17:52:56 +00:00
|
|
|
rm -rf node_modules/experimental-pathkit-wasm
|
2018-08-03 16:24:06 +00:00
|
|
|
mkdir -p node_modules/experimental-pathkit-wasm
|
|
|
|
ln -s -T ../../npm-wasm/bin/debug node_modules/experimental-pathkit-wasm/bin
|
|
|
|
echo "Go check out localhost:8000/npm-wasm/example.html"
|
2018-08-02 15:30:33 +00:00
|
|
|
python serve.py
|