Commit Graph

1972 Commits

Author SHA1 Message Date
Kevin Lubick
06acd1d194 [canvaskit] Fix MakeRenderTarget
Change-Id: I86c296ff2dad8f915e75dd71301cf43f36ce6e00
Bug: skia:12862
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/500438
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2022-02-01 15:42:37 +00:00
Kevin Lubick
aa2579cce0 [canvaskit] Include WebP and JPEG encoding in npm version
Change-Id: I3086129d6fd7e3505a93bf8157b55ad2c5096902
Bug: skia:12853
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/500376
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2022-02-01 15:42:37 +00:00
Julia Lavrova
24a8aa9d1f Updating the API description for Flutter
bug: skia:12850
Change-Id: I78148b2d99701a9127c377ddf709c89a885fcfc2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502312
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2022-02-01 15:36:41 +00:00
Kevin Lubick
102dbf9c43 [canvaskit] Disable dynamic execution
This required an update to emscripten, due to there being
a few bug fixes regarding the non-dynamic code and the
Closure compiler/minifier.

Change-Id: Icc922bd98cdd52a6923a9367da3747dac2b897b3
Bug: skia:12795
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/492916
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2022-02-01 13:15:22 +00:00
John Stiles
9ac97cf56d Undo various C++14 compatibility fixes.
This CL rolls back various changes from http://review.skia.org/457298
which made the code longer or more complex. They are no longer needed
now that we compile in C++17 mode.

A few changes were left as-is because they seemed equally good either
way.

Change-Id: I4eb0fe3d12382bcb485abb5222a0f00411742191
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502296
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-01-31 16:55:20 +00:00
Kevin Lubick
994c946bd3 [canvaskit] Add API to re-use Image textures and reduce flickering
This creates a new SkImage with the same texture and changes it
out without the user noticing (or needing to delete the old Image).

Change-Id: I3a1ce6d4a335873f2b7670d56dadfccdc7881c38
Bug: skia:12723
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/495556
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2022-01-31 14:00:48 +00:00
John Stiles
952bcb0732 Re-enable SkSL tests in CanvasKit/wasm.
We can disable SkSL tests on a case-by-case basis via the skip list in
`run-wasm-gm-tests.html`. This doesn't allow us to exclude by GPU, but
in practice the Golo machines tend to all have a uniform setup (with
Quadro P400s) so we can just work around failures as they come up.

Change-Id: I46f709691282e576d00d5191e9dbd46b740e4a5f
Bug: skia:12876
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501682
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-01-28 16:22:33 +00:00
John Stiles
d50db53f37 Disable SkSLTest on wasm.
Only one SkSL test is broken at the moment, but I don't have fine-
grained controls for test disables in wasm.

Change-Id: Ic44b4d6d660d4cb382d18cccf07574318b982d5a
Bug: skia:12876
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501438
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-01-27 21:56:18 +00:00
John Stiles
f07421bcbd Remove unnecessary ctors now that we have C++17 copy-elision.
This CL backs out C++14 compatibility changes from
http://review.skia.org/457298 :

"2. Lack of C++17 copy elision means classes of objects constructed at
function return need a copy or move constructor even if RVO will mean it
isn't called."

Change-Id: I33a833d33b221e757bf6a6459835a7215b4e6b66
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501240
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-01-27 20:26:54 +00:00
Florin Malita
e3ecc34f01 [skottie] Fix text error logging
Don't clear the logger until we actually see some errors.

Change-Id: I275e99a6f2748dff1456a471daabb142fd1a10f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/500996
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2022-01-27 16:06:41 +00:00
Kevin Lubick
c4b2fb39b1 [canvaskit] Use proper texture tracking method
The emscripten generated GL texture tracking code uses an
integer, not the length of the textures array.
a8e7d3b8f2/src/library_webgl.js (L242)
I believe this is to make sure a texture and buffer do
not share the same handle.

Therefore, we must use this method when making our own
additions to the textures array, otherwise Skia-created
textures will overlap with supplied textures, causing
mis-drawings and feedback loops.

Change-Id: I4e1be5ff2b0c3d1ba5f5984232980724cb492313
Bug: skia:12797
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/495416
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2022-01-26 19:53:05 +00:00
Justin Novosad
cec7f5dec5 Add willReadFrequently 2d context creation attribute where appropriate.
This change add the willReadFrequently HTML canvas 2d context creation
attribute in cases where we know the canvas is used for readbacks.

See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently

The API will soon be launched in chromium-based browsers.

The objective of this change is to optimize performance and avoid
possible performance regressions when the new API feature goes live
in major browsers.

Change-Id: If0b54d2d2243db4e9ac6d685d793ab2008973b8c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496881
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-01-26 15:31:39 +00:00
dependabot[bot]
1d9471f553 Bump follow-redirects from 1.13.0 to 1.14.7 in /modules/pathkit
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.13.0 to 1.14.7.
<details>
<summary>Commits</summary>
<ul>
<li><a href="2ede36d7c6"><code>2ede36d</code></a> Release version 1.14.7 of the npm package.</li>
<li><a href="8b347cbcef"><code>8b347cb</code></a> Drop Cookie header across domains.</li>
<li><a href="6f5029ae1a"><code>6f5029a</code></a> Release version 1.14.6 of the npm package.</li>
<li><a href="af706bee57"><code>af706be</code></a> Ignore null headers.</li>
<li><a href="d01ab7a5c5"><code>d01ab7a</code></a> Release version 1.14.5 of the npm package.</li>
<li><a href="40052ea8aa"><code>40052ea</code></a> Make compatible with Node 17.</li>
<li><a href="86f7572f93"><code>86f7572</code></a> Fix: clear internal timer on request abort to avoid leakage</li>
<li><a href="2e1eaf0218"><code>2e1eaf0</code></a> Keep Authorization header on subdomain redirects.</li>
<li><a href="2ad9e82b62"><code>2ad9e82</code></a> Carry over Host header on relative redirects (<a href="https://github-redirect.dependabot.com/follow-redirects/follow-redirects/issues/172">#172</a>)</li>
<li><a href="77e2a581e1"><code>77e2a58</code></a> Release version 1.14.4 of the npm package.</li>
<li>Additional commits viewable in <a href="https://github.com/follow-redirects/follow-redirects/compare/v1.13.0...v1.14.7">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=follow-redirects&package-manager=npm_and_yarn&previous-version=1.13.0&new-version=1.14.7)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/google/skia/network/alerts).

</details>

This is an imported pull request from
https://github.com/google/skia/pull/90

GitOrigin-RevId: ccf8ab9b6586a37a3f0d6493f53f3b41b92df8a4
Change-Id: Ib65fd507953eaf3bf880b508586856cb51e7f01b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/495616
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2022-01-26 14:01:50 +00:00
Dan Field
dc17274403 ParagraphBuilder::Reset
Allow callers to reset the ParagraphBuilder to an initial state for
reuse and caching.

Bug: https://github.com/flutter/flutter/issues/97182
Change-Id: Ifc80bdd53a1c68d4bfe355c74bbefa27b1d2d7de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/499236
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Dan Field <dnfield@google.com>
2022-01-25 19:24:40 +00:00
Florin Malita
1a9e7531e0 [skottie] Fix text opacity animator semantics
The current implementation uses multiplicative composition for opacity
animators (modulate_opacity always scales the new opacity by the old
value).  That means that if one animator drops opacity all the way to
zero, there is no way for subsequent animators to increase opacity.

Instead, AE seems to use the same interpolation as for colors
(prev value/animator value, based on modulation param).

Update to use similar interpolation for opacity properties, and also
to only apply when opacity props are actually specified for a given
animator.

Change-Id: I5a96f9e3722399c8ec661a7843c86dfa60eac5ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/499376
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2022-01-25 17:58:15 +00:00
Ben Wagner
83c85affad Avoid calling hb_face_set_index with uninitialized value.
If an SkTypeface stream exists and is a memory based stream an hb_face
may be created directly from the memory. In this case the collection
index was set when the stream was retrieved and the hb_face is created
with this index. Otherwise, the hb_face is created by table callback. In
this case the stream may or may not have been successfully retrieved. If
the stream was successfully retrieved the hb_face index should be set to
the collection index retrieved with the stream. Otherwise, the hb_face
index should not be set.

Change-Id: I2568fecb1096d1a2e7f529342668ea443a8615c9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/499136
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-01-25 14:15:37 +00:00
Brian Osman
a1fd1c189c Mark operator bool() explicit in src, tests, and modules
Change-Id: Ic664ad0134d61dcf939dcf585a81d53e29c6afcc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/496597
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
2022-01-19 15:10:45 +00:00
John Stiles
cabc3f5209 Fix Typescript type hints for CanvasKit debug traces.
The tests for these methods are only handled in Javascript, so the type
mismatches weren't detected until I tried using the calls in Typescript
later.

Change-Id: Ifb233f871be1146d3f059b166b7de40bb401d4c9
Bug: skia:12818
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/495417
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-01-14 17:13:49 +00:00
John Stiles
575d0c5e1d Add CanvasKit bindings for RuntimeShader.MakeTraced.
To save space, debug trace bindings can be disabled by turning off
SK_INCLUDE_SKSL_TRACE. Most clients shouldn't need them.

Change-Id: Ifadc05b3eeed95def334fa7e0755f61caeef27f0
Bug: skia:12818
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/494244
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-01-13 14:08:54 +00:00
Kevin Lubick
6e63f4925e [bazel] Use font manager in HelloWorld.
This documents the various factory settings (I kept getting
confused as to what each was doing).

