Other devs should run `npm ci` to install these locally.
Change-Id: I4581e8afe2401b10edae86b8bfd6fe398546cd0f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/412836
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
This cuts down on some flakiness I saw locally.
Change-Id: I8659b2cabacb99f3839a4b44daec852061184d55
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/412663
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Grants read-access to a JS array, either ...
- direct peek into the (malloc'd buffer)
- quick copy (the src was a typed_array)
- slow copy (had to perform a per-element lookup)
Change-Id: Id389f244039d35aefd84e0d95d598cbe15cd28c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/409397
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Herb Derby <herb@google.com>
We only break runs (from the shaper's perspective) on typeface/size
changes. All others we just track locally, and then 'chop up' our draws
accordingly.
Change-Id: I81695772f71175cd5116ed34981ecf16b52123c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405876
Reviewed-by: Mike Reed <reed@google.com>
Known hacks for now:
- only default typeface
- only ascii support
Fonts have several limitations for now.
SkParagraph (our temporary backend) wants a fontmgr up front,
rather than just relying on the typefaces in its styles. This makes it
hard to inter-op with our JS api. Not a long-term problem, as this
backend is short-term. The hacky work-around is just to pass NULL for
the typeface for now.
Related but different, I haven't yet figured out how to "return" a
JS Typeface object. Something about bare-pointers and sk_sp. I'll figure
it out eventually, but for now I just set the output slot to null
as well. (there's a TODO in the .cpp)
Ascii support
JS strings are UTF16 (afaik). However, our current backend thinks in
terms of UTF8 offsets. Plus, (at the moment) when I try to access the
JS string for C++, it coerces to utf8 (std::string).
We can fix both of these eventually, but for now I'll just test with
ascii input characters, and the API can still work.
Change-Id: I62ca71b0b45d017ac8e3881c06720776dc2d75a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405400
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Change-Id: I5309005146b8121528ad23589fa64cc6bf286aee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/402578
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Also some includes that I noticed along the way.
Change-Id: If48a3a9ff8bd5daea21065051c811e8b3e8a701f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/402136
Reviewed-by: Kevin Lubick <kjlubick@google.com>
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>
These new tests rely on compiled shaders that live in the
`tests/sksl/dslfp/` directory; this CL updates the Bazel and
emscripten build scripts to include these shaders.
Change-Id: Ib670682af8bf451a4473504dd4cc76a0e9222129
Bug: skia:11854
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/400097
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
These are leftovers. Should be a noop.
Change-Id: I9897841e63b417a63d6f2d681a8ac4ae50ebb485
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/399797
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
The old factory is deprecated. The new factory does stricter checking on
the signature of main and calls to sample - verifying that the SkSL is
valid as an SkShader (vs SkColorFilter) at effect creation time.
Bug: skia:11813
Change-Id: I8d70f81b5c3fa78b05add1b591caf1d26dd70402
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/399077
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Generating the enum code should be a good first step for
automatically generating the C++ binding code using some type
of annotation.
Change-Id: I3a2af66204cf48a1efb4f24b7a4af59626100227
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/398676
Reviewed-by: Julia Lavrova <jlavrova@google.com>
This is another strange, experimental feature that clutters the
implementation and isn't used by anyone (to my knowledge).
Change-Id: I538b7eca0cd28aab32f4739b23459731ade9105e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/398226
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Font was missing getMetrics()
However, seems like getShapedRuns() needs to return its
particular line spacing choices...
Change-Id: I574ebf789fb03b79c8e09198f1cb6e09dac3441b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/397916
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>