[canvaskit] Add full build to npm release.

Also rename //modules/canvaskit/canvaskit to //modules/canvaskit/npm_build
to make it more clear the purpose of that folder (what we ship to
npm and stage our builds for local testing).

Bug: skia:11203
Change-Id: I4299ded97d14f4155c36798d60e88a660ce6fe6a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372392
Reviewed-by: Kevin Lubick <kjlubick@google.com>
This commit is contained in:
Kevin Lubick 2021-02-23 09:40:07 -05:00
parent 5364864cce
commit 3b760b6fa8
30 changed files with 148 additions and 120 deletions

View File

@ -107,10 +107,10 @@
"ensure-directory", "ensure-directory",
"--mode", "--mode",
"0777", "0777",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin" "[START_DIR]/skia/modules/canvaskit/npm_build/bin"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.mkdirs [START_DIR]/skia/modules/canvaskit/canvaskit/bin", "name": "Docker setup.mkdirs [START_DIR]/skia/modules/canvaskit/npm_build/bin",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]
@ -124,10 +124,10 @@
"/path/to/tmp/json", "/path/to/tmp/json",
"copy", "copy",
"[START_DIR]/build/canvaskit.wasm", "[START_DIR]/build/canvaskit.wasm",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.wasm" "[START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.wasm"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.cp [START_DIR]/build/canvaskit.wasm [START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.wasm", "name": "Docker setup.cp [START_DIR]/build/canvaskit.wasm [START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.wasm",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]
@ -136,10 +136,10 @@
"cmd": [ "cmd": [
"chmod", "chmod",
"644", "644",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.wasm" "[START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.wasm"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.chmod 644 [START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.wasm", "name": "Docker setup.chmod 644 [START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.wasm",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]
@ -154,10 +154,10 @@
"ensure-directory", "ensure-directory",
"--mode", "--mode",
"0777", "0777",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin" "[START_DIR]/skia/modules/canvaskit/npm_build/bin"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.mkdirs [START_DIR]/skia/modules/canvaskit/canvaskit/bin (2)", "name": "Docker setup.mkdirs [START_DIR]/skia/modules/canvaskit/npm_build/bin (2)",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]
@ -171,10 +171,10 @@
"/path/to/tmp/json", "/path/to/tmp/json",
"copy", "copy",
"[START_DIR]/build/canvaskit.js", "[START_DIR]/build/canvaskit.js",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.js" "[START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.js"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.cp [START_DIR]/build/canvaskit.js [START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.js", "name": "Docker setup.cp [START_DIR]/build/canvaskit.js [START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.js",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]
@ -183,10 +183,10 @@
"cmd": [ "cmd": [
"chmod", "chmod",
"644", "644",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.js" "[START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.js"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.chmod 644 [START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.js", "name": "Docker setup.chmod 644 [START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.js",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]

View File

@ -107,10 +107,10 @@
"ensure-directory", "ensure-directory",
"--mode", "--mode",
"0777", "0777",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin" "[START_DIR]/skia/modules/canvaskit/npm_build/bin"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.mkdirs [START_DIR]/skia/modules/canvaskit/canvaskit/bin", "name": "Docker setup.mkdirs [START_DIR]/skia/modules/canvaskit/npm_build/bin",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]
@ -124,10 +124,10 @@
"/path/to/tmp/json", "/path/to/tmp/json",
"copy", "copy",
"[START_DIR]/build/canvaskit.wasm", "[START_DIR]/build/canvaskit.wasm",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.wasm" "[START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.wasm"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.cp [START_DIR]/build/canvaskit.wasm [START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.wasm", "name": "Docker setup.cp [START_DIR]/build/canvaskit.wasm [START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.wasm",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]
@ -136,10 +136,10 @@
"cmd": [ "cmd": [
"chmod", "chmod",
"644", "644",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.wasm" "[START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.wasm"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.chmod 644 [START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.wasm", "name": "Docker setup.chmod 644 [START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.wasm",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]
@ -154,10 +154,10 @@
"ensure-directory", "ensure-directory",
"--mode", "--mode",
"0777", "0777",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin" "[START_DIR]/skia/modules/canvaskit/npm_build/bin"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.mkdirs [START_DIR]/skia/modules/canvaskit/canvaskit/bin (2)", "name": "Docker setup.mkdirs [START_DIR]/skia/modules/canvaskit/npm_build/bin (2)",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]
@ -171,10 +171,10 @@
"/path/to/tmp/json", "/path/to/tmp/json",
"copy", "copy",
"[START_DIR]/build/canvaskit.js", "[START_DIR]/build/canvaskit.js",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.js" "[START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.js"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.cp [START_DIR]/build/canvaskit.js [START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.js", "name": "Docker setup.cp [START_DIR]/build/canvaskit.js [START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.js",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]
@ -183,10 +183,10 @@
"cmd": [ "cmd": [
"chmod", "chmod",
"644", "644",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.js" "[START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.js"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.chmod 644 [START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.js", "name": "Docker setup.chmod 644 [START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.js",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]

View File

@ -28,10 +28,10 @@ def RunSteps(api):
checkout_root = api.path['start_dir'] checkout_root = api.path['start_dir']
out_dir = api.vars.swarming_out_dir out_dir = api.vars.swarming_out_dir
# The karma script is configured to look in ./canvaskit/bin/ for # The karma script is configured to look in ./npm_build/bin/ for
# the test files to load, so we must copy them there (see Set up for docker). # the test files to load, so we must copy them there (see Set up for docker).
copy_dest = checkout_root.join('skia', 'modules', 'canvaskit', copy_dest = checkout_root.join('skia', 'modules', 'canvaskit',
'canvaskit', 'bin') 'npm_build', 'bin')
base_dir = api.vars.build_dir base_dir = api.vars.build_dir
copies = { copies = {
base_dir.join('canvaskit.js'): copy_dest.join('canvaskit.js'), base_dir.join('canvaskit.js'): copy_dest.join('canvaskit.js'),

View File

@ -9,7 +9,7 @@
"ensure-directory", "ensure-directory",
"--mode", "--mode",
"0777", "0777",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin" "[START_DIR]/skia/modules/canvaskit/npm_build/bin"
], ],
"infra_step": true, "infra_step": true,
"name": "mkdirs copy_dest" "name": "mkdirs copy_dest"
@ -122,10 +122,10 @@
"ensure-directory", "ensure-directory",
"--mode", "--mode",
"0777", "0777",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin" "[START_DIR]/skia/modules/canvaskit/npm_build/bin"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.mkdirs [START_DIR]/skia/modules/canvaskit/canvaskit/bin", "name": "Docker setup.mkdirs [START_DIR]/skia/modules/canvaskit/npm_build/bin",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]
@ -139,10 +139,10 @@
"/path/to/tmp/json", "/path/to/tmp/json",
"copy", "copy",
"[START_DIR]/build/canvaskit.wasm", "[START_DIR]/build/canvaskit.wasm",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.wasm" "[START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.wasm"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.cp [START_DIR]/build/canvaskit.wasm [START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.wasm", "name": "Docker setup.cp [START_DIR]/build/canvaskit.wasm [START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.wasm",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]
@ -151,10 +151,10 @@
"cmd": [ "cmd": [
"chmod", "chmod",
"644", "644",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.wasm" "[START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.wasm"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.chmod 644 [START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.wasm", "name": "Docker setup.chmod 644 [START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.wasm",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]
@ -169,10 +169,10 @@
"ensure-directory", "ensure-directory",
"--mode", "--mode",
"0777", "0777",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin" "[START_DIR]/skia/modules/canvaskit/npm_build/bin"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.mkdirs [START_DIR]/skia/modules/canvaskit/canvaskit/bin (2)", "name": "Docker setup.mkdirs [START_DIR]/skia/modules/canvaskit/npm_build/bin (2)",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]
@ -186,10 +186,10 @@
"/path/to/tmp/json", "/path/to/tmp/json",
"copy", "copy",
"[START_DIR]/build/canvaskit.js", "[START_DIR]/build/canvaskit.js",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.js" "[START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.js"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.cp [START_DIR]/build/canvaskit.js [START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.js", "name": "Docker setup.cp [START_DIR]/build/canvaskit.js [START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.js",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]
@ -198,10 +198,10 @@
"cmd": [ "cmd": [
"chmod", "chmod",
"644", "644",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.js" "[START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.js"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.chmod 644 [START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.js", "name": "Docker setup.chmod 644 [START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.js",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]

View File

@ -9,7 +9,7 @@
"ensure-directory", "ensure-directory",
"--mode", "--mode",
"0777", "0777",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin" "[START_DIR]/skia/modules/canvaskit/npm_build/bin"
], ],
"infra_step": true, "infra_step": true,
"name": "mkdirs copy_dest" "name": "mkdirs copy_dest"
@ -122,10 +122,10 @@
"ensure-directory", "ensure-directory",
"--mode", "--mode",
"0777", "0777",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin" "[START_DIR]/skia/modules/canvaskit/npm_build/bin"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.mkdirs [START_DIR]/skia/modules/canvaskit/canvaskit/bin", "name": "Docker setup.mkdirs [START_DIR]/skia/modules/canvaskit/npm_build/bin",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]
@ -139,10 +139,10 @@
"/path/to/tmp/json", "/path/to/tmp/json",
"copy", "copy",
"[START_DIR]/build/canvaskit.wasm", "[START_DIR]/build/canvaskit.wasm",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.wasm" "[START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.wasm"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.cp [START_DIR]/build/canvaskit.wasm [START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.wasm", "name": "Docker setup.cp [START_DIR]/build/canvaskit.wasm [START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.wasm",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]
@ -151,10 +151,10 @@
"cmd": [ "cmd": [
"chmod", "chmod",
"644", "644",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.wasm" "[START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.wasm"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.chmod 644 [START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.wasm", "name": "Docker setup.chmod 644 [START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.wasm",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]
@ -169,10 +169,10 @@
"ensure-directory", "ensure-directory",
"--mode", "--mode",
"0777", "0777",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin" "[START_DIR]/skia/modules/canvaskit/npm_build/bin"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.mkdirs [START_DIR]/skia/modules/canvaskit/canvaskit/bin (2)", "name": "Docker setup.mkdirs [START_DIR]/skia/modules/canvaskit/npm_build/bin (2)",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]
@ -186,10 +186,10 @@
"/path/to/tmp/json", "/path/to/tmp/json",
"copy", "copy",
"[START_DIR]/build/canvaskit.js", "[START_DIR]/build/canvaskit.js",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.js" "[START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.js"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.cp [START_DIR]/build/canvaskit.js [START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.js", "name": "Docker setup.cp [START_DIR]/build/canvaskit.js [START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.js",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]
@ -198,10 +198,10 @@
"cmd": [ "cmd": [
"chmod", "chmod",
"644", "644",
"[START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.js" "[START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.js"
], ],
"infra_step": true, "infra_step": true,
"name": "Docker setup.chmod 644 [START_DIR]/skia/modules/canvaskit/canvaskit/bin/canvaskit.js", "name": "Docker setup.chmod 644 [START_DIR]/skia/modules/canvaskit/npm_build/bin/canvaskit.js",
"~followup_annotations": [ "~followup_annotations": [
"@@@STEP_NEST_LEVEL@1@@@" "@@@STEP_NEST_LEVEL@1@@@"
] ]

View File

@ -28,10 +28,10 @@ def RunSteps(api):
checkout_root = api.path['start_dir'] checkout_root = api.path['start_dir']
out_dir = api.vars.swarming_out_dir out_dir = api.vars.swarming_out_dir
# The karma script is configured to look in ./canvaskit/bin/ for # The karma script is configured to look in ./npm_build/bin/ for
# the test files to load, so we must copy them there (see Set up for docker). # the test files to load, so we must copy them there (see Set up for docker).
copy_dest = checkout_root.join('skia', 'modules', 'canvaskit', copy_dest = checkout_root.join('skia', 'modules', 'canvaskit',
'canvaskit', 'bin') 'npm_build', 'bin')
api.file.ensure_directory('mkdirs copy_dest', copy_dest, mode=0777) api.file.ensure_directory('mkdirs copy_dest', copy_dest, mode=0777)
base_dir = api.vars.build_dir base_dir = api.vars.build_dir
copies = { copies = {

View File

@ -2,4 +2,4 @@ package-lock.json
fonts/*.cpp fonts/*.cpp
coverage/* coverage/*
# Don't check in this copy. It's just for publishing to npm. # Don't check in this copy. It's just for publishing to npm.
canvaskit/CHANGELOG.md npm_build/CHANGELOG.md

View File

@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Added
- A full build of CanvasKit is now in /bin/full.
- `CanvasKit.rt_effect` to test if the RuntimeEffect code was compiled in.
### Breaking ### Breaking
- The `ShapedText` type has been removed. Clients who want ShapedText should use the - The `ShapedText` type has been removed. Clients who want ShapedText should use the
Paragraph APIs. Paragraph APIs.
@ -15,6 +19,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Paragraph APIs or `Font.getGlyphWidths` instead (the latter does no shaping). Paragraph APIs or `Font.getGlyphWidths` instead (the latter does no shaping).
- `Font.getWidths`, which had been previously deprecated. Clients should use `Font.getGlyphWidths`. - `Font.getWidths`, which had been previously deprecated. Clients should use `Font.getGlyphWidths`.
### Type Changes (index.d.ts)
- Documentation added for `managed_skottie`, `particles`, and `skottie` feature constants.
## [0.24.0] - 2021-02-18 ## [0.24.0] - 2021-02-18
### Added ### Added

View File

@ -1,79 +1,85 @@
clean: clean:
rm -rf ../../out/canvaskit_wasm rm -rf ../../out/canvaskit_wasm
rm -rf ./canvaskit/bin rm -rf ./npm_build/bin
$(MAKE) release $(MAKE) release
release: release:
# Does an incremental build where possible. # Does an incremental build where possible.
./compile.sh ./compile.sh
mkdir -p ./canvaskit/bin mkdir -p ./npm_build/bin
cp ../../out/canvaskit_wasm/canvaskit.js ./canvaskit/bin cp ../../out/canvaskit_wasm/canvaskit.js ./npm_build/bin
cp ../../out/canvaskit_wasm/canvaskit.wasm ./canvaskit/bin cp ../../out/canvaskit_wasm/canvaskit.wasm ./npm_build/bin
release_cpu: release_cpu:
# Does an incremental build where possible. # Does an incremental build where possible.
./compile.sh cpu_only ./compile.sh cpu_only
mkdir -p ./canvaskit/bin mkdir -p ./npm_build/bin
cp ../../out/canvaskit_wasm/canvaskit.js ./canvaskit/bin cp ../../out/canvaskit_wasm/canvaskit.js ./npm_build/bin
cp ../../out/canvaskit_wasm/canvaskit.wasm ./canvaskit/bin cp ../../out/canvaskit_wasm/canvaskit.wasm ./npm_build/bin
release_viewer: release_viewer:
# Does an incremental build where possible. # Does an incremental build where possible.
./compile.sh viewer ./compile.sh viewer
mkdir -p ./canvaskit/bin mkdir -p ./npm_build/bin
cp ../../out/canvaskit_wasm/canvaskit.js ./canvaskit/bin cp ../../out/canvaskit_wasm/canvaskit.js ./npm_build/bin
cp ../../out/canvaskit_wasm/canvaskit.wasm ./canvaskit/bin cp ../../out/canvaskit_wasm/canvaskit.wasm ./npm_build/bin
debug: debug:
# Does an incremental build where possible. # Does an incremental build where possible.
./compile.sh debug ./compile.sh debug
mkdir -p ./canvaskit/bin mkdir -p ./npm_build/bin
cp ../../out/canvaskit_wasm_debug/canvaskit.js ./canvaskit/bin cp ../../out/canvaskit_wasm_debug/canvaskit.js ./npm_build/bin
cp ../../out/canvaskit_wasm_debug/canvaskit.wasm ./canvaskit/bin cp ../../out/canvaskit_wasm_debug/canvaskit.wasm ./npm_build/bin
#cp ../../out/canvaskit_wasm_debug/canvaskit.wasm.map ./canvaskit/bin #cp ../../out/canvaskit_wasm_debug/canvaskit.wasm.map ./npm_build/bin
debug_cpu: debug_cpu:
# Does an incremental build where possible. # Does an incremental build where possible.
./compile.sh debug cpu_only ./compile.sh debug cpu_only
mkdir -p ./canvaskit/bin mkdir -p ./npm_build/bin
cp ../../out/canvaskit_wasm_debug/canvaskit.js ./canvaskit/bin cp ../../out/canvaskit_wasm_debug/canvaskit.js ./npm_build/bin
cp ../../out/canvaskit_wasm_debug/canvaskit.wasm ./canvaskit/bin cp ../../out/canvaskit_wasm_debug/canvaskit.wasm ./npm_build/bin
#cp ../../out/canvaskit_wasm_debug/canvaskit.wasm.map ./canvaskit/bin #cp ../../out/canvaskit_wasm_debug/canvaskit.wasm.map ./npm_build/bin
experimental_simd: experimental_simd:
# Does an incremental build where possible. # Does an incremental build where possible.
./compile.sh simd ./compile.sh simd
mkdir -p ./canvaskit/bin mkdir -p ./npm_build/bin
cp ../../out/canvaskit_wasm_experimental_simd/canvaskit.js ./canvaskit/bin cp ../../out/canvaskit_wasm_experimental_simd/canvaskit.js ./npm_build/bin
cp ../../out/canvaskit_wasm_experimental_simd/canvaskit.wasm ./canvaskit/bin cp ../../out/canvaskit_wasm_experimental_simd/canvaskit.wasm ./npm_build/bin
debug_viewer: debug_viewer:
# Does an incremental build where possible. # Does an incremental build where possible.
./compile.sh debug viewer ./compile.sh debug viewer
mkdir -p ./canvaskit/bin mkdir -p ./npm_build/bin
cp ../../out/canvaskit_wasm_debug/canvaskit.js ./canvaskit/bin cp ../../out/canvaskit_wasm_debug/canvaskit.js ./npm_build/bin
cp ../../out/canvaskit_wasm_debug/canvaskit.wasm ./canvaskit/bin cp ../../out/canvaskit_wasm_debug/canvaskit.wasm ./npm_build/bin
profile: profile:
./compile.sh profiling ./compile.sh profiling
mkdir -p ./canvaskit/bin mkdir -p ./npm_build/bin
cp ../../out/canvaskit_wasm_profile/canvaskit.js ./canvaskit/bin cp ../../out/canvaskit_wasm_profile/canvaskit.js ./npm_build/bin
cp ../../out/canvaskit_wasm_profile/canvaskit.wasm ./canvaskit/bin cp ../../out/canvaskit_wasm_profile/canvaskit.wasm ./npm_build/bin
npm: npm:
rm -rf ./canvaskit/bin rm -rf ./npm_build/bin
mkdir -p ./canvaskit/bin mkdir -p ./npm_build/bin
cp ./CHANGELOG.md ./canvaskit/ cp ./CHANGELOG.md ./npm_build/
mkdir -p ./npm_build/bin/full
./compile.sh release
cp ../../out/canvaskit_wasm/canvaskit.js ./npm_build/bin/full
cp ../../out/canvaskit_wasm/canvaskit.wasm ./npm_build/bin/full
# These features are turned off to keep code size smaller for the # These features are turned off to keep code size smaller for the
# general use case. # general use case.
./compile.sh release no_skottie no_particles no_rt_shader no_alias_font no_effects_deserialization ./compile.sh release no_skottie no_particles no_rt_shader no_alias_font no_effects_deserialization
cp ../../out/canvaskit_wasm/canvaskit.js ./canvaskit/bin cp ../../out/canvaskit_wasm/canvaskit.js ./npm_build/bin
cp ../../out/canvaskit_wasm/canvaskit.wasm ./canvaskit/bin cp ../../out/canvaskit_wasm/canvaskit.wasm ./npm_build/bin
mkdir -p ./canvaskit/bin/profiling mkdir -p ./npm_build/bin/profiling
./compile.sh profiling no_skottie no_particles no_rt_shader no_alias_font no_effects_deserialization ./compile.sh profiling
cp ../../out/canvaskit_wasm_profile/canvaskit.js ./canvaskit/bin/profiling cp ../../out/canvaskit_wasm_profile/canvaskit.js ./npm_build/bin/profiling
cp ../../out/canvaskit_wasm_profile/canvaskit.wasm ./canvaskit/bin/profiling cp ../../out/canvaskit_wasm_profile/canvaskit.wasm ./npm_build/bin/profiling
gm_tests_debug: gm_tests_debug:
./compile_gm.sh debug ./compile_gm.sh debug
@ -90,12 +96,12 @@ gm_tests:
local-example: local-example:
rm -rf node_modules/canvaskit rm -rf node_modules/canvaskit
mkdir -p node_modules mkdir -p node_modules
ln -s ../canvaskit node_modules/canvaskit ln -s ../npm_build node_modules/canvaskit
echo "Go check out http://localhost:8000/canvaskit/example.html" echo "Go check out http://localhost:8000/npm_build/example.html"
python serve.py python serve.py
test-continuous: test-continuous:
echo "Assuming npm install has been run by user" echo "Assuming npm ci has been run by user"
echo "Also assuming make debug or release has also been run by a user (if needed)" echo "Also assuming make debug or release has also been run by a user (if needed)"
npx karma start ./karma.conf.js --no-single-run --watch-poll npx karma start ./karma.conf.js --no-single-run --watch-poll
@ -107,7 +113,7 @@ perf:
npx karma start ./karma.bench.conf.js --single-run npx karma start ./karma.bench.conf.js --single-run
node-example: node-example:
node ./canvaskit/node.example.js --expose-wasm node ./npm_build/node.example.js --expose-wasm
docker-compile: docker-compile:
mkdir -p ${SKIA_ROOT}/out/canvaskit_wasm_docker mkdir -p ${SKIA_ROOT}/out/canvaskit_wasm_docker
@ -117,5 +123,5 @@ docker-compile:
/SRC/infra/canvaskit/build_canvaskit.sh /SRC/infra/canvaskit/build_canvaskit.sh
typecheck: typecheck:
echo "Make sure you've run cd canvaskit && npm ci recently" echo "Make sure you've run cd npm_build && npm ci recently"
cd canvaskit && npm run dtslint cd npm_build && npm run dtslint

View File

@ -26,8 +26,8 @@ make local-example
``` ```
This will print a local endpoint for viewing the example. You can experiment This will print a local endpoint for viewing the example. You can experiment
with the CanvasKit API by modifying `./canvaskit/example.html` and refreshing with the CanvasKit API by modifying `./npm_build/example.html` and refreshing
the page. For some more experimental APIs, there's also `./canvaskit/extra.html`. the page. For some more experimental APIs, there's also `./npm_build/extra.html`.
For other available build targets, see `Makefile` and `compile.sh`. For other available build targets, see `Makefile` and `compile.sh`.
For example, building a stripped-down version of CanvasKit with no text support or For example, building a stripped-down version of CanvasKit with no text support or

View File

@ -1677,6 +1677,8 @@ EMSCRIPTEN_BINDINGS(Skia) {
.field("columns", &RuntimeEffectUniform::columns) .field("columns", &RuntimeEffectUniform::columns)
.field("rows", &RuntimeEffectUniform::rows) .field("rows", &RuntimeEffectUniform::rows)
.field("slot", &RuntimeEffectUniform::slot); .field("slot", &RuntimeEffectUniform::slot);
constant("rt_effect", true);
#endif #endif
class_<SkSurface>("Surface") class_<SkSurface>("Surface")

View File

@ -10,18 +10,18 @@ module.exports = function(config) {
// list of files / patterns to load in the browser // list of files / patterns to load in the browser
files: [ files: [
{ pattern: 'canvaskit/bin/canvaskit.wasm', included:false, served:true}, { pattern: 'npm_build/bin/canvaskit.wasm', included:false, served:true},
{ pattern: 'perf/assets/*', included:false, served:true}, { pattern: 'perf/assets/*', included:false, served:true},
'perf/perfReporter.js', 'perf/perfReporter.js',
'canvaskit/bin/canvaskit.js', 'npm_build/bin/canvaskit.js',
'tests/canvaskitinit.js', 'tests/canvaskitinit.js',
'tests/util.js', 'tests/util.js',
'perf/*.bench.js' 'perf/*.bench.js'
], ],
proxies: { proxies: {
'/canvaskit/': '/base/canvaskit/bin/', '/assets/': '/base/perf/assets/',
'/assets/': '/base/perf/assets/' '/npm_build/': '/base/npm_build/bin/',
}, },
// test results reporter to use // test results reporter to use

View File

@ -10,10 +10,10 @@ module.exports = function(config) {
// list of files / patterns to load in the browser // list of files / patterns to load in the browser
files: [ files: [
{ pattern: 'canvaskit/bin/canvaskit.wasm', included:false, served:true}, { pattern: 'npm_build/bin/canvaskit.wasm', included:false, served:true},
{ pattern: 'tests/assets/*', included:false, served:true}, { pattern: 'tests/assets/*', included:false, served:true},
'tests/testReporter.js', 'tests/testReporter.js',
'canvaskit/bin/canvaskit.js', 'npm_build/bin/canvaskit.js',
'tests/canvaskitinit.js', 'tests/canvaskitinit.js',
'tests/util.js', 'tests/util.js',
'tests/*.spec.js' 'tests/*.spec.js'
@ -21,7 +21,7 @@ module.exports = function(config) {
proxies: { proxies: {
'/assets/': '/base/tests/assets/', '/assets/': '/base/tests/assets/',
'/canvaskit/': '/base/canvaskit/bin/', '/npm_build/': '/base/npm_build/bin/',
}, },
// test results reporter to use // test results reporter to use

View File

@ -1006,7 +1006,8 @@
paint.delete(); paint.delete();
// Make it repeat a bunch with a shader // Make it repeat a bunch with a shader
const pattern = img.makeShader(CanvasKit.TileMode.Repeat, CanvasKit.TileMode.Mirror); const pattern = img.makeShaderCubic(CanvasKit.TileMode.Repeat, CanvasKit.TileMode.Mirror,
1/3, 1/3);
const patternPaint = new CanvasKit.Paint(); const patternPaint = new CanvasKit.Paint();
patternPaint.setShader(pattern); patternPaint.setShader(pattern);

View File

@ -8,6 +8,10 @@
canvas { canvas {
border: 1px dashed #AAA; border: 1px dashed #AAA;
} }
#sk_legos,#sk_drinks,#sk_party,#sk_onboarding, #sk_animated_gif {
width: 300px;
height: 300px;
}
</style> </style>
@ -315,13 +319,17 @@
} }
const quadrantSize = 150; const quadrantSize = 150;
const dogShader = dogImg.makeShader(CanvasKit.TileMode.Clamp, CanvasKit.TileMode.Clamp, const dogShader = dogImg.makeShaderCubic(
CanvasKit.Matrix.scaled(quadrantSize/dogImg.width(), CanvasKit.TileMode.Clamp, CanvasKit.TileMode.Clamp,
quadrantSize/dogImg.height())); 1/3, 1/3,
const mandrillShader = mandrillImg.makeShader(CanvasKit.TileMode.Clamp, CanvasKit.TileMode.Clamp, CanvasKit.Matrix.scaled(quadrantSize/dogImg.width(),
CanvasKit.Matrix.scaled( quadrantSize/dogImg.height()));
quadrantSize/mandrillImg.width(), const mandrillShader = mandrillImg.makeShaderCubic(
quadrantSize/mandrillImg.height())); CanvasKit.TileMode.Clamp, CanvasKit.TileMode.Clamp,
1/3, 1/3,
CanvasKit.Matrix.scaled(
quadrantSize/mandrillImg.width(),
quadrantSize/mandrillImg.height()));
const surface = CanvasKit.MakeCanvasSurface('rtshader2'); const surface = CanvasKit.MakeCanvasSurface('rtshader2');
if (!surface) { if (!surface) {
@ -493,10 +501,10 @@
const textFont = new CanvasKit.Font(roboto, 30); const textFont = new CanvasKit.Font(roboto, 30);
const imgscale = CanvasKit.Matrix.scaled(2, 2); const imgscale = CanvasKit.Matrix.scaled(2, 2);
const textureShader = CanvasKit.MakeImageFromEncoded(textureImgData).makeShader( const textureShader = CanvasKit.MakeImageFromEncoded(textureImgData).makeShaderCubic(
CanvasKit.TileMode.Clamp, CanvasKit.TileMode.Clamp, imgscale); CanvasKit.TileMode.Clamp, CanvasKit.TileMode.Clamp, 1/3, 1/3, imgscale);
const normalShader = CanvasKit.MakeImageFromEncoded(normalImgData).makeShader( const normalShader = CanvasKit.MakeImageFromEncoded(normalImgData).makeShaderCubic(
CanvasKit.TileMode.Clamp, CanvasKit.TileMode.Clamp, imgscale); CanvasKit.TileMode.Clamp, CanvasKit.TileMode.Clamp, 1/3, 1/3, imgscale);
const children = [textureShader, normalShader]; const children = [textureShader, normalShader];
const prog = ` const prog = `

View File

@ -485,7 +485,11 @@ export interface CanvasKit {
*/ */
readonly ShadowDirectionalLight: number; readonly ShadowDirectionalLight: number;
readonly gpu: boolean; // if GPU code was compiled in readonly gpu?: boolean; // true if GPU code was compiled in
readonly managed_skottie?: boolean; // true if advanced (managed) Skottie code was compiled in
readonly particles?: boolean; // true if Particles code was compiled in
readonly rt_effect?: boolean; // true if RuntimeEffect was compiled in
readonly skottie?: boolean; // true if base Skottie code was compiled in
// Paragraph Enums // Paragraph Enums
readonly Affinity: AffinityEnumValues; readonly Affinity: AffinityEnumValues;

View File

@ -6,7 +6,7 @@ let CanvasKit = null;
const LoadCanvasKit = new Promise((resolve, reject) => { const LoadCanvasKit = new Promise((resolve, reject) => {
console.log('canvaskit loading', new Date()); console.log('canvaskit loading', new Date());
CanvasKitInit({ CanvasKitInit({
locateFile: (file) => '/canvaskit/'+file, locateFile: (file) => '/npm_build/'+file,
}).then((loaded) => { }).then((loaded) => {
console.log('canvaskit loaded', new Date()); console.log('canvaskit loaded', new Date());
CanvasKit = loaded; CanvasKit = loaded;