Additionally, this makes setting the factory flag bring in
the dependent code as well (like our current GN rules do).

Change-Id: I93437651b078baac04433c14c573a95982b7bc15
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/493396
Reviewed-by: Ben Wagner <bungeman@google.com>
2022-01-11 16:22:52 +00:00
Florin Malita
3e1354a592 [skottie] Fix assert for missing layer type
When the layer type is missing, fType == -1 and we rely on unsigned
(size_t) underflow + check against the known types array size to catch
the condition.

The problem is SkToSizeT() itself asserts the input is a valid size_t,
and even if it didn't clusterfuzz would likely complain about
underflowing.

Refactor to check for negative values explicitly.

Bug: b/200660146
Change-Id: Iae74dca14ac0202ffcdd4449f0d470063916eff5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/493116
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2022-01-10 18:52:39 +00:00
Florin Malita
dd575bc0f1 [skottie] Fix float->int overflow
We do test for and catch int overflows, but after casting -- which is
enough to trip clusterfuzz.

Refactor to catch upfront.

Bug: b/200722666
Bug: b/200663331
Bug: b/200662108
Change-Id: I26da4b1ca21ad0bc34384e957a30211402219841
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/493018
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2022-01-10 15:46:52 +00:00
Kevin Lubick
048545d249 Set up basic hello world sk_app
Change-Id: I233e7653eadcce87067def841b2f28c700f96045
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/492096
Reviewed-by: Brian Salomon <bsalomon@google.com>
2022-01-06 20:29:35 +00:00
Julia Lavrova
85a7045856 Fixing some getRectsForRange issues
This fix only affects 2 very specific cases used for text selection
in Flutter (via getRectsForRange).

bug: skia:12785
Change-Id: I22d141210d129d78ed028592162fef02b9120292
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491450
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2022-01-06 18:53:23 +00:00
Kevin Lubick
96e4053be7 Update Bazel files
- Use latest emscripten toolchain (3.1.0)
 - Autogenerate the atoms and manually fix some of the file lists.
 - Add a known_good_builds target to bazel/Makefile to help
   check the things we expect to work with Bazel.

Change-Id: Ia5f51e7b9eb5c108386820ad59180c8f862f5a70
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491438
Reviewed-by: Ben Wagner <bungeman@google.com>
2022-01-06 18:10:57 +00:00
Jason Simmons
67dd028ae0 Avoid scanning for bidi levels if the paragraph is unidirectional
Change-Id: I789efe0d6992d637ec688a9a841ece89738dd6d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/486336
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2022-01-06 17:39:50 +00:00
Jason Simmons
53bf2fa77a Remove obsolete SkBidiIterator_icu::getBidiRegions method
Change-Id: I9afbb79d6538f40d4f1fe06d91b7d5790124bfe5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/487478
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2022-01-05 17:31:54 +00:00
Lei Zhang
7f99e8d824 Remove SkM44.h include from SkImage.h.
It is not needed there. Add it to files that do need it instead.

Change-Id: I2fa32d423972c4c91c4fbfe5508bd50323201714
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463556
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Auto-Submit: Lei Zhang <thestig@chromium.org>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-12-23 13:45:20 +00:00
Brian Osman
1ba283e6b4 In GPU CanvasKit, default to sRGB surfaces
Change-Id: I1931b09e6a4a52fb7d91a0d3f013e1d0519919dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/487977
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-12-22 18:13:49 +00:00
Kevin Lubick
16a06174df [canvaskit] Release 0.32.0
Change-Id: Ic9f345a37f409108c4c4252b3d2d0c8b6255a78a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/485156
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2021-12-15 18:05:58 +00:00
Kevin Lubick
68a364c9bc [canvaskit] Reset GrContext after lazy-loading image from texture
The issue was Skia would be in the middle of drawing when it
needed to lazy-load the image's texture. This would mess up the
bound texture in WebGL, but Skia didn't know that. As a result,
it would not realize that some of the work had been undone.

Calling resetContext() makes Skia aware of this fact, so it can
adjust its behavior.

Change-Id: I5e62987546be8d63d13c906dfab3bc92cf3120cd
Bug: skia:12740
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/485016
Reviewed-by: Brian Osman <brianosman@google.com>
2021-12-15 15:11:41 +00:00
Jorge Betancourt
68e240d9cd add sharpen effect support to skottie player
Change-Id: I3242897c00b3cbe84c5ec964831df0fd4ae45622
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/481556
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-12-14 19:44:26 +00:00
Jason Simmons
ddbf93159f Move Run per-glyph data into an object held in a shared_ptr
This will reduce memcpy overhead when runs are copied into a paragraph
or when paragraph cache entries are read or written

Change-Id: Id81725f3d8fc70daa17d154093ae7bc8b519118c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/483022
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2021-12-13 22:24:30 +00:00
Brian Osman
3695bdb587 Refactor SkMatrixProvider slightly
There was only one virtual method, so switch that to a bool stored in
the base class. The derived types exist as hints for the reader, and an
easy way to adjust how the new localToDevice is constructed.

With this change, we don't need SkSimpleMatrixProvider. SkMatrixProvider
is concrete, so we can use it directly. SkOverrideDeviceMatrixProvider
no longer needs the original provider for anything, so remove that
parameter. It now exists solely to inhibit the hitsPixelCenters flag.

Fix a few spots (SkParticleBinding, some sites in SkRuntimeEffect) where
we used SkSimpleMatrixProvider, even though the local coordinates being
passed did not obey the hits-pixel-centers constraints.

Most importantly, document how localToDeviceHitsPixelCenters works.

Change-Id: Ibe9060bac0822d0edf52a507d390bd198d8e6dbd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482176
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-12-09 20:10:58 +00:00
Jorge Betancourt
27db7e6e2a move duplicate code to common SkSLEffectBase class
Change-Id: I9f4100bdb09a2fc0e940c007bf5cca0edec24e7c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/480429
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-12-09 19:45:35 +00:00
Jason Simmons
d8e29e09c8 Call SkFont::getBounds once per run in ShaperHarfBuzz::shape
Change-Id: Ie5d4ff977d5952423f5679387fae98d377489c0d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/481796
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-12-09 19:37:03 +00:00
Kevin Lubick
44c81d1492 [canvaskit] Add frame duration and docs
Also clean up some more findMarkedCTM references.

Change-Id: I29a52e1157691c86992e70a3774b984e5383e3ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482005
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Yegor Jbanov <yjbanov@google.com>
2021-12-09 18:53:23 +00:00
Brian Osman
ca916f705f Remove canvas marker stack, marked matrices, etc...
This entire API existed, but was unused (no longer connected to
drawVertices or runtime effects).

In theory, we could further simplify some of the matrix providers, but
more importantly - I have serious doubts about the correctness of
localToDeviceHitsPixelsCenters for most of them.

Change-Id: If5af182015dd96e5ed3353a117223e8dbbe17097
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/481683
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-12-09 16:22:16 +00:00
Kevin Lubick
5d1d92c505 [canvaskit] Add rough measureText to Canvas2D emulation layer
I wanted to use SkParagraph myself, but the API is a little
awkward right now in that I cannot just pass in a SkFont object
(which I have) - I would have to make a FontCollection, which
we lack the ability to do so.

Change-Id: I1488fb9c1a42af020a245a792b8e266c809b599a
Bug: skia:12705
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/481238
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2021-12-09 13:07:24 +00:00
Jason Simmons
c307c5566d Efficiency improvements to SkParagraph ParagraphCacheKey
* Compute and store the hash in the ParagraphCacheKey ctor
* Move the ParagraphCacheKey into the ParagraphCacheValue during construction

Change-Id: If267fe6757c6a6bf7528f4dcc838e88f5458946f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/481239
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2021-12-08 18:55:59 +00:00
Kevin Lubick
58a768b68f [canvaskit] Fix test search path
Change-Id: Ifb7a4191d43d1875da945a5f3af2d1bed62ee915
Bug: skia:12715
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/480236
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2021-12-07 19:43:27 +00:00
Gregg Tavares
5f9ec39daf Wrap SkImage into HTMLImage
Canvas-wasm says it's a drop in replacement for the Canvas API.
Unfortunately HTMLCanvas.decodeImage returns an SkImage which
has functions width() and height() for getting the width and height
of an image whereas HTMLImageElement has properties width and height.

Lots of existing code uses width and height so wrapping this
would seem to make it more closely match expectations.

Bug: skia:12705
Change-Id: I62c4f655c58f6806e836700e03b946a91f3e518d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/479936
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-12-06 20:05:42 +00:00
John Stiles
dfc7f31bd1 Create a public base class for debug traces.
SkRuntimeEffect needs an API for generating debug traces. This means
that we will need references to debug traces inside a public header.
Rather than reference SkVMDebugInfo directly, we now have a simpler
base class for debug traces. This is better suited to landing in
include/.

I've also renamed SkVMDebugInfo to SkVMDebugTrace for consistency, since
it now contains all the trace data. (When it was first added, it only
had the slot info.)

Change-Id: Ibaa4dedf9a17b9462b4f233a28a7b875d0317892
Bug: skia:12708
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/480356
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-12-06 18:22:51 +00:00
Kevin Lubick
aef2b63743 [canvaskit] Use closure in release Bazel builds
We don't need to use the env variable EMCC_CLOSURE_ARGS,
as per https://github.com/emscripten-core/emsdk/pull/941

