[PathKit] Add cubicYFromX


Docs-Preview: https://skia.org/?cl=152385
Bug: skia:8216
Change-Id: I0020e8d2d4e6e7c7de5c71ddf923a618659cde2c
Reviewed-on: https://skia-review.googlesource.com/152385
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
diff --git a/modules/pathkit/pathkit_wasm_bindings.cpp b/modules/pathkit/pathkit_wasm_bindings.cpp
index 40772d8..38af2c6 100644
--- a/modules/pathkit/pathkit_wasm_bindings.cpp
+++ b/modules/pathkit/pathkit_wasm_bindings.cpp
@@ -14,6 +14,7 @@
 #include "SkStrokeRec.h"
 #include "SkPath.h"
 #include "SkPathOps.h"
+#include "SkCubicMap.h"
 #include "SkRect.h"
 #include "SkPaintDefaults.h"
 #include "SkString.h"
@@ -622,6 +623,19 @@
         .element(&SimpleMatrix::pers1)
         .element(&SimpleMatrix::pers2);
 
+    value_array<SkPoint>("SkPoint")
+        .element(&SkPoint::fX)
+        .element(&SkPoint::fY);
+
+    // Not intended for external clients to call directly.
+    // See helper.js for the client-facing implementation.
+    class_<SkCubicMap>("_SkCubicMap")
+        .constructor<SkPoint, SkPoint>()
+
+        .function("computeYFromX", &SkCubicMap::computeYFromX)
+        .function("computePtFromT", &SkCubicMap::computeFromT);
+
+
     // Test Utils
     function("SkBits2FloatUnsigned", &SkBits2FloatUnsigned);
 }