skia2/experimental/pathkit/Makefile

105 lines
3.6 KiB
Makefile
Raw Normal View History

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
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
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
#./compile.sh asm.js TODO
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."
# 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 \
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 \
karma start /SRC/experimental/pathkit/karma-docker.conf.js --no-single-run
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
example:
npm install experimental-pathkit-wasm
echo "Go check out localhost:8000/npm-wasm/example.html"
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
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
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
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
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
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"
python serve.py