From 8abc8429457128456866b52bb0bebaa800319d91 Mon Sep 17 00:00:00 2001 From: Kevin Lubick Date: Tue, 26 Feb 2019 07:59:48 -0500 Subject: [PATCH] [pathkit] fix perf Docs-Preview: https://skia.org/?cl=195360 Bug: skia: Change-Id: I4109810832b69a71960f6e619e32288ae8fa5023 Reviewed-on: https://skia-review.googlesource.com/c/195360 Reviewed-by: Kevin Lubick --- modules/pathkit/perf/effects.bench.js | 2 +- modules/pathkit/perf/path.bench.js | 2 +- modules/pathkit/perf/pathops.bench.js | 2 +- site/user/modules/pathkit.md | 7 +++---- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/modules/pathkit/perf/effects.bench.js b/modules/pathkit/perf/effects.bench.js index d1be9ec862..cf73fd4a38 100644 --- a/modules/pathkit/perf/effects.bench.js +++ b/modules/pathkit/perf/effects.bench.js @@ -9,7 +9,7 @@ describe('PathKit\'s Effects', function() { } else { PathKitInit({ locateFile: (file) => '/pathkit/'+file, - }).then((_PathKit) => { + }).ready().then((_PathKit) => { PathKit = _PathKit; resolve(); }); diff --git a/modules/pathkit/perf/path.bench.js b/modules/pathkit/perf/path.bench.js index 35d8b252f7..d8dc47e955 100644 --- a/modules/pathkit/perf/path.bench.js +++ b/modules/pathkit/perf/path.bench.js @@ -9,7 +9,7 @@ describe('PathKit\'s Path Behavior', function() { } else { PathKitInit({ locateFile: (file) => '/pathkit/'+file, - }).then((_PathKit) => { + }).ready().then((_PathKit) => { PathKit = _PathKit; resolve(); }); diff --git a/modules/pathkit/perf/pathops.bench.js b/modules/pathkit/perf/pathops.bench.js index 2da6553850..aa105a4305 100644 --- a/modules/pathkit/perf/pathops.bench.js +++ b/modules/pathkit/perf/pathops.bench.js @@ -9,7 +9,7 @@ describe('PathKit\'s Pathops', function() { } else { PathKitInit({ locateFile: (file) => '/pathkit/'+file, - }).then((_PathKit) => { + }).ready().then((_PathKit) => { PathKit = _PathKit; resolve(); }); diff --git a/site/user/modules/pathkit.md b/site/user/modules/pathkit.md index b081176b5d..5e597b9dac 100644 --- a/site/user/modules/pathkit.md +++ b/site/user/modules/pathkit.md @@ -40,22 +40,21 @@ The primary features are: let s = document.createElement('script'); if (window.WebAssembly && typeof window.WebAssembly.compile === 'function') { console.log('WebAssembly is supported! Using the wasm version of PathKit'); - window.__pathkit_locate_file = 'https://unpkg.com/pathkit-wasm@0.5.0/bin/'; + window.__pathkit_locate_file = 'https://unpkg.com/pathkit-wasm@0.6.0/bin/'; } else { console.log('WebAssembly is not supported (yet) on this browser. Using the asmjs version of PathKit'); - window.__pathkit_locate_file = 'https://unpkg.com/pathkit-asmjs@0.5.0/bin/'; + window.__pathkit_locate_file = 'https://unpkg.com/pathkit-asmjs@0.6.0/bin/'; } s.src = window.__pathkit_locate_file+'pathkit.js'; s.onload = () => { try { PathKitInit({ locateFile: (file) => window.__pathkit_locate_file+file, - }).then((PathKit) => { + }).ready().then((PathKit) => { // Code goes here using PathKit PathEffectsExample(PathKit); MatrixTransformExample(PathKit); }); - } catch(error) { console.warn(error, 'falling back to image');