[canvaskit] Fleshing out the beginnings of a Canvas API
I can probably write most, if not all, of a Canvas API in
JS using the SkCanvas and SkPaint objects. This lets us expose
the fancier API and optionally have a more familiar API.
This is controlled at compile time, i.e. bring in the extra
JS or not.
There is still plenty of the API that needs working, but
this is meant to outlay the plans of where this is going.
Bug: skia:
Change-Id: I2e36a33c24c2bacd52811dc85508dba170ab0dd7
Reviewed-on: https://skia-review.googlesource.com/c/163490
Reviewed-by: Mike Reed <reed@google.com>
diff --git a/experimental/canvaskit/compile.sh b/experimental/canvaskit/compile.sh
index bc905dd..7ca0dc0 100755
--- a/experimental/canvaskit/compile.sh
+++ b/experimental/canvaskit/compile.sh
@@ -67,6 +67,12 @@
WASM_SKOTTIE="-DSK_INCLUDE_SKOTTIE=0"
fi
+HTML_CANVAS_API="--pre-js $BASE_DIR/htmlcanvas/canvas2d.js"
+if [[ $@ == *no_canvas* ]]; then
+ echo "Omitting bindings for HTML Canvas API"
+ HTML_CANVAS_API=""
+fi
+
# Turn off exiting while we check for ninja (which may not be on PATH)
set +e
NINJA=`which ninja`
@@ -153,6 +159,7 @@
--bind \
--pre-js $BASE_DIR/helper.js \
--pre-js $BASE_DIR/interface.js \
+ $HTML_CANVAS_API \
$BASE_DIR/canvaskit_bindings.cpp \
tools/fonts/SkTestFontMgr.cpp \
tools/fonts/SkTestTypeface.cpp \