Commit Graph

1654 Commits

Author SHA1 Message Date
Kevin Lubick
7b6a92818d [canvaskit] Add Surface.makeFromTexture
This includes a helper Surface.makeFromTextureSource that will
make the gl calls with some sensible defaults.

Change-Id: I31bb2f3118b4749e77fb1fc2cb013d35ccb7cfce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/413336
Reviewed-by: Brian Osman <brianosman@google.com>
2021-06-03 12:29:07 +00:00
Kevin Lubick
72fb3fcdf0 [canvaskit] Use copy1darray to send arrays to JSSpan
This approach is 5 to 20x faster than the existing version,
mostly by minimizing the number of back-and-forths, especially
in the vanilla JS Array case.

Change-Id: Icb4212f781b80ef743f3deb1c17ea6af80ea828b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/414517
Reviewed-by: Mike Reed <reed@google.com>
2021-06-02 14:18:59 +00:00
Julia Lavrova
658d96662b Fixing the worst case when text cannot be resolved at all
(hanging on Mac)
Bug: skia:11996

Change-Id: I4dcd8175d0d4440a7c7ef73be26508018ad86c46
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/412661
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-05-27 17:43:57 +00:00
Kevin Lubick
123e55968d [canvaskit] Build with emsdk 2.0.20
Change-Id: I4c3bdc8dd0d0dc8b12b2d430d5ea9a20d170b82b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/412876
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-05-27 12:36:41 +00:00
Kevin Lubick
61b0a88357 [canvaskit] Update testing dependencies
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>
2021-05-27 12:31:20 +00:00
Kevin Lubick
dc5530e5b3 [canvaskit] Retry loading assets for tests
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>
2021-05-27 12:31:06 +00:00
Kevin Lubick
95d599c0a0 [canvaskit] Introduce self-documenting pointer types
Change-Id: I72dfe6098dae699d85cf87b6432e27cf845c832d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/412659
Reviewed-by: Mike Reed <reed@google.com>
2021-05-27 12:30:54 +00:00
Jorge Betancourt
614e398ed3 expose Matrix transpositions and setUniform to RuntimeEffectBuilder
Change-Id: I78b57c3ad5e735335d1e2cc34e6c51a2ced6fc03
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/412796
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-05-26 20:31:39 +00:00
Mike Reed
0e4477e713 Switch to malloc/free to be compatible with CanvasKit.Malloc
Inspired by https://skia-review.googlesource.com/c/skia/+/410876

Change-Id: Iaf64f379e74d46b46c795dd5f04db32406b976b4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411576
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-05-24 12:22:13 +00:00
Mike Reed
ec9d0e865d Move patheffect details to (private) base subclass
bug: skia:11957
Change-Id: Iceaa0ac1d7a3f049d2725629d78c755ad03a2862
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411302
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-05-22 01:55:43 +00:00
Florin Malita
50cc5d4147 [androidkit] Image shader support
Tangential updates:

 - new encoded input stream Image factory
 - Paint setters now return the object to support a fluent workflow
 - cube demo updated to store face paints instead of colors


Change-Id: I6142a229b18165112ef1fe76acae38bc4b27480d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410789
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-05-21 17:30:43 +00:00
Florin Malita
6e5d64b160 [androidkit] Add SamplingOptions
Mirroring SkSamplingOptions.

Change-Id: I6c4d21fb3f123e7931271fcc830d82f6b0215c40
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410786
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-05-20 20:29:55 +00:00
Florin Malita
934c02142e [androidkit] Introduce Image support
Two sources from now:

  - encoded data factory
  - Surface.makeImageSnapshot()

