Skip to content

Commit 53eabf6

Browse files
committed
[canvaskit] Refactor Canvas2D JS into own files
Rather than one monolithic file, we now have one monolithic file (canvascontext2d) and several smaller files (one per class, and some helpers). This should make the code navigation a little easier. Bug: skia: Change-Id: Ia191c2db778591af21d2a6126f053c17c4f677f1 Reviewed-on: https://skia-review.googlesource.com/c/175996 Reviewed-by: Florin Malita <fmalita@chromium.org>
1 parent 9cabb4f commit 53eabf6

File tree

14 files changed

+1714
-1688
lines changed

14 files changed

+1714
-1688
lines changed

experimental/canvaskit/compile.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,17 @@ if [[ $@ == *no_managed_skottie* ]]; then
8080
WASM_MANAGED_SKOTTIE="-DSK_INCLUDE_MANAGED_SKOTTIE=0"
8181
fi
8282

83-
HTML_CANVAS_API="--pre-js $BASE_DIR/htmlcanvas/canvas2d.js"
83+
HTML_CANVAS_API="--pre-js $BASE_DIR/htmlcanvas/preamble.js \
84+
--pre-js $BASE_DIR/htmlcanvas/util.js \
85+
--pre-js $BASE_DIR/htmlcanvas/color.js \
86+
--pre-js $BASE_DIR/htmlcanvas/font.js \
87+
--pre-js $BASE_DIR/htmlcanvas/canvas2dcontext.js \
88+
--pre-js $BASE_DIR/htmlcanvas/htmlcanvas.js \
89+
--pre-js $BASE_DIR/htmlcanvas/imagedata.js \
90+
--pre-js $BASE_DIR/htmlcanvas/lineargradient.js \
91+
--pre-js $BASE_DIR/htmlcanvas/pattern.js \
92+
--pre-js $BASE_DIR/htmlcanvas/radialgradient.js \
93+
--pre-js $BASE_DIR/htmlcanvas/postamble.js "
8494
if [[ $@ == *no_canvas* ]]; then
8595
echo "Omitting bindings for HTML Canvas API"
8696
HTML_CANVAS_API=""

experimental/canvaskit/htmlcanvas/_namedcolors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This node script is meant to pre-compute the named colors.
22
// node ./htmlcanvas/_namedcolors.js --expose-wasm
3-
// Put the result in canvas2d.js
3+
// Put the result in color.js
44
// This should likely never need to be re-run.
55

66
const CanvasKitInit = require('../canvaskit/bin/canvaskit.js');

0 commit comments

Comments
 (0)