commit | a40f832ae12dd997f9e35ecc6fe68072d703f799 | [log] [tgz] |
---|---|---|
author | Kevin Lubick <kjlubick@google.com> | Mon Dec 17 16:01:36 2018 -0500 |
committer | Kevin Lubick <kjlubick@google.com> | Mon Dec 17 21:19:48 2018 +0000 |
tree | f6a82d67980239dfbda24c86413a160a4d45a2d1 | |
parent | ec7e37a0c85489dfb98044af723cc2b51f655d0a [diff] [blame] |
[canvaskit] Add Path2D to Canvas API This moves the shared logic into path2d.js from canvas2dcontext.js. Bug: skia: Change-Id: Id63bc52a190109f7cbc4e17ddb5603e6e87d5dc0 Reviewed-on: https://skia-review.googlesource.com/c/178268 Reviewed-by: Joe Gregorio <jcgregorio@google.com>
diff --git a/experimental/canvaskit/htmlcanvas/htmlcanvas.js b/experimental/canvaskit/htmlcanvas/htmlcanvas.js index 6f118e5..de9794f 100644 --- a/experimental/canvaskit/htmlcanvas/htmlcanvas.js +++ b/experimental/canvaskit/htmlcanvas/htmlcanvas.js
@@ -32,6 +32,12 @@ addToFontCache(newFont, descriptors); } + this.makePath2D = function(path) { + var p2d = new Path2D(path); + this._toCleanup.push(p2d._getPath()); + return p2d; + } + // A normal <canvas> requires that clients call getContext this.getContext = function(type) { if (type === '2d') {