[canvaskit] Expose nima animation as POC
Still to come, actually exposing drawVertices, and the
other APIs needed.
Had to re-make all the jsfiddles because of an API change
in a previous CL.
Docs-Preview: https://skia.org/?cl=166444
Bug: skia:
Change-Id: I4d4825f6e7b073d6792ab8d99d5117df860d4815
Reviewed-on: https://skia-review.googlesource.com/c/166444
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
diff --git a/experimental/canvaskit/interface.js b/experimental/canvaskit/interface.js
index 885d7e2..d74f380 100644
--- a/experimental/canvaskit/interface.js
+++ b/experimental/canvaskit/interface.js
@@ -141,4 +141,13 @@
return CanvasKit._MakeSkDashPathEffect(ptr, intervals.length, phase);
}
+ CanvasKit.MakeNimaActor = function(nimaFile, nimaTexture) {
+ var nptr = CanvasKit._malloc(nimaFile.byteLength);
+ CanvasKit.HEAPU8.set(new Uint8Array(nimaFile), nptr);
+ var tptr = CanvasKit._malloc(nimaTexture.byteLength);
+ CanvasKit.HEAPU8.set(new Uint8Array(nimaTexture), tptr);
+
+ return CanvasKit._MakeNimaActor(nptr, nimaFile.byteLength, tptr, nimaTexture.byteLength);
+ }
+
}(Module)); // When this file is loaded in, the high level object is "Module";