Commit Graph

218 Commits

Author SHA1 Message Date
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
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
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
Kevin Lubick
7978abafee [canvaskit] Deploy 0.26.0
Change-Id: I162e82824e1447409f5dbe7e32ec892f28e1cbf5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/400296
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-04-23 12:44:52 +00:00
Kevin Lubick
4755b0b525 [canvaskit] Add TextHeightBehavior
Bug: skia:11881
Change-Id: I220f5ad43de95324172ee5b6d3d5a975a3f8a166
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/399836
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2021-04-22 18:21:44 +00:00
weiyuhuang
04c82165b1 [canvaskit] Add halfLeading to TextStyle and StrutStyle
- Add halfLeading (introduced in https://skia-review.googlesource.com/c/skia/+/394969) to canvaskit bindings

- Fix wrong initial value of fDescent

Change-Id: I01d522cd5a3761f32426038dce2ab82f24c9c529
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/398276
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2021-04-20 20:21:56 +00:00
Kevin Lubick
6e927095e1 [canvaskit] Remove isNode and saveAsPicture
This should fix https://github.com/flutter/flutter/issues/80221

Change-Id: I25e0ad58bcaad95b43cc94476af0e241e17ac244
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/397289
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-04-16 20:55:54 +00:00
Mike Reed
9983b1efd9 Expose drawGlyphs to CK
Precursor for https://skia-review.googlesource.com/c/skia/+/392837

Change-Id: I94cf555d3185e4e2689888a3ae2acf6f57a0fb65
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/396496
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-04-14 19:15:50 +00:00
Brian Osman
9be7683222 Support integer uniforms in CanvasKit runtime effects
These were added to SkRuntimeEffects, but we need to do a bit of fixup
in the CK bindings. Note that 'getUniformFloatCount' is now poorly
named, but the idea still stands: it's how many total scalar values are
required.

Bug: skia:11803
Change-Id: If464156d8e6240736e324ef833e57ba7d53f55a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/394476
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-04-09 12:42:17 +00:00
Kevin Lubick
4a84c34383 [canvaskit] Expose Strut RectHeightStyle
Bug: skia:11845
Change-Id: Ic0c0812a906bc9c71194ae8a118e04b22194dc69
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/393976
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-04-08 17:52:35 +00:00
Kevin Lubick
a40581f86d [canvaskit] Fix type definitions
Followup to https://skia-review.googlesource.com/c/skia/+/388837

There were several errors reported by
make typecheck

Change-Id: I4beb772056fff405c1cc5c4be21ef14a6901b188
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/392716
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-04-05 18:21:29 +00:00
Kevin Lubick
ca709aa82b [canvaskit] Update to 0.25.1
Built at revision 2ee4d7a7f5

Change-Id: Idfa16920b5262f75ac4db18705e8849c91f3c91d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/390407
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-03-30 18:14:07 +00:00
Mike Reed
5514431d0e Extend drawAtlas with optional sampling parameter
Change-Id: Id26f0d9ca5381da807b072c8b59745f2afd8df60
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/386860
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Yegor Jbanov <yjbanov@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-03-25 18:04:32 +00:00
Florin Malita
baab5aff09 [skottie/wasm] Plumb text properties in WASM bindings
Only text string + size for now, we can surface more if needed.

Change-Id: I4b40c1bb5e27ea5fc4ed20a1214c4eeb04bf1ca8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/382279
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-03-10 18:34:04 +00:00
Kevin Lubick
0676317b1f [canvaskit] Deploy 0.25.0
Change-Id: I1af79766e6e781b8190a3aa266fc7e8eb7d1b0df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378256
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-03-02 12:45:42 +00:00
Kevin Lubick
3b760b6fa8 [canvaskit] Add full build to npm release.
Also rename //modules/canvaskit/canvaskit to //modules/canvaskit/npm_build
to make it more clear the purpose of that folder (what we ship to
npm and stage our builds for local testing).

Bug: skia:11203
Change-Id: I4299ded97d14f4155c36798d60e88a660ce6fe6a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372392
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-02-23 14:40:43 +00:00
Kevin Lubick
3dbca47568 [canvaskit] Remove Font.measureText and Font.getWidths
This had been previously deprecated.

Bug: skia:10717
Change-Id: Ic57ed835c13cfa7812099a3ef20ed7ff5aa62f7f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371339
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2021-02-23 14:27:50 +00:00
Kevin Lubick
58605b0466 [canvaskit] Remove ShapedText API.
The Paragraph API is what should be used.

Bug: skia:10717
Change-Id: I135aff09bffae0718045b5c744f8e774e2ee1bce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371338
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2021-02-23 14:27:50 +00:00
Kevin Lubick
26f4962b3f [canvaskit] Deploy 0.24.0 to npm
Change-Id: I393da195a2754ec3355f031fb6af12de34932620
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372077
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-02-18 19:10:54 +00:00
Florin Malita
4f14135f5e [skottie/ck] Expose logs in JS API
Plumb a JS logger object, and forward errors/warnings to its methods:

  onError(err_str, json_node_str)
  onWarning(wrn_str, json_node_str)

Change-Id: I796aeb313c4a693accafe04edf80178b227ab118
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/370937
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-02-17 17:57:16 +00:00
Kevin Lubick
8172d16577 [canvaskit] Remove exposition of SkData
Change-Id: I5a7c2e30b2adc4b8947743ac82a800e96a7005b1
Bug: skia:10717
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/370879
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2021-02-17 15:47:06 +00:00
Kevin Lubick
a0fea40486 [canvaskit] Deploy 0.23.0
Change-Id: I436340f365f144c0cffc9cfb55af4199f5a4cf12
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/366397
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-02-04 19:09:15 +00:00
Brian Osman
f2f3d52ad5 Add CanvasKit bindings for SkRuntimeEffect's uniform data
Written to use the exact same names and semantics as particles.

Cq-Include-Trybots: luci.skia.skia.primary:Test-Debian10-EMCC-GCE-CPU-AVX2-wasm-Release-All-CanvasKit,Test-Debian10-EMCC-GCE-GPU-AVX2-wasm-Release-All-CanvasKit
Change-Id: I4031efbce06527a519f1ce8c261f79231554e1ef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/365701
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-02-04 17:43:28 +00:00
Kevin Lubick
70b6729a05 [canvaskit] Add error callback for runtime effect constructor
It would otherwise be difficult/tedious/not-backwards-compatible
to return the RuntimeEffect AND the error message.

Change-Id: I9bdbafb653398ccbb72e6e762ec4b6af294f9110
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/365483
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2021-02-03 17:35:23 +00:00
Kevin Lubick
e9e8e5d771 [canvaskit] Replace Postan value array with Float32Array.
Change-Id: Ie0e8a9271ef1b68551473fb9a1bcc9442f063efe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362477
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2021-02-02 15:22:07 +00:00
Kevin Lubick
d62738d094 [canvaskit] Remove deprecated PathMeasure
This will make cleaning up the PosTan value easier.

Change-Id: I13aa12f94c560bf8539aa2edb1f9e13779635692
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362458
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2021-02-02 15:22:07 +00:00
Kevin Lubick
f6040ef2a7 [canvaskit] Remove value_array for vector3
Also removes the size value_objects, which appear unused.

Change-Id: Iecfc05b6c285b981415121943b7b43e2216516cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362339
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2021-02-02 15:22:07 +00:00
Kevin Lubick
ed96264ad7 [canvaskit] Replace Point value_array with Float32Array
Using value_array (and value_object), while convenient,
adds a measurable overhead. This removes the Point value_object
and replaces it as a return value with Float32Array
(similar to rects). For inputs of a single point, I just
split it into x and y. For inputs with two points, I used
a _scratchFourFloats (formerly _scratchRect) bit of memory.

Two subtle decisions here:
 - Why not use scratch memory for a single point? The cost of
   having one extra param is a small/negligible price to pay
   for less complex code.
 - Why not accept Malloc objects? Again, simplicity. Accommodating
   Malloc would make the code harder to read and require more
   checks. I don't know if anyone wants to have malloced points;
   if they do, we can probably accommodate that.

Change-Id: I1b1c29f62e01c2f1c8c1218f58e3bad642214322
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362097
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2021-02-02 15:22:07 +00:00
Kevin Lubick
3364579f83 [canvaskit] Move matrix helpers to their own file and make optional.
Change-Id: I904a491134d5e3b19de8b7c34dcde30f1fd2487e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362037
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2021-02-01 20:01:07 +00:00
Brian Osman
383168902b Particle refactor: Only have one code string, uniforms, etc.
Leverage the field visitor to temporarily support effects with the old
JSON layout.

See also: https://skia-review.googlesource.com/c/buildbot/+/363784

Change-Id: Ifab128172089fe9e570be96d7067c6c9d25aae9b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/363878
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2021-02-01 19:29:48 +00:00
Mike Reed
99da77ae93 Pass sampling to drawImage
Bug: skia:7650
Change-Id: Ia0e02023ab65267e0be17ee1509c8562fe55d75a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362180
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-29 18:53:48 +00:00
Mike Reed
0ab283aaf2 Revert "Hide SK_SUPPORT_LEGACY_DRAWIMAGE_NOSAMPLING flag"
This reverts commit 5817fe1069.

Reason for revert: broke GifTest

Original change's description:
> Hide SK_SUPPORT_LEGACY_DRAWIMAGE_NOSAMPLING flag
>
> Bug: skia:7650
> Change-Id: I7924efdbbb957c0453c5444796dc31f0b0f7459b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361437
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>

TBR=kjlubick@google.com,reed@google.com

Change-Id: I1e6dc844b8780b332ef94234bed2e8fbdf60f8cf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7650
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362179
Reviewed-by: Mike Reed <reed@google.com>
2021-01-29 17:25:45 +00:00
Mike Reed
5817fe1069 Hide SK_SUPPORT_LEGACY_DRAWIMAGE_NOSAMPLING flag
Bug: skia:7650
Change-Id: I7924efdbbb957c0453c5444796dc31f0b0f7459b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361437
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-01-29 17:06:48 +00:00
Kevin Lubick
6de1e52d0b [canvaskit] Properly downsample 4x4 matrices.
Also address feedback from Tuesday.

Change-Id: I4497e4112c758a071c834045d20a009397184254
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356837
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2021-01-21 18:14:04 +00:00
Kevin Lubick
cbaea295f5 [canvaskit] Expose getShadowLocalBounds
Bug: skia:11146
Change-Id: Ib08a96c8d0ca0f4ca2b489b3793e45f642cb231f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353034
Reviewed-by: Yegor Jbanov <yjbanov@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2021-01-13 20:24:26 +00:00
Brian Salomon
4878b3e33c Remove Improved Perlin Noise
Is not used by a major client and can be implemented using runtime
effects for users who want this noise.

Bug: skia:10536
Change-Id: Iaa06e6e1406b808c7f8dc0f76621fecf2becabf5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/352057
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-01-11 15:27:26 +00:00
Kevin Lubick
5779a86072 [canvaskit] Add docs and example for flags
Change-Id: I9ad8a591b9f9dc5c454bfa30405244e49ad6b593
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350816
Reviewed-by: Yegor Jbanov <yjbanov@google.com>
2021-01-07 16:38:58 +00:00
Kevin Lubick
70019c6085 [canvaskit] Fix bug if webgl context not available
Bug: skia:11107
Change-Id: Ibf697a2c0b471ea79bee1a33d8230086509147ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347677
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-12-28 14:47:43 +00:00
Kevin Lubick
81da68af2e [canvaskit] Update to 0.22.0
We also include the CHANGELOG in the release notes.

Change-Id: Icbdedf124c114c2f4be757f408a437fda71c40ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345288
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-12-17 15:10:15 +00:00
Kevin Lubick
2d6334988b [canvaskit] Modify drawImageNine API to handle Filter quality
Bug: skia:11099
Change-Id: Ia019bd5107d5646d6e314876610ecdeb37004e36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345277
Reviewed-by: Mike Reed <reed@google.com>
2020-12-17 14:58:58 +00:00
Kevin Lubick
72f407636e [canvaskit] Expose sampling variants of drawImage and drawImageRect
Change-Id: I91f40374de1861385bddb977917f2e7a24fb6a27
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345130
Reviewed-by: Mike Reed <reed@google.com>
2020-12-16 21:19:58 +00:00
Kevin Lubick
b9a818471d [canvaskit] Update to 0.21.0
Change-Id: Id093d3026bdb406b66374839820ae44a7696a981
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345096
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-12-16 17:44:47 +00:00
Kevin Lubick
5df97bb89b [canvaskit] Replace core build with profile build in npm
Change-Id: I22cbaf1ee6469444e0a272d8d894ccbccdcbd24c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343997
Reviewed-by: Yegor Jbanov <yjbanov@google.com>
2020-12-14 17:46:02 +00:00
Kevin Lubick
035cd91cfb [canvaskit] Update to emsdk 2.0.10
(also update pathkit).

Bug: skia:11077
Change-Id: I7d06e05ed8f445313bedee055af5ded79c7b40b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343505
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-12-14 15:27:28 +00:00
Kevin Lubick
652d790355 [canvaskit] Remove filterquality on paint.
Bug: skia:7650
Change-Id: I16c7940b4bc0be100a45ea983e0a684416363976
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343441
Reviewed-by: Mike Reed <reed@google.com>
2020-12-11 20:27:27 +00:00
Kevin Lubick
f7fdf1aa29 [canvaskit] Add API for deleting webgl ctx
Change-Id: I55e70cc1ae6b16d642dd63170e9402bd3c192d5f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343101
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-12-11 12:29:17 +00:00
Kevin Lubick
f3b959c000 [canvaskit] Respect Exif metadata for animated images.
Change-Id: I58a5095ea3314a21d895f34a4b8cab9484c29b1d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340717
Reviewed-by: Leon Scroggins <scroggo@google.com>
2020-12-07 11:10:07 +00:00
Kevin Lubick
e7c1a731ff [canvaskit] Remove 2d point arrays from API.
I kept in an array of Color (Float32Array) because it's very convenient
and not worth the hassle of removing.

Change-Id: I34c430c2b5112b6d073b049a81994e946428f21c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340797
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-12-07 11:09:49 +00:00
Kevin Lubick
658cb7173a [canvaskit] Fix drawPoints to be flattened point array
Bug: skia:11012
Change-Id: I0866f791f6fba82d073b5b5acd37aa8509b6fdef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339836
Reviewed-by: Yegor Jbanov <yjbanov@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-12-02 15:07:57 +00:00
Kevin Lubick
ae0d3ffe6d [canvaskit] Document and tweak MakeImage API
Change-Id: I84b8bc8b84e0b79ea4a8a6b53bb3358e0ec9c138
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335665
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-11-18 17:43:56 +00:00