We can use --closure-args to pass the externs file in
instead, which is much easier to configure.

Change-Id: I2dcfbca6307438e76fb374741bb6b33ef296be15
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478307
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-12-01 15:59:41 +00:00
Kevin Lubick
4bd08c52c0 [infra] Add SkParagraph (harfbuzz, ICU) to Canvaskit Bazel build.
As a follow-up to https://skia-review.googlesource.com/c/skia/+/476219,
this sketches out how we can maybe use cc_library for the things
in //modules to make sure something in //src doesn't depend on
anything in //modules, for example.

The following succeeds:
bazel build //modules/skparagraph:skparagraph --config=clang \
  --shaper_backend=harfbuzz_shaper --with_icu

As does `make bazel_canvaskit_debug` in //modules/canvaskit

Suggested Review Order:
 - third_party/BUILD.bazel for ICU and harfbuzz rules. Pay
   special attention to the genrules used to call the python
   script for turning the icu .dat file into .S or .cpp.
 - bazelrc and bazel/ for new flags and defines that control
   use of ICU and harfbuzz. Unlike GN, with the public_defines
   that get added in automatically if icu or harfbuzz is
   depended upon, we need to set the defines at the top level.
   This necessity might go away if we change the atoms to
   depend on //modules/skshaper, which could define that flag.
 - Top level BUILD.bazel files in //modules/skparagraph,
   //modules/skshaper, //modules/skunicode, //modules/canvaskit
 - All other .bazel file changes are automatic.

Bug: skia:12541
Change-Id: I38a9e0a9261d7e142eeb271c2ddb23f362f91473
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/478116
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-30 21:01:06 +00:00
Kevin Lubick
6ba9f702ba [bazel] Try adding cc_binary rules that use generated rules
To make the atomic rules a bit easier to work with, in many
of the folders, this adds in cc_library rules to group
together the sources from that folder (and subfolders
where prudent). We only needs sources because those atoms
should have their headers as deps.

One issue that was pointed out is that there is currently
no way to restrict the inclusion of certain packages,
a la, `gn check`. For example, there is no mechanism from
stopping a dev from adding
#include "modules/canvaskit/WasmCommon.h"
to something in //src/core (except circular dependencies).
We can probably address that using Bazel's visibility
rules as needed:
https://docs.bazel.build/versions/main/visibility.html
https://docs.bazel.build/versions/main/be/functions.html#package_group

It is recommended to look at this CL patchset by patchset.
PS1: Update gazelle command to generate rules in more folders.
PS2: A few changes to make generation work better.
PS3: The result of running make generate in //bazel
PS4: Adding the rules to build sksllex, the simplest binary I
     could find in the Skia repo.
PS5: Adding the rules to build skdiff, a more complex binary.
     I tried a few approaches, but ended up gravitating back
     towards the layout where we have each folder/package
     group up the sources. I imagine at some point, we'll have
     skdiff depend on skia_core or something, which will
     have things like //src/core, //src/codecs, //src/pathops
     all bundled together.
PS7: Added in the groupings of sources, similar to what we had
     earlier. I liked these for readability. These helped fix
     up the //:skia_core build, and by extension, the CanvasKit
     build.

Change-Id: I3faa7c4e821c876b243617aacf0246efa524cbde
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/476219
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-30 18:18:53 +00:00
Florin Malita
15949beef2 [skottie] Fix mask feather tiling
We currently default to kClamp, but for mask feathers we want kDecal.

Bug: skia:12676
Change-Id: I7e3e21c310823987819e7374b494de4a48d9cae6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/477297
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-11-29 22:50:06 +00:00
Kevin Lubick
37a489c3a4 [canvaskit] Fix examples and tests of drawPatch and drawVertices
Change-Id: Iab8c085fad220930b838a281834a402f8d96c2af
Bug: skia:12662
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/477437
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-11-29 18:54:52 +00:00
Kevin Lubick
9488e0237d [infra] Experiment generating BUILD.bazel files
This uses the gazelle extension from
https://skia-review.googlesource.com/c/buildbot/+/473357

Review Tips:
 - Ignore any changes to .h or .cpp files. Those have been
   pulled out into their own CLs.
 - Start with bazel/macros.bzl.
 - Read the CL with the generation code, if you haven't already.
 - Look at third_party/file_map_for_bazel.json.
 - See experimental/bazel_test for an idea of how a cc_binary
   would be made.
 - Spot check one or two of the BUILD.bazel files.

This CL generates the "atomic" rules for src/, include/ and
modules/skshaper, as a starting point.

`bazel build --config clang //include/...` works

`bazel build --config clang //src/...` starts compiling,
(which verifies that the BUILD.bazel files are all valid),
but runs into errors because not all third_party deps have
been resolved, and there are some files missing from the
toolchain still (e.g. EGL headers).

Change-Id: Ib7e0fb0efdb9f08655f06cbc56e9bb4cf416294b
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474240
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-23 18:53:16 +00:00
Jorge Betancourt
1bbc6e5cef add plumbing for color filter SkSL effect
Change-Id: I26b28ff4756cda921e4acef32f3da3b43b1fc28f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/472936
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-11-23 16:30:40 +00:00
Jim Van Verth
3b0eacc6ea Add SkSL::ShaderCaps and use as base class for GrShaderCaps
Bug: skia:12559
Change-Id: I76b225c9ca81264a15869324007d774d210053b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473416
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-11-19 16:35:39 +00:00
Kevin Lubick
f3726c61d2 [infra] Use Bazel transitions to allow cc_binary to set their own flags
This will hopefully let us pre-package certain binaries (e.g. DM,
fuzz) with more sensible defaults and not make the developer
type out all the settings.

For CanvasKit, which specifies its own build flags, I think I'll
need to make another transition setup, which would go in something
like modules/canvaskit/ck_binary_with_flags.bzl or something.

Some sausage-case-names were converted to snake_case_names as per
go/build-style#target-naming

The example this is based off is worth a look through before
diving into this:
https://github.com/bazelbuild/examples/tree/main/rules/starlark_configurations/cc_binary_selectable_copts


Change-Id: Ia919d47f4d1aa25cf294af7918e36d38838c179e
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/472688
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-18 19:18:54 +00:00
Jorge Betancourt
3868636fb8 discard SkRuntimeEffect builder in SkSLEffect to use lower level API
Change-Id: I20bb5e6463e79bcdd56fd614d9936fdaf65aefcc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/471776
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2021-11-17 15:51:38 +00:00
Kevin Lubick
cf1e959c65 [canvaskit] Expand Bazel rules to include Canvas2D compat layer
Importantly, this adds options for encoding using
certain codecs, not just decoding.

Change-Id: I4a610ebf985b67d4545c71b3f3eed4c7807e6a26
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/472277
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-17 13:06:35 +00:00
Kevin Lubick
888d4efa77 [canvaskit] Add Freetype/Fonts to Bazel Build
This re-works src/ports/BUILD.bazel to work like our other
BUILD files, i.e. one rule "srcs" that brings in the necessary
private filegroups.

To work around an abort with LLVM [1], we have to go back to an
earlier version of emscripten (temporarily?).

Future work should look at using transitions [2] to allow various
executables (e.g. CanvasKit, DM) to set their own set of Bazel
flags, w/o the build invokers having to specify them.

These transitions might be able to handle more complex cases
that we currently use if statements in GN to deal with.

The Freetype build rule was created by taking the BUILD.gn
rule, adding in all the sources listed there and then playing
compile-whack-a-mole to add in all the headers and included
.c files.

Suggested Review Order:
 - third_party/BUILD.bazel to see freetype build rules
 - bazel/common_config_settings/ to see treatment of fontmgr
   like codecs (many possible) and fontmgr_factory (only one).
 - src/ports/BUILD.bazel
 - BUILD.bazel
 - modules/canvaskit/BUILD.bazel. Take note of the gen_rule that
   calls tools/embed_resources.py to produce the .cpp file
   containing the embedded font data.
 - Everything else.

[1] https://github.com/emscripten-core/emscripten/issues/15528
[2] https://github.com/bazelbuild/examples/tree/main/rules/starlark_configurations/cc_binary_selectable_copts
Bug: skia:12541
Change-Id: I08dab82a901d80507007b354ca20cbfad2c2388f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/471636
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-17 13:06:35 +00:00
Julia Lavrova
8a4ba51fa7 Flutter RTL/LTR positioning fix
Bug: skia:12647
Change-Id: I7de8931183c3ed9ae82864ed766fff9a196e856c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/471777
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-11-16 20:23:05 +00:00
Kevin Lubick
350d46daac [canvaskit] Deploy 0.31.0
Change-Id: I93c9bafae99b116a8efb012e3a82c000843d8eb9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/472380
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2021-11-16 18:44:05 +00:00
Kevin Lubick
ef3d6af042 [infra] Add POC Bazel rules for CanvasKit
Many things are not enabled currently (e.g. Skottie, Paragraph),
but we can render many APIs using WebGL.

To turn on Paragraph, etc, we'll need to tackle fonts, which
is a separate effort.

This also changes where the build artifacts go. ./build/ is
easier to deal with than the old way of sticking them in
./npm_build/bin

Change-Id: Ia377360af580a887d03630670438fea2e3157e90
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/470682
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-11-12 21:38:46 +00:00
Kevin Lubick
799abb7bb8 [canvaskit] Set unsupported WebGL caps to false
The defaults were true for these, but if there was no
support, they should be set to false.