Change-Id: Icbf2f855e489839dc82db425916c8644418a2fb7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410324
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2021-05-20 20:28:55 +00:00
Kevin Lubick
82c4a69b27 [canvaskit] Roll 0.27.0
Change-Id: I216d91caa48a8d596d303a5dfa8a403b56b2d11a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410857
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-05-20 18:57:24 +00:00
Kevin Lubick
6017b4833f [canvaskit] Remove two previously deprecated APIs
Change-Id: I952f688fe4292344d1d4a57a29179eaddb35360b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410856
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-05-20 18:44:50 +00:00
Julia Lavrova
10e7e77909 Reland "Switching SkText to UTF16"
This is a reland of a3262aa1d2

Original change's description:
> Switching SkText to UTF16
>
> Required some changes in SkUnicode to support it
> SkShaper still works on UTF8
>
> Change-Id: I76645668e1d9bf95eb4539a066deea2b24ecf5e9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/406360
> Reviewed-by: Julia Lavrova <jlavrova@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

Change-Id: Ib21898d4acda8ab78e5e6fd1c7b9b0da41c3fa83
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407396
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-05-19 17:54:14 +00:00
Mike Reed
0dfb1c93c1 Use template specialization to remove redundant parameter
Change-Id: I74762ff88ec0220ff023957668bdda9c4a487f1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/409999
Reviewed-by: Herb Derby <herb@google.com>
2021-05-18 19:43:53 +00:00
Florin Malita
a1304f513e [androidkit] Add SurfaceRenderer utility
Most samples use the same render thread boilerplate -- consolidate as
a utility base class.

Also add Canvas.getWidth/getHeight.

Change-Id: I27c9f51b4fd9d228a39593fbd4650a66d10240c2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/409896
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-05-18 19:37:44 +00:00
Yegor Jbanov
3c429d05f9 make jline a JS object
Change-Id: Ib0e48868c77270f091c2d6ad857cd47278aff8a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410036
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Yegor Jbanov <yjbanov@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-05-18 19:25:54 +00:00
Mike Reed
bdfd776161 Optimize reading from a JS array
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>
2021-05-18 15:25:37 +00:00
Ethan Nicholas
55a63afc5f Make it possible to use the DSL from within the compiler itself
The DSL would not previously function within the compiler, because it
expected to be in charge of everything itself. The compiler and DSL also
disagreed about how to handle some things, such as the DSL not
respecting the compiler's override flags.

This CL moves responsibility for much of the setup process into
DSL::Start(), which the compiler now invokes. DSL::Start() now also
takes a ProgramSettings instead of DSL-specific flags, and the
externalFunctions vector has been moved into ProgramSettings.

Change-Id: I283ed8366e25d67f02c43833743c5f8afdedaefc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408136
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-05-18 15:10:53 +00:00
Florin Malita
5e8d88ef29 [androidkit] Add support for Skottie animations
Change-Id: Ibba2c0c8ad5b10d90f0bb30a3a859dacb94a03ad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/409400
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2021-05-18 14:49:43 +00:00
Mike Reed
e8cd0a5404 Don't need/want to pay attention to non-shaping attributes
Change-Id: I16d75c9d8fb3c61a4993fe216142e80884bc2ad1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/409576
Reviewed-by: Mike Reed <reed@google.com>
2021-05-18 01:06:08 +00:00
Kevin Lubick
5b38536d76 [canvaskit] Add tests for getGlyphIntercepts
Change-Id: I115dafccb74bdf5a61f7ed25bf97fc1cec682c1d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/409403
Reviewed-by: Mike Reed <reed@google.com>
2021-05-17 19:24:07 +00:00
Jorge Betancourt
ec978bbc4d expose canvas.localToDevice to androidKit
Change-Id: Ia6af3a06b9be078fd0b281a89fad0641082fd0ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/409336
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-05-17 18:41:20 +00:00
Mike Reed
bc7c754ce3 Expose glyphIntercepts to CK
bug: skia:12000
Change-Id: I40f130b0eab21ef4a53ee88eed8f62c4f3a577c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408899
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Yegor Jbanov <yjbanov@google.com>
2021-05-15 15:30:50 +00:00
Mike Reed
81e2f9355b Expose intercepts on SkFont
Already exposed (on TextBlob), so this makes it available for clients
that may use drawGlyphs directly. (including canvaskit/flutter)

