[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 <kjlubick@google.com>
This commit is contained in:
Kevin Lubick 2019-02-26 07:59:48 -05:00
parent 346e10e8ae
commit 8abc842945
4 changed files with 6 additions and 7 deletions

View File

@ -9,7 +9,7 @@ describe('PathKit\'s Effects', function() {
} else {
PathKitInit({
locateFile: (file) => '/pathkit/'+file,
}).then((_PathKit) => {
}).ready().then((_PathKit) => {
PathKit = _PathKit;
resolve();
});

View File

@ -9,7 +9,7 @@ describe('PathKit\'s Path Behavior', function() {
} else {
PathKitInit({
locateFile: (file) => '/pathkit/'+file,
}).then((_PathKit) => {
}).ready().then((_PathKit) => {
PathKit = _PathKit;
resolve();
});

View File

@ -9,7 +9,7 @@ describe('PathKit\'s Pathops', function() {
} else {
PathKitInit({
locateFile: (file) => '/pathkit/'+file,
}).then((_PathKit) => {
}).ready().then((_PathKit) => {
PathKit = _PathKit;
resolve();
});

View File

@ -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');