This reverts commit 5fe4b6faeb.
Reason for revert: relanding with guards
Original change's description:
> Revert "[skottie] Fix text-on-path tracking"
>
> This reverts commit ca973cbea0.
>
> Reason for revert: g3 image diffs
>
> Original change's description:
> > [skottie] Fix text-on-path tracking
> >
> > Tracking and line spacing computations require knowledge of cumulative
> > values for the whole line => we need two passes:
> >
> > 1) compute cumulative values
> > 2) compute per-fragment position adjustments
> >
> > Currently, #1 is implemented in the main onSync() loop (as we iterate
> > to compute fragment props) and #2 is post-applied via adjustLineProps(),
> > after the main loop.
> >
> > The problem is adjustLineProps() is executed after positioning glyphs on
> > path, and tracking is not taken into account for path positioning
> > (instead it moves glyphs horizontally, unrelated to the path).
> >
> > To fix this, we need tracking adjustments to be applied before
> > positioning on path (which is performed in fragmentMatrix()).
> >
> > - move the cumulative tracking computation to a dedicate lambda
> > (compute_linewide_props)
> > - move the fragment position adjustments to the main onSync() loop
> > (that way they participate in path positioning)
> > - to avoid executing the first pass unnecessarily, add flags to detect
> > the presence of tracking and line spacing animators.
> >
> >
> > Change-Id: Ieef2afb53ffe14177eba0ef41dc5c71149cab070
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518696
> > Reviewed-by: Ben Wagner <bungeman@google.com>
> > Commit-Queue: Florin Malita <fmalita@chromium.org>
> > Commit-Queue: Florin Malita <fmalita@google.com>
>
> Change-Id: Ia99fbb3d7d98eb6a59ff00d796bcc05bc6db63a3
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/519597
> Auto-Submit: Florin Malita <fmalita@google.com>
> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Change-Id: Ia39602178099d7fa016997f02e1bdf705b16bb2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/519598
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
This reverts commit ca973cbea0.
Reason for revert: g3 image diffs
Original change's description:
> [skottie] Fix text-on-path tracking
>
> Tracking and line spacing computations require knowledge of cumulative
> values for the whole line => we need two passes:
>
> 1) compute cumulative values
> 2) compute per-fragment position adjustments
>
> Currently, #1 is implemented in the main onSync() loop (as we iterate
> to compute fragment props) and #2 is post-applied via adjustLineProps(),
> after the main loop.
>
> The problem is adjustLineProps() is executed after positioning glyphs on
> path, and tracking is not taken into account for path positioning
> (instead it moves glyphs horizontally, unrelated to the path).
>
> To fix this, we need tracking adjustments to be applied before
> positioning on path (which is performed in fragmentMatrix()).
>
> - move the cumulative tracking computation to a dedicate lambda
> (compute_linewide_props)
> - move the fragment position adjustments to the main onSync() loop
> (that way they participate in path positioning)
> - to avoid executing the first pass unnecessarily, add flags to detect
> the presence of tracking and line spacing animators.
>
>
> Change-Id: Ieef2afb53ffe14177eba0ef41dc5c71149cab070
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518696
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Florin Malita <fmalita@google.com>
Change-Id: Ia99fbb3d7d98eb6a59ff00d796bcc05bc6db63a3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/519597
Auto-Submit: Florin Malita <fmalita@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Tracking and line spacing computations require knowledge of cumulative
values for the whole line => we need two passes:
1) compute cumulative values
2) compute per-fragment position adjustments
Currently, #1 is implemented in the main onSync() loop (as we iterate
to compute fragment props) and #2 is post-applied via adjustLineProps(),
after the main loop.
The problem is adjustLineProps() is executed after positioning glyphs on
path, and tracking is not taken into account for path positioning
(instead it moves glyphs horizontally, unrelated to the path).
To fix this, we need tracking adjustments to be applied before
positioning on path (which is performed in fragmentMatrix()).
- move the cumulative tracking computation to a dedicate lambda
(compute_linewide_props)
- move the fragment position adjustments to the main onSync() loop
(that way they participate in path positioning)
- to avoid executing the first pass unnecessarily, add flags to detect
the presence of tracking and line spacing animators.
Change-Id: Ieef2afb53ffe14177eba0ef41dc5c71149cab070
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518696
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
This relands commit 4d6d9e3f89.
Original change's description:
> [skottie] Max lines text auto-sizing constraint
>
> Introduce a new text property ("xl"), to limit the number of lines when
> auto-sizing.
>
> This is a Skottie extension, pending UI/controls in Bodymovin.
>
> Change-Id: Id0f1e633e1b324a97b227d6b187cd540990796a7
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518498
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
> Commit-Queue: Florin Malita <fmalita@google.com>
Change-Id: Ib9d28366332866d8b787f89fa1dc13132c02b435
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518699
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
Introduce a new text property ("xl"), to limit the number of lines when
auto-sizing.
This is a Skottie extension, pending UI/controls in Bodymovin.
Change-Id: Id0f1e633e1b324a97b227d6b187cd540990796a7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518498
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
PS1 regenerates BUILD.bazel files
I suggest reviewing the deltas between PS1 and the latest
PS to focus on the interesting bits.
The changes here allow for a Vulkan-only build of HelloWorld
based on sk_app. The toughest change was properly fetching
the VisualID after removing the gl calls that used to
fill that in.
There are a few changes that fix resolution of Dawn
header files, but those won't actually be built until
a follow-on CL.
Change-Id: I54fb58b5dd7ecd4313562aed401759b3eaed53c0
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516999
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
should not be pushed until scuba is updated (cl/431716076)
Change-Id: Ic1b6b76eb0ebd1ab0c9d7875c7b5789af39e21c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/514763
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.2 to 6.3.16.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/karma-runner/karma/releases">karma's releases</a>.</em></p>
<blockquote>
<h2>v6.3.16</h2>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.15...v6.3.16">6.3.16</a> (2022-02-10)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>security:</strong> mitigate the "Open Redirect Vulnerability" (<a href="ff7edbb2ff">ff7edbb</a>)</li>
</ul>
<h2>v6.3.15</h2>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.14...v6.3.15">6.3.15</a> (2022-02-05)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>helper:</strong> make mkdirIfNotExists helper resilient to concurrent calls (<a href="d9dade2f00">d9dade2</a>), closes <a href="https://github-redirect.dependabot.com//github-redirect.dependabot.com/karma-runner/karma-coverage/issues/434/issues/issuecomment-1017939333">karma-runner/karma-coverage#434</a></li>
</ul>
<h2>v6.3.14</h2>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.13...v6.3.14">6.3.14</a> (2022-02-05)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>remove string template from client code (<a href="91d5acda63">91d5acd</a>)</li>
<li>warn when <code>singleRun</code> and <code>autoWatch</code> are <code>false</code> (<a href="69cfc763c8">69cfc76</a>)</li>
<li><strong>security:</strong> remove XSS vulnerability in <code>returnUrl</code> query param (<a href="839578c45a">839578c</a>)</li>
</ul>
<h2>v6.3.13</h2>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.12...v6.3.13">6.3.13</a> (2022-01-31)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>deps:</strong> bump log4js to resolve security issue (<a href="5bf2df3044">5bf2df3</a>), closes <a href="https://github-redirect.dependabot.com/karma-runner/karma/issues/3751">#3751</a></li>
</ul>
<h2>v6.3.12</h2>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.11...v6.3.12">6.3.12</a> (2022-01-24)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>remove depreciation warning from log4js (<a href="41bed33bf4">41bed33</a>)</li>
</ul>
<h2>v6.3.11</h2>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.10...v6.3.11">6.3.11</a> (2022-01-13)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>deps:</strong> pin colors package to 1.4.0 due to security vulnerability (<a href="a5219c52e2">a5219c5</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/karma-runner/karma/blob/master/CHANGELOG.md">karma's changelog</a>.</em></p>
<blockquote>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.15...v6.3.16">6.3.16</a> (2022-02-10)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>security:</strong> mitigate the "Open Redirect Vulnerability" (<a href="ff7edbb2ff">ff7edbb</a>)</li>
</ul>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.14...v6.3.15">6.3.15</a> (2022-02-05)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>helper:</strong> make mkdirIfNotExists helper resilient to concurrent calls (<a href="d9dade2f00">d9dade2</a>), closes <a href="https://github-redirect.dependabot.com//github-redirect.dependabot.com/karma-runner/karma-coverage/issues/434/issues/issuecomment-1017939333">karma-runner/karma-coverage#434</a></li>
</ul>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.13...v6.3.14">6.3.14</a> (2022-02-05)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>remove string template from client code (<a href="91d5acda63">91d5acd</a>)</li>
<li>warn when <code>singleRun</code> and <code>autoWatch</code> are <code>false</code> (<a href="69cfc763c8">69cfc76</a>)</li>
<li><strong>security:</strong> remove XSS vulnerability in <code>returnUrl</code> query param (<a href="839578c45a">839578c</a>)</li>
</ul>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.12...v6.3.13">6.3.13</a> (2022-01-31)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>deps:</strong> bump log4js to resolve security issue (<a href="5bf2df3044">5bf2df3</a>), closes <a href="https://github-redirect.dependabot.com/karma-runner/karma/issues/3751">#3751</a></li>
</ul>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.11...v6.3.12">6.3.12</a> (2022-01-24)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>remove depreciation warning from log4js (<a href="41bed33bf4">41bed33</a>)</li>
</ul>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.10...v6.3.11">6.3.11</a> (2022-01-13)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>deps:</strong> pin colors package to 1.4.0 due to security vulnerability (<a href="a5219c52e2">a5219c5</a>)</li>
</ul>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.9...v6.3.10">6.3.10</a> (2022-01-08)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>logger:</strong> create parent folders if they are missing (<a href="0d24bd937f">0d24bd9</a>), closes <a href="https://github-redirect.dependabot.com/karma-runner/karma/issues/3734">#3734</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="ab4b32898b"><code>ab4b328</code></a> chore(release): 6.3.16 [skip ci]</li>
<li><a href="ff7edbb2ff"><code>ff7edbb</code></a> fix(security): mitigate the "Open Redirect Vulnerability"</li>
<li><a href="c1befa04b3"><code>c1befa0</code></a> chore(release): 6.3.15 [skip ci]</li>
<li><a href="d9dade2f00"><code>d9dade2</code></a> fix(helper): make mkdirIfNotExists helper resilient to concurrent calls</li>
<li><a href="653c762be4"><code>653c762</code></a> ci: prevent duplicate CI tasks on creating a PR</li>
<li><a href="c97e562319"><code>c97e562</code></a> chore(release): 6.3.14 [skip ci]</li>
<li><a href="91d5acda63"><code>91d5acd</code></a> fix: remove string template from client code</li>
<li><a href="69cfc763c8"><code>69cfc76</code></a> fix: warn when <code>singleRun</code> and <code>autoWatch</code> are <code>false</code></li>
<li><a href="839578c45a"><code>839578c</code></a> fix(security): remove XSS vulnerability in <code>returnUrl</code> query param</li>
<li><a href="db53785b3e"><code>db53785</code></a> chore(release): 6.3.13 [skip ci]</li>
<li>Additional commits viewable in <a href="https://github.com/karma-runner/karma/compare/v6.3.2...v6.3.16">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=karma&package-manager=npm_and_yarn&previous-version=6.3.2&new-version=6.3.16)](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/95
GitOrigin-RevId: ae940f93cbf5ebba6d02f722e0c9bc44f49c35c5
Change-Id: Ic9abd882cba29cdd130d5811f7c56fdfae9290de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/514659
Reviewed-by: Ravi Mistry <rmistry@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.14 to 6.3.16.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/karma-runner/karma/releases">karma's releases</a>.</em></p>
<blockquote>
<h2>v6.3.16</h2>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.15...v6.3.16">6.3.16</a> (2022-02-10)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>security:</strong> mitigate the "Open Redirect Vulnerability" (<a href="ff7edbb2ff">ff7edbb</a>)</li>
</ul>
<h2>v6.3.15</h2>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.14...v6.3.15">6.3.15</a> (2022-02-05)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>helper:</strong> make mkdirIfNotExists helper resilient to concurrent calls (<a href="d9dade2f00">d9dade2</a>), closes <a href="https://github-redirect.dependabot.com//github-redirect.dependabot.com/karma-runner/karma-coverage/issues/434/issues/issuecomment-1017939333">karma-runner/karma-coverage#434</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/karma-runner/karma/blob/master/CHANGELOG.md">karma's changelog</a>.</em></p>
<blockquote>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.15...v6.3.16">6.3.16</a> (2022-02-10)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>security:</strong> mitigate the "Open Redirect Vulnerability" (<a href="ff7edbb2ff">ff7edbb</a>)</li>
</ul>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.14...v6.3.15">6.3.15</a> (2022-02-05)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>helper:</strong> make mkdirIfNotExists helper resilient to concurrent calls (<a href="d9dade2f00">d9dade2</a>), closes <a href="https://github-redirect.dependabot.com//github-redirect.dependabot.com/karma-runner/karma-coverage/issues/434/issues/issuecomment-1017939333">karma-runner/karma-coverage#434</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="ab4b32898b"><code>ab4b328</code></a> chore(release): 6.3.16 [skip ci]</li>
<li><a href="ff7edbb2ff"><code>ff7edbb</code></a> fix(security): mitigate the "Open Redirect Vulnerability"</li>
<li><a href="c1befa04b3"><code>c1befa0</code></a> chore(release): 6.3.15 [skip ci]</li>
<li><a href="d9dade2f00"><code>d9dade2</code></a> fix(helper): make mkdirIfNotExists helper resilient to concurrent calls</li>
<li><a href="653c762be4"><code>653c762</code></a> ci: prevent duplicate CI tasks on creating a PR</li>
<li>See full diff in <a href="https://github.com/karma-runner/karma/compare/v6.3.14...v6.3.16">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=karma&package-manager=npm_and_yarn&previous-version=6.3.14&new-version=6.3.16)](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/94
GitOrigin-RevId: c5837dc26e0811828f7bff09b2b9ceb5fa670f84
Change-Id: I67a4ae25bc8060a4cd0e26d7ef6d5845ec75f871
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/514660
Reviewed-by: Ravi Mistry <rmistry@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
This CL makes a copy of all the files in
//modules/canvaskit/tests/ and puts them into
//modules/canvaskit/tests/bazel. They are slightly modified
to run in Bazel (renamed to be more clear what they are
and using EverythingLoaded instead of CanvasKitLoaded).
The original files will be deleted when we no longer test
CanvasKit outside of Bazel.
Suggested Review Order:
- hello_world.js is now smoke_test.js. That test polls the
gold_test_env server, but does not create an image.
- test_reporter.js which is much simplified from the non-Bazel
version (due to the removal of a bunch of PathKit stuff).
These JS tests are not the C++ gms. This means that we need
to capture the PNG ourselves, which we do using the <canvas>
API toDataURL(). This is base64 encoded, which is conveniently
the format accepted by the gold_test_env server.
- karma.bazel.js and assets/BUILD.bazel which make all the
test assets available under a shortened path /assets.
- Feel free to skip over the remaining *_test.js, as they are
basically the same as what is currently checked in, just
with the modifications above.
- Any remaining files.
Change-Id: I45fc38da38faf11f21011e7381d390e6bb299df4
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/513916
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
In order to extract the PNG files produced by our CanvasKit gms,
we need our JS tests to POST them to a server which can write to
disk. The easiest way to do this is to use the test_on_env
rule defined in the Skia Infra repo for exactly this purpose.
This required https://skia-review.googlesource.com/c/buildbot/+/510717
to be able to configure the binary correctly and
https://skia-review.googlesource.com/c/buildbot/+/511862, for nicer
debugging so the skia-infra dep was updated via the following commands:
$ go get go.skia.org/infra@d8a552a29e
$ go mod download
$ make -C infra/bots train
$ make -C bazel gazelle_update_repo
This caused many automated changes to infra/bots/tasks.json
The flow is:
1. User types bazelisk test :hello_world_test_with_env
2. The test_on_env rule starts gold_test_env and waits
for the file defined in $ENV_READY_FILE to be created.
3. gold_test_env starts a web server on a random port. It
writes this port number to $ENV_DIR/port. Then, it
creates $ENV_READY_FILE to signal ready.
4. test_on_env sees the ready file and then starts the
karma_test rule. (Reminder: this is a bash script
which starts karma using the Bazel-bundled chromium).
5. The karma_test rule runs the karma.bazel.js file (which
has been injected with some JS code to fill in Bazel
paths and settings) using Bazel-bundled node. This reads
in the port file and sets up a Karma proxy to redirect
/gold_rpc/report to http://localhost:PORT/report
6. The JS tests run via Karma (and do assertions via Jasmine).
Some tests, the gms, make POST requests to the proxy.
7. gold_test_env gets these POST requests writes the images
to a special Bazel folder on disk as defined by
$TEST_UNDECLARED_OUTPUTS_DIR.
8. test_on_env identifies that the tests finish (because the
karma_test script returns 0). It sends SIGINT to gold_test_env.
9. gold_test_env stops the webserver. The special Bazel folder
will zip up anything inside it and make it available for
future rules (e.g. a rule that will upload to Gold via goldctl).
Suggested Review Order:
- bazel/karma_test.bzl to see the test_on_env rule bundled into
the karma_test macro. I chose to put it there because it might
be confusing to have to define both a karma_test and test_on_env
rule in the same package but not be able to call one because it
will fail to talk to the server.
- gold_test_env.go to see how the appropriate files are written
to signal the environment is ready and the handlers are set up.
- karma.bazel.js to see how we make our own proxy given the
port from the env binary. The fact that we could not create
our own proxy with the existing karma_test rule was why the
chain ending in https://skia-review.googlesource.com/c/skia/+/508797
had to be abandoned.
- tests/*.js to see how the environment is probed via /healthz
and then used to make POST requests with data.
- Everything else.
Change-Id: I32a90def41796ca94cf187d640cfff8e262f85f6
BUG: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510737
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
In order to load CanvasKit, we need to add support for statically
served files. On the karma side, this is done by adding an
object [1] to the files list (example: [2]).
Then, we need to include canvaskit.js in with the karma test
files and use the callback to load canvaskit.wasm from the
correct file location.
[1] http://karma-runner.github.io/6.3/config/files.html
[2] 4f7b656012/modules/canvaskit/karma.conf.js (L13)
Change-Id: I7482d6e949a5e8efd0ca882efe5afbe0dc16c0e4
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510736
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Run the tests in headless mode and output the logs
bazel test :hello_world --test_output=all
Start up a visible web browser with the karma test driver
(need to go to Debug tab to actually run tests)
bazel run :hello_world
Suggested review order
- package.json to see the karma dependencies to run
jasmine tests on chrome and firefox.
- WORKSPACE.bazel to see how the packages listed in
package.json and package-lock.json are downloaded
into the Bazel sandbox/cache via the npm_install rule.
As mentioned in the package.json comment, the version
of build_bazel_rules_nodejs which emscripten uses [1]
is 4.4.1 and if we tried to install it ourselves, that
installation will be ignored. We also bring in hermetic
browsers via io_bazel_rules_webtesting.
- bazel/karma_test.bzl which defines a new rule _karma_test
and a macro karma_test which joins the new rule with
an existing web_test rule to run it on a hermetic browser
which Bazel downloads. This rule takes heavy inspiration
from @bazel/concatjs [2], but is much simpler and lets us
configure more things (e.g. proxies, so we can work with
test_on_env).
- karma.bazel.js, which is a pretty ordinary looking karma
configuration file [2] with effectively a JS macro
BAZEL_APPLY_SETTINGS. JS doesn't have a preprocessor or
actual macros, but this string will be replaced by the
JS code in karma_test.bzl which will set correct filepaths
for Bazel content.
- All other files.
[1] c33c7be17f/bazel/deps.bzl (L10)
[2] 700b7a3c5f/packages/concatjs/web_test/karma_web_test.bzl (L318)
[3] http://karma-runner.github.io/6.3/config/configuration-file.html
Change-Id: Id64c0a86d6be37d627762cef0beaaf23ad390ac1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/509717
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Bug: skia:12845
Change-Id: Ia03293c4efdad4c5381a713c9d7d4857b79530c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/509398
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
The one use of the define in //modules/skottie was in an old
G3 BUILD file which has since been deleted.
Change-Id: I3cbb0dd2bcbff7de433b2d044b3e7a0c34a45240
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/509400
Reviewed-by: Nathaniel Nifong <nifong@google.com>
PS1 regenerates the BUILD.bazel files
This allows us to use closure to minify the JS in canvaskit.js
Change-Id: Ib8326d2e3a19cd2168b740b6946f9165a2810133
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/509177
Reviewed-by: Ben Wagner <bungeman@google.com>
This is a reland of ecac712bec
Changes (best viewed comparing PS1 to latest)
- Use emsdk 3.1.3 which includes important bug fixes
- Remove unnecessary steps in compile.sh
- Fix use of various gn args.
- Avoid conflicts with Flutter's GN symbols
- Add/update docs
- Make activate-emsdk script compatible with our infra.
Original change's description:
> Build CanvasKit using GN/Ninja
>
> Build with
>
> ./bin/gn gen out/wasm_debug '--args=target_cpu="wasm"'
>
> or
>
> ./bin/gn gen out/wasm_release '--args=target_cpu="wasm" is_debug=false'
>
> Change-Id: Ib74586bf8397d57064a3899eaa6da76f9bce9049
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502036
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>
Change-Id: I601712a8953c2799fa029e782e097905b95e6b59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507717
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.13.0 to 1.14.8.
<details>
<summary>Commits</summary>
<ul>
<li><a href="3d81dc3237"><code>3d81dc3</code></a> Release version 1.14.8 of the npm package.</li>
<li><a href="62e546a99c"><code>62e546a</code></a> Drop confidential headers across schemes.</li>
<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>Additional commits viewable in <a href="https://github.com/follow-redirects/follow-redirects/compare/v1.13.0...v1.14.8">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.8)](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/93
GitOrigin-RevId: cd866a81a4068daa7417ff084ef9369795b57cb5
Change-Id: I6a5acd8505472d13c9e00fb7965c08632d7dffc5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/508996
Reviewed-by: Ravi Mistry <rmistry@google.com>
Bug: skia:12643
Change-Id: Id5eecb3445082e747def8c87f99a16552857af3f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506462
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Build with
./bin/gn gen out/wasm_debug '--args=target_cpu="wasm"'
or
./bin/gn gen out/wasm_release '--args=target_cpu="wasm" is_debug=false'
Change-Id: Ib74586bf8397d57064a3899eaa6da76f9bce9049
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502036
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Bug: skia:12643
Change-Id: I285d42c908c75532b78c9b80da7b6145e1b47fe7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506458
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Previously, REPORTER_ASSERT/ERRORF relied on a helper function named
`reporter_string` which papered over zero-argument and one-argument
messages (where one-argument messages are assumed to ignore printf
formatting rules entirely, and just forward the message as-is).
Replacing this helper with a direct call to `SkStringPrintf` allows
the compiler to check format arguments for correctness, but sacrifices
the one-argument special case. In practice the one-argument special
case was very rarely used, so it's not a significant sacrifice,
and this did uncover several real errors in assertion format strings
(including some cases where the wrong number of arguments was passed).
Change-Id: I4378c43b16fd8fdbf4c78d849a9f2f0a254f7abc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506617
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:12643
Change-Id: I37e1718a20283dfb814c85260257d57bac2b7b34
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506211
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
PS 1 is re-generating existing BUILD.bazel files
PS 2 is generating BUILD.bazel files for tests/gms
PS 3+ makes modifications to build all of the gms and tests.
It is recommended to view this CL with just a diff between
PS 2 and the end, due to the large amount of generated changes
in PS 1 and 2.
We make a filegroup for the gms and tests because they need
to be compiled as one large blob in order for the registries
to work. Maybe in the future we will break these up, but at least
for WASM/JS, the overhead of starting a browser for each new
test would likely grind things to a halt, so we just group them
all together for now. It's also the most similar to what we
currently do.
In gm/BUILD.bazel and tests/BUILD.bazel, we add a cc_library
that encapsulates all of the deps of the tests, so we can
easily include that the build. These were discovered via
trial and error, not anything automatic or systematic.
The is_skia_dev_build config_setting is very similar to the
GN equivalent from which it was based.
The list of gms and tests to skip (e.g. which are incompatible
with WASM) was determined by building the wasm bundle:
modules/canvaskit$ make bazel_gms_release
tools/run-wasm-gm-tests$ make run_local_debug
# Don't forget to click the button on the screen after the
# browser loads
This way of invoking the tests will be replace soon with
`bazel test <something>`. As such, I didn't bother fully
documenting the current way.
Suggested review order:
- modules/canvaskit/BUILD.bazel taking note that we always
use profiling-funcs to make the stacktraces human readable.
- gm/BUILD.bazel and tests/BUILD.bazel to see the lists of
gms/tests. Notice the tests are roughly partitioned because
we don't support things like vulkan/PDF in the wasm build
and we will want a way to not build certain tests for
certain configurations
- tools/* noting some of the cc_libraries added to make
dependencies easier to add when needed.
- All other files.
Change-Id: I43059cd93c28af1c4c12b93d6ebd9c46a12d381f
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506256
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
This reverts commit dcafc5d2bc.
Reason for revert: too disruptive for existing g3 asssets
Original change's description:
> [skottie] Visual-only text valign
>
> Historically, Skottie started with vertical alignment based on the
> typographic bounding box. This was meant to account for empty
> leading/trailing lines.
>
> At some point [1], the strategy was changed to also take the visual
> bounding box into account (union of typographic and visual bounds).
>
> It turns out this is still suboptimal: aligning based on font metrics
> yields poor results in practice, and pretty much everyone expects
> visual-only alignment.
>
> This CL is an attempt to fix things:
>
> 1) update kVisualTop/kVisualCenter/kVisualBottom to use visual bounds
> only (as their name implies)
> 2) introduce kDeprecatedVisualCenter to preserves the old behavior
> for compatibility, and use it for the legacy sk_vj flags
>
> The latter is done to minimize disruption for clients which have
> adjusted for the current misalignment: luckily they're mostly using the
> old sk_vj flag instead of explicit resize/valign policies, and they can
> continue to do so without change, while new clients can opt into the
> new/improved valign modes.
>
> The change is guarded by a build flag for g3 staging.
>
> [1] https://skia-review.googlesource.com/c/skia/+/224188
>
> Change-Id: I334c1713ce32635e3649711f072a3dcdf6b12244
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501016
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
> Commit-Queue: Florin Malita <fmalita@google.com>
Change-Id: I633dd54cd04727617e845d24a35e5e8cef64f861
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506177
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Florin Malita <fmalita@google.com>
Change-Id: Ifb387d315fdd083190128f448aadb3e54c4e3369
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505198
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Allow users to retrieve the stream from an SkTypeface, but only if that stream is inexpensive to create.
Bug: https://github.com/flutter/flutter/issues/97384
Change-Id: I9bab1a775273363500cf7482f1babeee75c5a3df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503349
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Historically, Skottie started with vertical alignment based on the
typographic bounding box. This was meant to account for empty
leading/trailing lines.
At some point [1], the strategy was changed to also take the visual
bounding box into account (union of typographic and visual bounds).
It turns out this is still suboptimal: aligning based on font metrics
yields poor results in practice, and pretty much everyone expects
visual-only alignment.
This CL is an attempt to fix things:
1) update kVisualTop/kVisualCenter/kVisualBottom to use visual bounds
only (as their name implies)
2) introduce kDeprecatedVisualCenter to preserves the old behavior
for compatibility, and use it for the legacy sk_vj flags
The latter is done to minimize disruption for clients which have
adjusted for the current misalignment: luckily they're mostly using the
old sk_vj flag instead of explicit resize/valign policies, and they can
continue to do so without change, while new clients can opt into the
new/improved valign modes.
The change is guarded by a build flag for g3 staging.
[1] https://skia-review.googlesource.com/c/skia/+/224188
Change-Id: I334c1713ce32635e3649711f072a3dcdf6b12244
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501016
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>