This was causing some warnings from the console, like:
WebGL: INVALID_ENUM: enable: invalid capability

Change-Id: I53b6120c969174a9ecd6d47df001870c71231352
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/470737
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-11-12 18:04:03 +00:00
Kevin Lubick
e393e72484 [canvaskit] Add ImageInfo to Texture APIs
Change-Id: Ib030c1ab47a1d1338518815915a5f59e7f9d606c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/470736
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-11-12 18:03:38 +00:00
John Stiles
6df1871cc2 Replace fSkVMDebugTrace program setting with SkVMDebugInfo.
When calling ProgramToSkVM, you can now pass in a pointer to an
SkVMDebugInfo struct. Passing in this pointer now enables trace opcodes,
removing the need for a dedicated `fSkVMDebugTrace` flag.

In this CL, the struct is empty, but in followup CLs it will contain
mapping tables that can be used to translate trace instructions into
human-readable results (e.g. slot numbers to variable names).

Change-Id: I6b38ec559723babed1f6d2efc4c5c2579c3b99db
Bug: skia:12614
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/470398
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-11-12 14:13:14 +00:00
Kevin Lubick
8ed49ea6e3 [infra] Add Bazel rules for codecs.
This ports the third_party BUILD.gn files related to codecs
(with a best-effort on arm/SIMD stuff). This includes:
 - libpng
 - libjpeg-turbo
 - libwebp
 - wuffs (gif)
 - libgifcodec
 - dng_sdk and piex (raw codec)

This expands the string_flag_with_values macro to allow
multiple values to be set at once. This was added in Bazel 5.0.0,
however the latest pre-release version of that has a bug [1]
which slows down compilation dramatically. This was fixed at
ToT, but not released. As a result, I started using the Bazel
6 pre-release (via bazelisk).

The macro select_multi makes writing select() where multiple
elements could be on possible/easier.

One can try compiling certain codecs by running:
bazel build :skia-core --config clang --include_codec=raw_codec --include_codec=png_codec

Suggested Review Order:
 - bazel/macros.bzl
 - bazel/common_config_settings/defs.bzl and its BUILD.bazel
   to see how the codec options are defined.
 - BUILD.bazel to see how the codec settings are used.
 - src/codec/BUILD.bazel to see the inclusion of Skia files to
   deal with specific codecs.
 - third_party/BUILD.bazel (while referencing the corresponding
   BUILD.gn files, such as third_party/libwebp/BUILD.gn)
 - Everything else.

Change-Id: I797375a35fa345d9835e7b2a2ab23371c45953c3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469456
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2021-11-11 20:10:01 +00:00
Kevin Lubick
cb94b57ad2 [canvaskit] Add ability to make texture image across surfaces.
Change-Id: Ie82e8257c9f0990d3be99a2429e034ac400b9580
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469759
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-11-11 17:32:30 +00:00
Brian Salomon
384ba65b8d Remove GPU V2
Replaced by Graphite.

Change-Id: Iac0ba212b078904a591677c9ce839a90562d0240
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/470305
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-11-11 17:11:19 +00:00
Brian Osman
a583a0fdcc In SkRuntimeEffect, replace ConstIterable with SkSpan
Change-Id: Ibeea56ebd5dce53af1252ca3ecf6cc6f010bd461
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469902
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-11-10 21:09:58 +00:00
Kevin Lubick
0c23120abd [canvaskit] Switch to appropriate WebGL Context for Surface methods
Change-Id: Id829603bafb73d2256e44a9101b4b1669b735e12
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469534
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-11-10 13:49:24 +00:00
Kevin Lubick
1f8c31b101 [infra] Add initial Bazel rules and files
These rules can be used to build our GMs on WASM+WebGL and
libskia.a with just the CPU backend (and most other features
turned off).

This can be done with the following commands:
  - bazel build //modules/canvaskit:gm-bindings-wasm --gpu_backend=gl_backend --with_gl_standard=webgl_standard
  - bazel build :skia-core --config clang

This pivots slightly from http://review.skia.org/463517
by using config_settings [1] instead of platforms for
the optional features that we control. This pivot was
suggested in [2]

We have BUILD.bazel files in many of the subdirectories
that specify filegroups for the appropriate files. In
an effort to make //BUILD.bazel more readable, it is
the responsibility of these subfolders to deal with
conditionally including certain .h or .cpp files.
This is done using select statements and config_settings
or platform constraints as necessary.

For example, src/gpu/BUILD.bazel will different private
filegroups for each of the supported gpu backends [3]
and a more-visible filegroup called "srcs" that has
the right selection of the private files to be used
for compilation.

An effort has been made to avoid using glob() in our
BUILD.bazel files. These file lists were made by using
`ls -1` and some regex to add in quotes. We might want
to make a helper script to assist with that, if necessary.

To specify which options we have, the settings in
//bazel/common_config_settings/BUILD.bazel have been
redesigned. They make use of a macro `string_flag_with_values`
that removes the boilerplate. Patchset 36 shows what the
file looks like w/o the macro.

The top level BUILD.bazel file will still need to use
some logic to handle defines, because local_defines is
a list of strings, not a list of labels [4].