Change-Id: I8b4bd51e13827dc3970d5a6d06f0e0d3031af13c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408638
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-05-14 14:50:42 +00:00
Florin Malita
16eead830a [skottie] Clamp OpacityEffect values
Animated opacities can yield values > 1, which trigger RenderContext
asserts.

Clamp explicitly to avoid this issue.  Also avoid allocating a new
RenderContext when the value is >= 1 (no op).

TBR=
Change-Id: I1639af7ab50f4ccf9cd79cb950f14b64dd2619ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408256
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2021-05-14 14:19:22 +00:00
Florin Malita
4c0da73206 [skottie] Text fill/stroke opacity animators
Implement support for fill and stroke opacity animators.

TBR=reed
Bug: skia:11966
Change-Id: I206c949d0fc685c63043e672f16e9c1ac35a6d53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405397
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2021-05-13 20:03:52 +00:00
Jorge Betancourt
025b914468 [androidkit] add getter for matrices
Change-Id: I0fd42b2506d794622852bd55aa4e8c2545216312
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407916
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-05-13 19:29:53 +00:00
John Stiles
154bd1f522 Avoid repeated failure messages in the dm logs.
Successful dm runs on Windows currently include this message many
thousands of times over. This pollutes the logs for no benefit.

Change-Id: I127b4588ed25d8f51ac70d0f87645bd9c28cec5a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/408057
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-05-13 17:27:45 +00:00
Jorge Betancourt
e3f8030494 [androidkit] implement ThreadedSurface backed by WindowSurface
This moves ownership of the SkSurface to ThreadedSurface::fWindowSurface.

When we pass a Message to the SurfaceThread, we will include  a pointer to ThreadedSurface.fWindowSurface so we can call:
getCanvas() to draw the SkPicture
WindowSurface's constructor so it can hold the WindowContext made during the init

To reference WindowSurface in SurfaceThread, we need to make a header for Surface.cpp (added in this cl)

Change-Id: I8c67223eee301a1b6e0d05934e1f8597cf70bc64
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404918
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-05-13 17:15:49 +00:00
Brian Osman
a5842bc903 Move SkSpan to include/, for use in public API
Change-Id: I674f038600afd6d49316c1ece515941ee5579068
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/406939
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-05-12 13:19:32 +00:00
Brian Osman
2305b7914e Use SkMakeSpan in SkShaper_harfbuzz
Fixes G3 roll

Change-Id: I0d7c3c74f793fb2c22db969fb2a6f93e39931918
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407099
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-05-11 22:33:59 +00:00
Robert Phillips
0c9962a7c8 Revert "Switching SkText to UTF16"
This reverts commit a3262aa1d2.

Reason for revert: I believe this is blocking the Flutter roll

Original change's description:
> Switching SkText to UTF16
>
> Required some changes in SkUnicode to support it
> SkShaper still works on UTF8
>
> Change-Id: I76645668e1d9bf95eb4539a066deea2b24ecf5e9
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/406360
> Reviewed-by: Julia Lavrova <jlavrova@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

TBR=bungeman@google.com,reed@google.com,jlavrova@google.com

Change-Id: I68b66dfbc4f3668a8fb765d5f557699e396cd3f5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407177
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-05-11 22:24:20 +00:00
Julia Lavrova
a3262aa1d2 Switching SkText to UTF16
Required some changes in SkUnicode to support it
SkShaper still works on UTF8

Change-Id: I76645668e1d9bf95eb4539a066deea2b24ecf5e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/406360
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-05-11 20:31:29 +00:00
Brian Osman
ae87bf1e49 Remove SkSpan class template deduction guides
This effectively reverts a80ce1a36d,
and goes back to using SkMakeSpan (which works in C++14).

