[canvaskit] Expand canvas2d API
Made addPath take one more arg to allow for append/expand
(which makes emulating the HTML canvas easier).
Add Gold test for various lineTo/pathTo, etc.
Make CanvasKit.Color() choose a better value for alpha
when omitted (was 0, should be 1).
Add some parsing logic to deal with colors/font sizes.
Fonts are going to be rather complex it seems.
Moves some arc-related logic to the JS side, (although
this should preserve the behavior of CanvasKit.arc() to
behave like the Canvas implementation)
Make Examples and tests to a side-by-side comparison to
HTML canvas where applicable.
Add a Changelog for PathKit. There was a bug (I thought), but
turns out I was wrong. The Changelog will be for future
bug fixes.
Bug: skia:
Change-Id: I1bd603fdb518232604b098e24543e3453015b504
Reviewed-on: https://skia-review.googlesource.com/c/170446
Reviewed-by: Kevin Lubick <kjlubick@google.com>
diff --git a/modules/pathkit/tests/testReporter.js b/modules/pathkit/tests/testReporter.js
index 3879ec1..530b712 100644
--- a/modules/pathkit/tests/testReporter.js
+++ b/modules/pathkit/tests/testReporter.js
@@ -3,9 +3,9 @@
// Typically used for debugging.
const fail_on_no_gold = false;
-function reportCanvas(canvas, testname) {
+function reportCanvas(canvas, testname, outputType='canvas') {
let b64 = canvas.toDataURL('image/png');
- return _report(b64, 'canvas', testname);
+ return _report(b64, outputType, testname);
}
function reportSVG(svg, testname) {
@@ -71,6 +71,8 @@
}).catch(reportError(done));
}
+// data is a base64 encoded png, outputType is the value that goes with the
+// key 'config' when reporting.
function _report(data, outputType, testname) {
return fetch(REPORT_URL, {
method: 'POST',
@@ -116,6 +118,8 @@
fn()
} catch (e) {
console.log('Failed with the following error', e);
+ expect(e).toBeFalsy();
+ debugger;
done();
}
// We don't call done with finally because