Updates to GlyphRuns[]
1. Fold "origin" into the positions (simplification)
2. Extend positions and offset arrays by 1, to include 1-past last glyph
3. Add flags field to run (with just WS flag for now)
Change-Id: I93e38df808a5e9e4e5bcedbc62bc5a7aa433ef2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/399876
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Yegor Jbanov <yjbanov@google.com>
diff --git a/modules/canvaskit/interface.js b/modules/canvaskit/interface.js
index 6326b2f..ce1077f 100644
--- a/modules/canvaskit/interface.js
+++ b/modules/canvaskit/interface.js
@@ -583,8 +583,8 @@
};
CanvasKit.Canvas.prototype.drawGlyphs = function(glyphs, positions, x, y, font, paint) {
- if (!(glyphs.length*2 == positions.length)) {
- throw 'Need glyphs and positions array to agree on the length';
+ if (!(glyphs.length*2 <= positions.length)) {
+ throw 'Not enough positions for the array of gyphs';
}
const glyphs_ptr = copy1dArray(glyphs, 'HEAPU16');