Suggested Review Order:
  - WORKSPACE.bazel to see the new dependencies on the
    emsdk toolchain and bazel_skylib
  - bazel/common_config_settings/* to see the few settings
    defined (we have more to define, see BUILD.gn and
    //gn/skia.gni for ideas)
  - BUILD.bazel to see the "skia-core" cc_library rule.
    See also "gms" and "tests"
  - modules/canvaskit/BUILD.bazel to see the use of
    the emscripten "wasm_cc_binary" rule, which depends
    on the "skia-core", "gms", and "tests" rule. Note that
    it only builds some of the gms as a proof of concept.
  - The other BUILD.bazel files. Some of these are not
    platform or feature dependent (e.g. pathops). Others
    are (e.g. gpu).
  - All other files.

[1] https://docs.bazel.build/versions/4.2.1/skylark/config.html#user-defined-build-settings
[2] https://github.com/emscripten-core/emsdk/pull/920
[3] In this CL, that's just the webgl one.
[4] https://docs.bazel.build/versions/main/be/c-cpp.html#cc_library.local_defines

Change-Id: Ieecf9c106d5e3a6ae97d13d66be06b4b3c207089
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/458637
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Owners-Override: Kevin Lubick <kjlubick@google.com>
2021-11-09 12:32:25 +00:00
Kevin Lubick
37bef2d300 [canvaskit] Add tests/examples for using CanvasKit with Typescript.
This adds a way to test/demonstrate how an external client
using Typescript can make use of CanvasKit in a browser
(currently a JS library with Typescript bindings supplied).

See: modules/canvaskit/external_test/typescript_browser/

This also adds a way that we hope CanvasKit might be used
in a future release, that is, via ES6 modules.

See: modules/canvaskit/external_test/typescript_browser_es6/

These TS files can be built into the JS files needed by the
respective index.html files using the appropriate target
in modules/canvaskit/external_test/Makefile. Then, `make serve`
will bring up a HTTP Server that will make the folders
accessible on localhost:8000

Change-Id: Ie4ddc2588b4bdccd4a727f11b540289cf4f85795
Bug: skia:11077, skia:12539
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/468214
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-05 20:18:30 +00:00
Jorge Betancourt
f2e90d3005 add skottie support for Bulge ADBE effect
This effect does not yet support pinned edges or taper

also sneak in a filename change (CCToner) to keep all effect names standard

Change-Id: I17f2b5463408556775bc12a972358abd4d8d8690
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/467319
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2021-11-04 21:05:22 +00:00
Avery Musbach
a05d3029ac Fix skottie::PropertyHandle export
Bug: chromium:1266877
Change-Id: I6000d0dd8c9214aa37c1956834d6a14db151c929
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/467956
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2021-11-04 19:00:27 +00:00
Florin Malita
ba35f687c3 [skottie] Clean up FractalNoise and SkSLEffect
Pass inval controller and ctm to child nodes during revalidation.

Change-Id: Iee6862af78c77d5164e29b0e41ed6dae9a7f4235
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/466760
Auto-Submit: Florin Malita <fmalita@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-11-02 13:27:15 +00:00
Jorge Betancourt
172c7998e1 plumb experimental SkSL layer effect in native Skottie player
Long term plan is to expose a plugin (standalone or with bodymovin) that allows motion artists to write sksl into a composition.
This is the first step where we test how we'd read in the json data under the hood.

Change-Id: I300d3af5d01e12f5b495970f89fd12b5f464a9a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/464368
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2021-11-01 18:05:15 +00:00
John Stiles
9ec61da31b Fix Clang warning -Wbitwise-instead-of-logical.
warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
    inherit_if_needed(currentNode->fX               , attrs->fX)      |
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  note: cast one or both operands to int to silence this warning

Change-Id: I6d59a5c33826af29560c0e30ddf9f4e16581882c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463896
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2021-10-26 21:35:37 +00:00
Kevin Lubick
7ce380e967 [canvaskit] Remove deprecated MakeTypefaceFromData and RefDefault
Change-Id: I0072fa5c11834a6250f2f5b9290ecea0d30f2128
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462177
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-10-21 16:45:42 +00:00
Kevin Lubick
2d13fab55c [canvaskit] Define requestAnimationFrame and other definition fixes.
Change-Id: I28a908fb680d704bf730a5968691f54d4a9e0a68
Bug: skia:12555 skia:12550
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462056
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-10-21 16:45:42 +00:00
Jorge Betancourt
aaa70658c2 expose directional blur to skottie
Change-Id: I759e4fff7a6d9cd1aae6ece060d570d05c1af94a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461236
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2021-10-20 19:41:30 +00:00
Jorge Betancourt
ebe2d82384 [JetSki] get TypeFace from FontMgr
Change-Id: Ied6cc2f67434757ed1cf6dd4edb6c40798ec206b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/450038
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-10-20 19:33:30 +00:00
Florin Malita
b3460f9979 [skottie] Floatify Fractal Noise
Halfs are lacking sufficient precision for this effect.

Change-Id: If3c2cac34d465d74b7ad8228417c42950f48adfd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461177
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2021-10-19 19:20:08 +00:00
Florin Malita
decc9ae2fc [skottie] Fractal Noise optimization
Hoist all evolution-related calculations out of the shader, and pass
precomputed noise planes and weight uniforms.

Renders ~20% faster locally (w/ software rasterization).

Change-Id: I771bea8f3425440515d2cb9a8623336d18bcc7b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/460336
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-10-18 16:14:54 +00:00
Florin Malita
b6a3aa7eb5 [skottie] Fractal Noise: cycle evolution support
AE allows for optional cycling of evolution, after a certain number of
revolutions.

To support:

  - split off the base/offset component into a separate uniform
    (currently front-loaded into evolution)
  - introduce an additional "cycle" (period) uniform to mod() the noise
    plane calculations


Change-Id: Ib412027114c467934c549cc1438a7d4560aa14bc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/460116
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2021-10-18 15:11:06 +00:00
Harry Terkelsen
1cb3f3666c Don't free the locale pointer in a paragraph style.
The locale is malloc'ed using `cacheOrCopyString`, which should never
be explicitly freed.

Change-Id: I6a911c52f1f485b34fad86303a1f4be199195858
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
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459835
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2021-10-15 22:14:34 +00:00
Jorge Betancourt
aa9656d8ca expose FontChain interface to Java with FontChainAdapter
initial commit to add fontChain to JetSki

Change-Id: Ic2e27b055888394b0b8202d817b0c09595ca9fa0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457837
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-10-14 19:58:29 +00:00
Nico Weber
39edd521a2 Fix Wbitwise-instead-of-logical warnings
`a || b` only evaluates b if a is false. `a | b` always evaluates
both a and b. If a and b are of type bool, `||` is usually what you
want, so clang now warns on `|` where both arguments are of type bool.

In Skia, 3 of 3 uses of `|` were intentional as far as I can tell (one
had an explicit comment, the other two didn't). Rewrite them slightly
to make this intent more clear and to suppress the warning.

There was also one use of `&`. That one looks like a (benign) typo for
`&&`, so change it.

Bug: chromium:1255745
Change-Id: I9ac37075311005c0a8fcb8d1379f516510929423
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459456
Commit-Queue: Nico Weber <thakis@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Florin Malita <fmalita@google.com>
2021-10-14 14:50:09 +00:00
Florin Malita
ad6f2d3e66 [skottie] Log text layout errors
If text layout fails (e.g. due to unsatisfiable scaling constraints),
log an error to notify clients.

Change-Id: Ic7a028196b3bfb8f45b91c88766f0059145a202f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/458722
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2021-10-14 14:29:11 +00:00
Kevin Lubick
9a5762052a Followup fixes to gm bindings
Change-Id: If896d8a06fcf1bf1859a486f16e9f56fd184c0c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459196
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-10-13 19:26:05 +00:00
Robert Phillips
083e038fe6 Fix WasmGMTests bot
Change-Id: Iffb757bdc8b28d14aae176b1d2448e72ccde7c3f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459116
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-10-13 18:03:45 +00:00
Robert Phillips
297d096cfb [graphite] More testing infrastructure
With this CL we can run as:

     dm --src gm skp tests --config grmtl -v --nocpu --nogpu

and not get all the non-Graphite unit tests.

Bug: skia:12466
Change-Id: Ib3f04f315fe4b5731a54e4c72979a0c1e00baf24
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457898
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-10-13 15:15:29 +00:00
Eric Sum
734d7e2be4 Export some classes callers may use for Skottie.
1) CachingResourceProvider - The immediate user of this is ChromeOS,
but it seems like a generally useful ResourceProvider implementation
that all can use.

2) Animation::Builder - See this CL:
https://chromium-review.googlesource.com/c/chromium/src/+/3171517
It seems that windows builds fail with "undefined reference" linker
errors when trying to use the Animation::Builder directly. My guess
is that this is because the SK_API macro is needed to export it.

Change-Id: Ief39fe6ec03f992a0be73e5be54b0119d2d82930
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/458407
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2021-10-13 01:35:54 +00:00
Brian Salomon
87a0078b89 Support building on clang with -std=c++14 but no C++17 extension warning.
Classes of issues addressed:

1. static constexpr class variables aren't automatically inline. Already handled in a separate CL

2. Lack of C++17 copy elision means classes of objects constructed at function return need a copy or move constructor even if RVO will mean it isn't called.

3. Nested braced init no longer allowed for base classes of subclasses without constructors.

4. template static constexpr var in template class throws error about redundant initialization. Adding inline and removing defn outside of class fixes it.

5. Some places that should have been including std headers now actually need to include them.

6. No auto template parameters.

7. No lambdas in constexpr funcs.


Bug: chromium:1257145
Change-Id: Icb24c6b4ed039287fb4cf27a21a1bb7dc9821728
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457298
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-10-12 16:34:30 +00:00
Julia Lavrova
0c1f6e5dab Implementing baseline shift for JetBrains
Bug: skia:12390
Change-Id: I90d99e1ca18c1274ac53ab35a3f63b716d26cb5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457097
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-10-12 14:35:33 +00:00
Kevin Lubick
f32ad08ac4 [infra] Deduplicate serve.py
Change-Id: I25bd987faedd7e9c322bcec487ab07583bad6b9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/458197
Reviewed-by: Erik Rose <erikrose@google.com>
2021-10-12 11:42:50 +00:00
Brian Salomon
9fa47cc1c6 Make class members that are static constexpr also be inline.
This is in prep for compiling with -std=c++14 and -Wno-c++17-extensions
when building with clang. Chrome has encountered problems with
third_party headers that are included both in Skia and other Chrome
sources that produce different code based on whether preprocessor macros
indicate a C++14 or C++17 compilation.

In C++17 they are already inline implicitly. When compiling with C++14
we can get linker errors unless they're explicitly inlined or defined
outside the class. With -Wno-c++17-extensions we can explicitly inline
them in the C++14 build because the warning that would be generated
about using a C++17 language extension is suppressed.

We cannot do this in public headers because we support compiling with
C++14 without suppressing the C++17 language extension warnings.

Bug: chromium:1257145
Change-Id: Iaf5f4c62a398f98dd4ca9b7dfb86f2d5cab21d66
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457498
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-10-11 16:22:59 +00:00
Florin Malita
132d47c90d [skottie] Path support for paragraph text
In addition to single line (point) text, AE also supports path layout
for paragraph text.

At a high level, the paragraph box top is mapped to the path (following
alignment rules), and each glyph is displaced along its path positioning
vector, post orientation.

The main difference compared to point text, is that the distance on path
is based on the fragment position relative to the paragraph left edge.

The paragraph box also plays a role in alignment: left/center/right
aligns with path start/mid/end.

This includes a tangential optimization: instead of validating cached
contour data in each PathInfo::getMatrix() call, we only check once at
a higher level (onSync) -- to avoid performing a shape vector comparison
for each fragment.

Change-Id: I2c31ce3b0a525a3cd2d4525abcf88d5fc943bb6e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457656
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-10-11 15:26:00 +00:00
Florin Malita
d616f0b949 [skottie] More animatable text path properties
"Perpendicular To Path" and "Reverse Path" are animatable in AE, but
used to be exported as static props.  Bodymovin is being updated to
export them as animatable now.

Change the parser to handle both cases.

Change-Id: If2fea2a37af7ec6af5ac07c24cfb533bff5e03ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457736
Auto-Submit: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-10-11 14:34:36 +00:00
Kyle Carlstrom
cd2f207a2e Allow tracking of Precompositions onEnter/onExit
Change-Id: I6941d7d6c7a76eef462711964e5fb1cb4fd68634
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457156
Reviewed-by: Florin Malita <fmalita@google.com>
Reviewed-by: Avinash Parchuri <aparchur@google.com>
Commit-Queue: Avinash Parchuri <aparchur@google.com>
2021-10-08 18:36:50 +00:00
Jorge Betancourt
7357ae2af5 add CCToner support to skottie
Change-Id: Ib5f0d7241f0aa039e325c977aaca30f19682196f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456637
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2021-10-08 17:03:50 +00:00
Florin Malita
7fcda8e23e [skottie] Initial text path support
Current limitations:

  -- single-line only (no paragraph box support)
  -- "Force Alignment" not supported
  -- tracking animators not supported

Change-Id: I4072f1d8280032787c6db7e8b47d6f55be43bddb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456237
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-10-08 15:09:35 +00:00
Florin Malita
7e5772f448 [skottie] Fix Fractal Noise transform order
Update the shader transform order to match AE.

Change-Id: Iff9256923bef153342fcabe5f5a1091d4b2e3895
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457120
Auto-Submit: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-10-08 13:59:01 +00:00
Michael Ludwig
8724136129 Revert "Allow tracking of Precompositions onEnter/onExit"
This reverts commit 510e0c57da.

Reason for revert: probably blocking g3 roll

Original change's description:
> Allow tracking of Precompositions onEnter/onExit
>
> Change-Id: I065288b212d8ffc4d0ca127940e524799f59aff7
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/454976
> Reviewed-by: Avinash Parchuri <aparchur@google.com>
> Reviewed-by: Florin Malita <fmalita@google.com>
> Commit-Queue: Avinash Parchuri <aparchur@google.com>

Change-Id: I2e5b12bd45d48fc98ee799a733740e4cd8ae3dcb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/456921
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-10-07 13:54:07 +00:00
Kyle Carlstrom
510e0c57da Allow tracking of Precompositions onEnter/onExit
Change-Id: I065288b212d8ffc4d0ca127940e524799f59aff7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/454976
Reviewed-by: Avinash Parchuri <aparchur@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Avinash Parchuri <aparchur@google.com>
2021-10-06 18:01:56 +00:00
Florin Malita
9c57e16950 [skottie] Fill effect opacity workaround
The Fill effect has separate "color" and "opacity" components.

In AE, the color chooser does not allow modifying the alpha channel --
the only source for Fill transparency is the opacity property.

Thus, the alpha component of the color property should always be 1.

But in practice, it appears Bodymovin sometimes exports the color with a
zero alpha field (BM always encodes colors as 4-float arrays).

To workaround this issue, update Fill to ignore the color alpha and only
use the explicit opacity.

Change-Id: Ic4bbbc1ac91d255fe14e3261d1ae03340e053ce2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/454856
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-10-01 16:20:54 +00:00
Kyle Carlstrom
4aef06d231 Added TextExpressionAnimator
Change-Id: If60d4a7893da5987176163ce9fa258f846b1f2e3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448650
Reviewed-by: Florin Malita <fmalita@google.com>
Reviewed-by: Avinash Parchuri <aparchur@google.com>
Commit-Queue: Avinash Parchuri <aparchur@google.com>
2021-09-30 19:28:31 +00:00
Kevin Lubick
bb71c1bea2 [canvaskit] Update SKP and RTShader examples
Loading an old SKP stops working after a while, so this changes
it to draw something and then deserialize it immediately.

I also noticed that the CPU backend supports atan, so we can
use a more complete example there.

Change-Id: I70bec69d05184c5ea041b143132ddbbd7f63f004
Bug: skia:12439
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/454456
Reviewed-by: Brian Osman <brianosman@google.com>
2021-09-30 13:00:30 +00:00
Kyle Carlstrom
0bfac0127c Create VectorExpressionAnimator
Change-Id: I9ac04e316fd5cc21f9400ff56cf6bc6db77ca046
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444871
Commit-Queue: Avinash Parchuri <aparchur@google.com>
Reviewed-by: Avinash Parchuri <aparchur@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2021-09-28 01:23:19 +00:00
Florin Malita
18cb4a67d8 [skottie] Fix MotionTile/opacity interaction
Some group effects (including layer opacity) are not applied upfront,
via an expensive saveLayer, but are deferred until we can determine
whether they can be folded into an atomic draw's paint (to avoid the
extra layer).

At the moment, the MotionTile custom render node drops all pending
paint effects on the floor (ignores |ctx|).  Update to apply via the
shader paint.

Also update a couple of related tests to animate opacity.

Change-Id: I1f5cd2459ec81b170749528e8818d0be598a7ca7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452723
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-09-27 18:04:20 +00:00
Eric Boren
04fe267ab9 Fix some master -> main references in docs
Bug: skia:12478
Change-Id: I4e2bc1eb441c19d7b4cf2bcea65b852f7f0aa59b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/453136
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
2021-09-27 14:52:24 +00:00
Florin Malita
6ba939d288 [skottie] Improved Hue/Saturation effect
The current HueSaturation effect implementation relies on a simple
HSLA color matrix operation and assumes the controls are linear.

Turns out AE's saturation is more sophisticated, both in implementation
and in control mapping.

Updating the effect to use a chain of specialized color filters:

  - keep HSLAMatrix() for hue adjustments
  - introduce a custom runtime effect for saturation
    (following AE's semantics)
  - use a plain Matrix() CF for lightness adjustments

Change-Id: Iba6c9f7fd8c01dc33c1cd00822ea546867c057ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452976
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-09-27 13:30:48 +00:00
Jorge Betancourt
4d06441fca [JetSki] bind drawGlyphs to JetSki for Text rendering
Change-Id: I5cd691b5b3fda58afdc8ddd5213063c202b19672
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447716
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-09-22 19:38:13 +00:00
Florin Malita
6a2a637746 [skottie] Fix Keyframe::Value equality operator
Per spec, reading anything other than the most recently written
union member is undefined behavior.

Keyframe containers always access the same member, consistently.  But
the type-agnostic equality operator does touch both members.

Refactor to avoid undefined behavior.

Also add a couple of unit tests to capture keyframe deduping behavior
(which in turn relies on the equality operator).

Change-Id: I7ba9c335ef28af7ddc71bd6f03d56b891fbdea1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/451016
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2021-09-21 19:23:26 +00:00
Ben Wagner
3d9c73c100 Use thread_local on iOS
Using thread_local on iOS requires iOS 9 or greater. Chrome for iOS
now requires 13, Skia sets the minimum to 11 for test builds, and
Flutter actively does not support 8 or earlier. Dropping support for
iOS 8 in practice and moving to iOS 9 makes it possible to use
thread_local without reservations on iOS.

Change-Id: Ib80cbe24e8154be650f343643281384c17356242
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447497
Reviewed-by: Heather Miller <hcm@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-09-20 17:51:38 +00:00
Julia Lavrova
398ef4487b Reland "Reland "Small changes for SkText that are not in experimental directory""
This reverts commit b51994990b.

Reason for revert: Fixed the test

Original change's description:
> Revert "Reland "Small changes for SkText that are not in experimental directory""
>
> This reverts commit ce32c8a074.
>
> Reason for revert: Skottie test is broken
>
> Original change's description:
> > Reland "Small changes for SkText that are not in experimental directory"
> >
> > This reverts commit 481a58dfe0.
> >
> > Reason for revert: Fixing the build
> >
> > Original change's description:
> > > Revert "Small changes for SkText that are not in experimental directory"
> > >
> > > This reverts commit 92f1bc0083.
> > >
> > > Reason for revert: Blocking Android roll.
> > >
> > > Original change's description:
> > > > Small changes for SkText that are not in experimental directory
> > > >
> > > > (also made utf 8<->16 conversion static on SkUnicode)
> > > >
> > > > Change-Id: Ie64d18ad21a35ec10bd0b350fb7887fb78a419d8
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448140
> > > > Reviewed-by: Mike Reed <reed@google.com>
> > > > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> > >
> > > Change-Id: Ieb9eb0495dddfc0f9e9e74861b24efc0201fd520
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448656
> > > Auto-Submit: Brian Osman <brianosman@google.com>
> > > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> >
> > Change-Id: I1e5859c9dd943c701d4c4e648bdc3e44412eca54
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448676
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
>
> Change-Id: Ib8e5ec05a5555f34106a0ee61878a8199b82bb82
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448897
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Reviewed-by: Florin Malita <fmalita@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

Change-Id: I3bc103c0e1c495342a6673e80765b5f26862e8dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448898
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-09-15 15:31:14 +00:00
Kevin Lubick
0c5b05c3ab [canvaskit] Roll 0.30.0
Change-Id: Ia990c0537d79256b895348c75ff118253a5af926
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449056
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2021-09-15 13:21:25 +00:00
Julia Lavrova
b51994990b Revert "Reland "Small changes for SkText that are not in experimental directory""
This reverts commit ce32c8a074.

Reason for revert: Skottie test is broken

Original change's description:
> Reland "Small changes for SkText that are not in experimental directory"
>
> This reverts commit 481a58dfe0.
>
> Reason for revert: Fixing the build
>
> Original change's description:
> > Revert "Small changes for SkText that are not in experimental directory"
> >
> > This reverts commit 92f1bc0083.
> >
> > Reason for revert: Blocking Android roll.
> >
> > Original change's description:
> > > Small changes for SkText that are not in experimental directory
> > >
> > > (also made utf 8<->16 conversion static on SkUnicode)
> > >
> > > Change-Id: Ie64d18ad21a35ec10bd0b350fb7887fb78a419d8
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448140
> > > Reviewed-by: Mike Reed <reed@google.com>
> > > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> >
> > Change-Id: Ieb9eb0495dddfc0f9e9e74861b24efc0201fd520
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448656
> > Auto-Submit: Brian Osman <brianosman@google.com>
> > Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
>
> Change-Id: I1e5859c9dd943c701d4c4e648bdc3e44412eca54
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448676
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

Change-Id: Ib8e5ec05a5555f34106a0ee61878a8199b82bb82
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448897
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-09-14 20:32:02 +00:00
Julia Lavrova
ce32c8a074 Reland "Small changes for SkText that are not in experimental directory"
This reverts commit 481a58dfe0.

Reason for revert: Fixing the build

Original change's description:
> Revert "Small changes for SkText that are not in experimental directory"
>
> This reverts commit 92f1bc0083.
>
> Reason for revert: Blocking Android roll.
>
> Original change's description:
> > Small changes for SkText that are not in experimental directory
> >
> > (also made utf 8<->16 conversion static on SkUnicode)
> >
> > Change-Id: Ie64d18ad21a35ec10bd0b350fb7887fb78a419d8
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448140
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
>
> Change-Id: Ieb9eb0495dddfc0f9e9e74861b24efc0201fd520
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448656
> Auto-Submit: Brian Osman <brianosman@google.com>
> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>

Change-Id: I1e5859c9dd943c701d4c4e648bdc3e44412eca54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448676
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-09-14 14:30:22 +00:00
Brian Osman
481a58dfe0 Revert "Small changes for SkText that are not in experimental directory"
This reverts commit 92f1bc0083.

Reason for revert: Blocking Android roll.

Original change's description:
> Small changes for SkText that are not in experimental directory
>
> (also made utf 8<->16 conversion static on SkUnicode)
>
> Change-Id: Ie64d18ad21a35ec10bd0b350fb7887fb78a419d8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448140
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

Change-Id: Ieb9eb0495dddfc0f9e9e74861b24efc0201fd520
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448656
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-09-14 13:27:19 +00:00
Julia Lavrova
92f1bc0083 Small changes for SkText that are not in experimental directory
(also made utf 8<->16 conversion static on SkUnicode)

Change-Id: Ie64d18ad21a35ec10bd0b350fb7887fb78a419d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448140
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-09-13 18:22:33 +00:00
Florin Malita
38ecac7895 [skottie] Suppress layer parser errors for tt: 0
Bodymovin uses tt: [1-4] to encode a layer track matte type, and skips
the property when a track matte is not present.

Flow OTOH uses explicit tt: 0 to signal the absence of a track matte.

Update the parser to not error out on tt: 0.

Change-Id: I2d456ac3479e356ba1fc5320589848f8872775e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445957
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-09-08 16:04:01 +00:00
Jorge Betancourt
151a6f34e1 expose Font to JetSki
Change-Id: Icea51ab00118b48898df70f4f1fa9ed985372589
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444760
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2021-09-07 21:51:30 +00:00
Nam Se Hyun
cf6ea775a4 fix fontMgr.makeTypefaceFromData type name
fontMgr doesn't export the function named `makeTypefaceFromData`.

it has `**M**akeTypefaceFromData`.

This is an imported pull request from
https://github.com/google/skia/pull/87

GitOrigin-RevId: 7a80a1a7776d0b20810510665f6a3727100bef97
Change-Id: I02eb6a5f406d4448f61266016f9c0882eb59c871
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445804
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-09-07 12:16:30 +00:00
Nam Se Hyun
e1b74b7358 Fix EmbindObject's deleteLater to deleteAfter
I found that CanvasKit's `EmbindObject` type has wrong function name, `deleteAfter`.

I cound't find any information of function `deleteAfter` even in google searching. so i digged it.

![image](https://user-images.githubusercontent.com/3580430/132103177-9c7c32a3-2107-4b97-9698-f52da5833ba1.png)

I have no idea with `deleteAfter`, but `EmbindObject` has the function name `deleteLater`, not `deleteAfter`.

Below is the code of Embind.
dd5733ac80/src/embind/embind.js (L1782)

This is an imported pull request from
https://github.com/google/skia/pull/86

GitOrigin-RevId: 0738dc792404e8a08ba666c0662795b55beb7a5d
Change-Id: I0a7af3d4f313d36e8cdc09d631f9199e948eca29
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445736
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2021-09-07 12:11:14 +00:00
Brian Osman
cbfa34a58c Convert internal SkSL to use .eval()
Also update RELEASE_NOTES to describe new syntax.

Change-Id: I2666551b98f80b61ae3a48c92a9e306cdc7242b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444735
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-03 15:54:54 +00:00
Florin Malita
5572b2a3ed Reland "[skottie] AllCaps support"
This reverts commit 6142500513.

Reason for revert: relanding with fixes

Original change's description:
> Revert "[skottie] AllCaps support"
>
> This reverts commit efc7ca4a71.
>
> Reason for revert: broke Chromium, NoDEPS builds
>
> Original change's description:
> > [skottie] AllCaps support
> >
> > AfterEffects and Bodymovin support an "AllCaps" text flag which forces
> > text capitalization.
> >
> >   * add toUpper() bindings to SkUnicode/SkICU
> >   * add capitalization options to SkottieShaper
> >   * plumb existing Lottie 'ca' (AllCaps) prop
> >   * also fix a couple of unrelated whoopsies
> >
> > Change-Id: I8e80921b66530e9830938004946082c6e450b04b
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445104
> > Reviewed-by: Ben Wagner <bungeman@google.com>
> > Commit-Queue: Florin Malita <fmalita@google.com>
>
> TBR=bungeman@google.com,fmalita@chromium.org,fmalita@google.com,jlavrova@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com
>
> Change-Id: I3bb43f37f07cfc021e397df578499a4c4da15ca3
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444980
> Reviewed-by: Florin Malita <fmalita@google.com>
> Commit-Queue: Florin Malita <fmalita@google.com>

Change-Id: Id729e09d4cade0cead193ffc5e6bd4fea1cdcff6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445598
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2021-09-03 14:43:59 +00:00
Florin Malita
6142500513 Revert "[skottie] AllCaps support"
This reverts commit efc7ca4a71.

Reason for revert: broke Chromium, NoDEPS builds

Original change's description:
> [skottie] AllCaps support
>
> AfterEffects and Bodymovin support an "AllCaps" text flag which forces
> text capitalization.
>
>   * add toUpper() bindings to SkUnicode/SkICU
>   * add capitalization options to SkottieShaper
>   * plumb existing Lottie 'ca' (AllCaps) prop
>   * also fix a couple of unrelated whoopsies
>
> Change-Id: I8e80921b66530e9830938004946082c6e450b04b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445104
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Florin Malita <fmalita@google.com>

TBR=bungeman@google.com,fmalita@chromium.org,fmalita@google.com,jlavrova@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: I3bb43f37f07cfc021e397df578499a4c4da15ca3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444980
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2021-09-03 11:55:10 +00:00
Florin Malita
efc7ca4a71 [skottie] AllCaps support
AfterEffects and Bodymovin support an "AllCaps" text flag which forces
text capitalization.

  * add toUpper() bindings to SkUnicode/SkICU
  * add capitalization options to SkottieShaper
  * plumb existing Lottie 'ca' (AllCaps) prop
  * also fix a couple of unrelated whoopsies

Change-Id: I8e80921b66530e9830938004946082c6e450b04b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445104
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2021-09-03 00:01:53 +00:00
Robert Phillips
2af13c135b Reland "Fix compilation w/ "skia_enable_svg = false" (take 2)"
This reverts commit 44b7568c8a.

Reason for revert: Google 3 CL has landed

Original change's description:
> Revert "Fix compilation w/ "skia_enable_svg = false" (take 2)"
>
> This reverts commit 30a6b101f4.
>
> Reason for revert: Maybe blocking G3 roll?
>
> Original change's description:
> > Fix compilation w/ "skia_enable_svg = false" (take 2)
> >
> > Change-Id: I036ae171809af56cc9594704b44705ebd095ec80
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443898
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
>
> TBR=robertphillips@google.com,fmalita@chromium.org,fmalita@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com
>
> Change-Id: Ibee3819e073b04efdf9736058c1f9b288249620c
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444216
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

# Not skipping CQ checks because this is a reland.

Change-Id: Idf73d864108067ee1c34e88ee4e5236847abd582
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444501
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-09-01 17:54:08 +00:00
Robert Phillips
44b7568c8a Revert "Fix compilation w/ "skia_enable_svg = false" (take 2)"
This reverts commit 30a6b101f4.

Reason for revert: Maybe blocking G3 roll?

Original change's description:
> Fix compilation w/ "skia_enable_svg = false" (take 2)
>
> Change-Id: I036ae171809af56cc9594704b44705ebd095ec80
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443898
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=robertphillips@google.com,fmalita@chromium.org,fmalita@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: Ibee3819e073b04efdf9736058c1f9b288249620c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444216
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-31 22:31:00 +00:00
Robert Phillips
be2c3ee05d Fix compilation with "skia_enable_skparagraph = false"
Change-Id: I034d841618fbf878223c82ec30f0ad37678d737e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443899
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-31 18:50:20 +00:00
Robert Phillips
30a6b101f4 Fix compilation w/ "skia_enable_svg = false" (take 2)
Change-Id: I036ae171809af56cc9594704b44705ebd095ec80
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443898
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-31 18:28:25 +00:00
Brian Osman
a8b897bfc1 Remove blend and colorFilter sksl modules
This moves the functions for dealing with child effects into the public
module (where those types already live). With that change, blend and
colorFilter have no module-specific declarations.

Change-Id: I7665e68427ea4d8d1ed4d31afb658edb79bac5a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443412
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-08-31 17:35:19 +00:00
Kevin Lubick
29104528cc [infra] Port serve.py from Python2 to 3
These scripts are useful when testing WebAssembly locally
because the mimetype impacts how the binaries are loaded.

The porting was achieved by doing the following:
python -m lib2to3 -w -n serve.py


Change-Id: I09673fa881339a9b157c5fc993e190766efcd85e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443884
Reviewed-by: Erik Rose <erikrose@google.com>
2021-08-31 15:28:19 +00:00
Julia Lavrova
5dbdb1e75d Line metrics: return all indices in UTF16
Bug: skia:12383
Change-Id: Ibf5521caa8858a7f18fd2717f5f55ff52ffeef54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443403
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-08-30 18:51:58 +00:00
Julia Lavrova
078a8ddc77 Yet another bug in line metrics
Bug: skia:12382
Change-Id: I18039db0a4e89a25c31d27ea7f60ae7bde50730f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443401
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-08-30 18:21:27 +00:00
Jorge Betancourt
c1727fc217 [JetSki] pass SkPaint into experimental SkText drawText calls
tests currently through jetski demo

Change-Id: I0847e98579b62104e5d9ddaa7ca008f5a75be5c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441427
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-08-26 13:01:51 +00:00
Julia Lavrova
0f629d7f48 Positioning in chinese glyphs
+small fix for placeholder in getGlyphPositionAtCoordinate

Bug: skia:12322
Change-Id: I8f03c5c808db54fc9742e5817768db4a088bc5b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440458
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-08-25 20:49:48 +00:00
Kevin Lubick
f611404816 [canvaskit] Remove the need for users to keep track of contexts.
We'll switch to the correct context when necessary (e.g. before
calls that talk to the GPU). This is achieved by adding in
calls at the JS layer to switch the context before making a call
that is known to talk to the GPU (e.g. draw calls on SkCanvas).

Another implementation that was considered was to add a C++
shim in GrGLInterface that would switch the context before
every call in the GPU - however, that seemed too difficult
and would add extra overhead if a single draw* call talks
to the GPU multiple times.

Bug: skia:12255
Change-Id: I96e4c6b41a5bfcc9913aeaca7ccb125358048ad3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/432136
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-08-25 18:23:06 +00:00
Brian Osman
293497e77f Convert internal sample() calls to shade/filter/blend
Bug: skia:12302
Change-Id: I8cf958acf9214d0de903a4097647afd74f2a659e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441541
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-24 21:03:44 +00:00
Jorge Betancourt
e1fb47daac [JetSki] plumb experimental SkText to JetSki
Change-Id: I972ff5bd066ff9e8afa98f506e6fe9d6b9dc621a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440597
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-08-24 15:34:21 +00:00
Kyle Carlstrom
7609f7f27d Create Vec2ExpressionAnimator
Change-Id: I056eb5ca61c14dd58c2edeadcd122f383094fcb9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439976
Commit-Queue: Kyle Carlstrom <kylecarlstrom@google.com>
Commit-Queue: Avinash Parchuri <aparchur@google.com>
Reviewed-by: Avinash Parchuri <aparchur@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-08-17 18:36:12 +00:00
John Stiles
13c9f6690e Fix additional cases of variable shadowing.
These changes will allow us to enable shadowed-variable warnings.

Change-Id: I24ee7e198c1c77b58836237c37557c00452680e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439476
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-08-16 17:47:14 +00:00
Florin Malita
30c2dfe53c [skottie] Add support for displacement map output expansion
Displacement Map can optionally expand the target layer bounds to
accommodate edge displacement.

Plumb and implement the "Expand Output" effect option [1].

[1] https://helpx.adobe.com/after-effects/using/distort-effects.html#displacement_map_effect

Change-Id: I0d385e0d169c77924bad4179f2f8327df4a941f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438818
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-08-12 17:43:14 +00:00
Julia Lavrova
8343e003ca SkText: implement select via styles
Change-Id: I047f7fc4027572892433d759f4098f5da9da4662
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438657
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-08-11 19:49:35 +00:00
John Stiles
b65b4da554 Fix cases of variable shadowing in /modules/.
If we manage to fix all the existing cases of variable shadowing, we
could enable -Wshadow.

Change-Id: Id56c227be7c29c56d6e9253aefcd33607bb1129e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438576
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-08-11 17:14:42 +00:00
Herb Derby
f0efa1d8e7 Reland "Reland "uniform Ptr (UPtr) is a sub class of Ptr""
This is a reland of ea17e2499d

Original change's description:
> Reland "uniform Ptr (UPtr) is a sub class of Ptr"
>
> This is a reland of cef047a490
>
> Fix strides in SkVMTest to be the right size.
>
> Original change's description:
> > uniform Ptr (UPtr) is a sub class of Ptr
> >
> > A pointer for a Uniform (UPtr) is a sub type of a Ptr. Everywhere you
> > can use a Ptr a UPtr will work, but you can't use Ptr where you need
> > a UPtr. All the UPtr instructions uniformF, gather32, etc are expected
> > to be hoisted and therefore loaded only once. While the varyings
> > instructions like load32, etc. are expected to remain in the body
> > of the loop, and be evaluated each time through the loop.
> >
> > Change-Id: I4fe6458c2a4614872ed67cda1e81b05ea8a9e69e
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436297
> > Commit-Queue: Herb Derby <herb@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
>
> Change-Id: I858fa1224452ec801b6186fede353849edc895b5
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436564
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

Change-Id: I774e710724c99a41d0d160e88a2b723f66e03861
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436821
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-08-11 16:42:10 +00:00
Julia Lavrova
ad5944cf8d Refactoring Text Editor (in progress)
Insert/Delete/Backspace
Status line

Change-Id: I38727ddb86bf20cdd6c64363c33ffda03ab3c2c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431179
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-08-09 15:06:56 +00:00
Kevin Lubick
eb76f3d0dd [canvaskit] Deploy 0.29.0
Change-Id: Ie74c04cf7a0d635d3f716947b0e771d78b06d775
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437396
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-08-06 19:17:28 +00:00
Kevin Lubick
363c6e298f [canvaskit] Update object types
The object type is treated like "any", which is not good.
We can be more descriptive of those types.

Change-Id: I39f3dba635c196ea06163deb358a56c9e4f82f6d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437316
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-08-06 14:42:28 +00:00
Kyle Carlstrom
134c5f7f69 Support expressions for scalar values
Change-Id: I87c1ca4dd6d6f2e1e591eedc97ee7cb088039eab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436117
Commit-Queue: Avinash Parchuri <aparchur@google.com>
Auto-Submit: Kyle Carlstrom <kylecarlstrom@google.com>
Reviewed-by: Avinash Parchuri <aparchur@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-08-05 22:42:04 +00:00
Derek Sollenberger
337e484839 Revert "Reland "uniform Ptr (UPtr) is a sub class of Ptr""
This reverts commit ea17e2499d.

Reason for revert: blocking the android roll on a build failure

Original change's description:
> Reland "uniform Ptr (UPtr) is a sub class of Ptr"
>
> This is a reland of cef047a490
>
> Fix strides in SkVMTest to be the right size.
>
> Original change's description:
> > uniform Ptr (UPtr) is a sub class of Ptr
> >
> > A pointer for a Uniform (UPtr) is a sub type of a Ptr. Everywhere you
> > can use a Ptr a UPtr will work, but you can't use Ptr where you need
> > a UPtr. All the UPtr instructions uniformF, gather32, etc are expected
> > to be hoisted and therefore loaded only once. While the varyings
> > instructions like load32, etc. are expected to remain in the body
> > of the loop, and be evaluated each time through the loop.
> >
> > Change-Id: I4fe6458c2a4614872ed67cda1e81b05ea8a9e69e
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436297
> > Commit-Queue: Herb Derby <herb@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
>
> Change-Id: I858fa1224452ec801b6186fede353849edc895b5
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436564
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

TBR=herb@google.com,brianosman@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: I0ffc93a04f5329838d422ad9e42aba09b9ba0064
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436639
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2021-08-05 01:11:41 +00:00
Herb Derby
ea17e2499d Reland "uniform Ptr (UPtr) is a sub class of Ptr"
This is a reland of cef047a490

Fix strides in SkVMTest to be the right size.

Original change's description:
> uniform Ptr (UPtr) is a sub class of Ptr
>
> A pointer for a Uniform (UPtr) is a sub type of a Ptr. Everywhere you
> can use a Ptr a UPtr will work, but you can't use Ptr where you need
> a UPtr. All the UPtr instructions uniformF, gather32, etc are expected
> to be hoisted and therefore loaded only once. While the varyings
> instructions like load32, etc. are expected to remain in the body
> of the loop, and be evaluated each time through the loop.
>
> Change-Id: I4fe6458c2a4614872ed67cda1e81b05ea8a9e69e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436297
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

Change-Id: I858fa1224452ec801b6186fede353849edc895b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436564
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-08-04 20:51:14 +00:00
Derek Sollenberger
b00cbc704d Revert "uniform Ptr (UPtr) is a sub class of Ptr"
This reverts commit cef047a490.

Reason for revert: DM test failures on some Windows/Linux devices

Original change's description:
> uniform Ptr (UPtr) is a sub class of Ptr
>
> A pointer for a Uniform (UPtr) is a sub type of a Ptr. Everywhere you
> can use a Ptr a UPtr will work, but you can't use Ptr where you need
> a UPtr. All the UPtr instructions uniformF, gather32, etc are expected
> to be hoisted and therefore loaded only once. While the varyings
> instructions like load32, etc. are expected to remain in the body
> of the loop, and be evaluated each time through the loop.
>
> Change-Id: I4fe6458c2a4614872ed67cda1e81b05ea8a9e69e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436297
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=herb@google.com,brianosman@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: I785973be1493643e7d5a3da482bc4ab07d186865
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436559
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2021-08-04 17:26:34 +00:00