Change-Id: Iaa63c86b5acaadbdd60588b0a5c703820e810770
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/406938
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-05-11 20:06:29 +00:00
Jorge Betancourt
e3934b937e [androidkit] expose lookAt, perspective, and inverse Matrix construction
Change-Id: I94de24b2e47365cd65025166d83dd8b6c8fda90a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405857
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-05-10 23:25:54 +00:00
Jorge Betancourt
c44ede6c78 [androidkit] expose minimal stroke settings to Java
Change-Id: I012aa2760ff2b39f0c21d6e235cf6731d13bfe3f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405856
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-05-10 16:33:32 +00:00
Mike Reed
1f85dd9159 Expose embolden on Font
Change-Id: I92c3b86b8cfff1a77e2a27503ec0cdc8b0cab784
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/406037
Reviewed-by: Mike Reed <reed@google.com>
2021-05-09 18:03:44 +00:00
Mike Reed
7d093d8828 Quick out-of-range fix for selections
Change-Id: I6373f9a70c6e341a39114f0bdce50a92ee745dcb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/406036
Reviewed-by: Mike Reed <reed@google.com>
2021-05-09 17:28:45 +00:00
Mike Reed
511c327de6 Sync styles when inserting/deleting text
Change-Id: I263ae85b0b229d359b865d8b8c9f4aed736b0654
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405880
Reviewed-by: Mike Reed <reed@google.com>
2021-05-09 17:00:14 +00:00
Mike Reed
686dd910dd Track non-shaping style runs
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>
2021-05-08 20:18:36 +00:00
Mike Reed
72de83df3a Manage styles in editor
Change-Id: Ifde8853a780b8406ef6b794cd458904ee0663771
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405694
Reviewed-by: Mike Reed <reed@google.com>
2021-05-07 21:17:42 +00:00
Julia Lavrova
b44d6f4099 Reland "LRU Cache requires exact float comparison"
This is a reland of 85a51865f9

Original change's description:
> LRU Cache requires exact float comparison
>
> Bug: oss-fuzz:30314
> Change-Id: Id5dccdbab2a4801e6796254a68e417dbdc0f7a4a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404780
> Commit-Queue: Julia Lavrova <jlavrova@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

Bug: oss-fuzz:30314
Change-Id: I0736a068b5b952415099f56733b6748a5a93981a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405681
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-05-07 17:50:48 +00:00
Mike Reed
cced68e42c fakeBold is gone, scaleX is in (sort of)
Change-Id: I5db9e935d0c43de92a9688baf8cb1e1f9e74e7c9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405684
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2021-05-07 17:26:25 +00:00
Jorge Betancourt
062793401d [androidkit] optimize JNI calls in AndroidKit.Matrix transformations
Note: Shouldn't add or change the Skia API, only accepts an optional z value to preScale()

Change-Id: Ic73c723ebc2b75acca1fce5395953434ef1582e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404376
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-05-07 16:17:09 +00:00
Greg Daniel
bb4bf6eaaf Revert "LRU Cache requires exact float comparison"
This reverts commit 85a51865f9.

Reason for revert: possibly causing flutter roll failure

Original change's description:
> LRU Cache requires exact float comparison
>
> Bug: oss-fuzz:30314
> Change-Id: Id5dccdbab2a4801e6796254a68e417dbdc0f7a4a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404780
> Commit-Queue: Julia Lavrova <jlavrova@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

TBR=bungeman@google.com,jlavrova@google.com

Change-Id: I2cbbcf667734145b94359be4331bbf21e299d6a0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: oss-fuzz:30314
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405576
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-05-07 12:43:39 +00:00
Mike Reed
c48c3e5d57 Try new factory for ShapedLines
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>
2021-05-06 23:01:47 +00:00
Julia Lavrova
85a51865f9 LRU Cache requires exact float comparison
Bug: oss-fuzz:30314
Change-Id: Id5dccdbab2a4801e6796254a68e417dbdc0f7a4a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404780
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-05-06 20:25:27 +00:00