Commit Graph

1941 Commits

Author SHA1 Message Date
Florin Malita
38b9591b5a [skottie] Add support for text stroke line join
New 'lj' text property to match BM values:

  1: miter
  2: round
  3: bevel

Change-Id: I3997c6b8c702a3f80da1cbee6cb950eca775bc77
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/517896
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2022-03-11 15:17:16 +00:00
Florin Malita
1df655a427 Reland "[skottie] Fix text-on-path tracking"
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>
2022-03-11 13:09:17 +00:00
John Stiles
333159568d Add CurrestTestHarness helper method to WasmGMTests.
Change-Id: Ifcfe69974fabf15f73ac010ab1ae6775868af629
Bug: skia:13037
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/519618
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-03-10 21:14:03 +00:00
Florin Malita
5fe4b6faeb 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>
2022-03-10 20:33:09 +00:00
Florin Malita
ca973cbea0 [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>
2022-03-10 18:19:16 +00:00
Kevin Lubick
efce17de5d Reland "[includes] Remove link between SkImage.h and SkImageEncoder.h"
This is a reland of commit f60584eb0f

Client changes:
 - https://chromium-review.googlesource.com/c/chromium/src/+/3508565
 - http://cl/433225409
 - http://cl/433450799

Original change's description:
> [includes] Remove link between SkImage.h and SkImageEncoder.h
>
> According to go/chrome-includes [1], this will save about
> 210MB (0.09%) off the Chrome build. http://screen/GVdDaRRneTRuroL
>
> [1] https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&sort=asize&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&included=&limit=1000
>
> Change-Id: If911ec283a9ce2b07c8509768a6a05446573a215
> Bug: 242216
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512416
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Kevin Lubick <kjlubick@google.com>

Bug: 242216
Change-Id: Ic61e4ac2878e7a51f389312a3a434856e2e32be3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518277
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-10 04:47:51 +00:00
Florin Malita
762f8fbcad Reland "[skottie] Max lines text auto-sizing constraint"
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>
2022-03-10 02:22:09 +00:00
Kevin Lubick
27be14f2ca [includes] Prepare to remove SkColor<->SkImageInfo
This breaks out the SkAlphaType and SkColorType enums into
their own files, which lets us break the dependency between
SkColor and SkImageInfo.

It does not yet sever the link, but we plan to land this
so as to migrate clients to the new enum files if necessary.

This is estimated to save Chrome 230 MB of build size [1]
(about 0.1%) http://screen/4dMqPC9rvAyCk6y

[1] https://commondatastorage.googleapis.com/chromium-browser-clang/chrome_includes_2022-03-08_182556.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkColor%5C.h%24&sort=asize&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkColor%5C.h%24&included=&limit=1000

Change-Id: I331d414fe2996632ab11825c1092060ff5fe2ebd
Bug: 242216
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/517678
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-09 18:40:44 +00:00
Florin Malita
4ea42a38eb Revert "[skottie] Max lines text auto-sizing constraint"
This reverts commit 4d6d9e3f89.

Reason for revert: g3 breakage

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: I8877234d4d267f553b0f07255b5db13179294b90
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518697
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>
2022-03-09 18:24:11 +00:00
Florin Malita
4d6d9e3f89 [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>
2022-03-09 16:39:54 +00:00
Kevin Lubick
7ac7413f08 [bazel] Support Vulkan
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>
2022-03-08 21:21:17 +00:00
Kevin Lubick
03f84116a8 [canvaskit] Enable Debugger bindings for autobuild
Change-Id: I12a4be7d1dabd721fd4aa82242bf646791a0b229
Bug: skia:12995
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/517677
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2022-03-08 17:42:37 +00:00
Kevin Lubick
a573cbab1a Revert "[includes] Remove link between SkImage.h and SkImageEncoder.h"
This reverts commit f60584eb0f.

Reason for revert: Chrome and G3 issues

Original change's description:
> [includes] Remove link between SkImage.h and SkImageEncoder.h
>
> According to go/chrome-includes [1], this will save about
> 210MB (0.09%) off the Chrome build. http://screen/GVdDaRRneTRuroL
>
> [1] https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&sort=asize&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&included=&limit=1000
>
> Canary-Android-Topic: image-encoder-2
> Change-Id: If911ec283a9ce2b07c8509768a6a05446573a215
> Bug: 242216
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512416
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Kevin Lubick <kjlubick@google.com>

Bug: 242216
Change-Id: Idc906ff54d8baf49989d3ee24e045d7b0ca710df
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/517676
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Kevin Lubick <kjlubick@google.com>
2022-03-08 13:09:49 +00:00
Kevin Lubick
f60584eb0f [includes] Remove link between SkImage.h and SkImageEncoder.h
According to go/chrome-includes [1], this will save about
210MB (0.09%) off the Chrome build. http://screen/GVdDaRRneTRuroL

[1] https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&sort=asize&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fcore%2FSkImage%5C.h%24&included=&limit=1000

Canary-Android-Topic: image-encoder-2
Change-Id: If911ec283a9ce2b07c8509768a6a05446573a215
Bug: 242216
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512416
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-07 21:32:13 +00:00
Kevin Lubick
2d86f6f5db Reland "[includes] Remove include link between SkPathRef.h and SkRRect.h"
This is a reland of 37b8239bec

Upstack changes:
 - http://ag/17004908
 - https://github.com/flutter/engine/pull/31654

Original change's description:
> [includes] Remove include link between SkPathRef.h and SkRRect.h
>
> According to go/chrome-includes [1], this will save about
> 40MB (0.02%) off the Chrome build. http://screen/4GnPjFaYpwCVHVL
>
> I'm not quite sure why the link is so expensive, but we can
> forward declare it and move the implementation from the .h
> to the .cpp file easily enough.
>
> [1] https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fprivate%2FSkPathRef%5C.h%24&sort=includes&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fprivate%2FSkPathRef%5C.h%24&included=&limit=1000
>
> Canary-Chromium-CL: 3485346
> Change-Id: Ie3a5e7a735426f883a6c06ddbd3b8bf148bf1709
> Bug: 242216
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512158
> Reviewed-by: Robert Phillips <robertphillips@google.com>

Bug: 242216
Change-Id: I31288895528251fd59913427b95b9f88a871d14b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512776
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-07 15:15:05 +00:00
Nathaniel Nifong
3bf76ab829 Add debugger as an optional module in canvaskit
Change-Id: I7d866aab2a74bbb4c8d4f2cf7901d4b679c0cbe9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/515516
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2022-03-03 21:06:17 +00:00
Jorge Betancourt
c8e520e722 remove scaled stroke guards
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>
2022-03-03 20:41:29 +00:00
Jorge Betancourt
bf9bc6de39 [skottie] scale stroke on text layers after shaping
Change-Id: I657e1ad43dc440fe8b24f690674308ec9b312e9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/514956
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2022-03-03 16:18:16 +00:00
dependabot[bot]
98b1cc92c7 Bump karma from 6.3.2 to 6.3.16 in /modules/canvaskit
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 &quot;Open Redirect Vulnerability&quot; (<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 &quot;Open Redirect Vulnerability&quot; (<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 &quot;Open Redirect Vulnerability&quot;</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>
2022-03-02 14:36:51 +00:00
dependabot[bot]
1c167606cc Bump karma from 6.3.14 to 6.3.16 in /modules/pathkit
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 &quot;Open Redirect Vulnerability&quot; (<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 &quot;Open Redirect Vulnerability&quot; (<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 &quot;Open Redirect Vulnerability&quot;</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>
2022-03-02 14:36:39 +00:00
Jorge Betancourt
4bf57f8958 Revert "[skottie] scale stroke on dynamic text layers"
This reverts commit d5c24c72dc.

Reason for revert: Scuba test blocking g3

Original change's description:
> [skottie] scale stroke on dynamic text layers
>
> initial commit for scaled stroke on text in skottie
>
> Change-Id: Iedce77833e12b2b5d8bc27161392b87a428efe8e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/513759
> Reviewed-by: Florin Malita <fmalita@google.com>
> Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>

Change-Id: Ia1dba3f206e5b12168e2e82ba608db943af26c78
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/514219
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2022-03-01 18:12:24 +00:00
Jorge Betancourt
d5c24c72dc [skottie] scale stroke on dynamic text layers
initial commit for scaled stroke on text in skottie

Change-Id: Iedce77833e12b2b5d8bc27161392b87a428efe8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/513759
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2022-02-28 22:13:14 +00:00
Kevin Lubick
1fc0c1c0f8 [canvaskit] Run JS tests in Bazel
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>
2022-02-28 21:30:21 +00:00
Kevin Lubick
acab911351 [bazel] Make use of test_on_env to spin up server for gms
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>
2022-02-28 14:05:54 +00:00
Kevin Lubick
32b1e5d861 Revert "[includes] Remove include link between SkPathRef.h and SkRRect.h"
This reverts commit 37b8239bec.

Reason for revert: Need to update clients, including Flutter

Original change's description:
> [includes] Remove include link between SkPathRef.h and SkRRect.h
>
> According to go/chrome-includes [1], this will save about
> 40MB (0.02%) off the Chrome build. http://screen/4GnPjFaYpwCVHVL
>
> I'm not quite sure why the link is so expensive, but we can
> forward declare it and move the implementation from the .h
> to the .cpp file easily enough.
>
> [1] https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fprivate%2FSkPathRef%5C.h%24&sort=includes&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fprivate%2FSkPathRef%5C.h%24&included=&limit=1000
>
> Canary-Chromium-CL: 3485346
> Change-Id: Ie3a5e7a735426f883a6c06ddbd3b8bf148bf1709
> Bug: 242216
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512158
> Reviewed-by: Robert Phillips <robertphillips@google.com>

Bug: 242216
Change-Id: I226c45326b67dff3eb1dc1f96c11e9ef0a12e22b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512639
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-02-24 12:55:26 +00:00
Kevin Lubick
37b8239bec [includes] Remove include link between SkPathRef.h and SkRRect.h
According to go/chrome-includes [1], this will save about
40MB (0.02%) off the Chrome build. http://screen/4GnPjFaYpwCVHVL

I'm not quite sure why the link is so expensive, but we can
forward declare it and move the implementation from the .h
to the .cpp file easily enough.

[1] https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges&filter=%5Ethird_party%2Fskia%2Finclude%2Fprivate%2FSkPathRef%5C.h%24&sort=includes&reverse=&includer=%5Ethird_party%2Fskia%2Finclude%2Fprivate%2FSkPathRef%5C.h%24&included=&limit=1000

Canary-Chromium-CL: 3485346
Change-Id: Ie3a5e7a735426f883a6c06ddbd3b8bf148bf1709
Bug: 242216
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512158
Reviewed-by: Robert Phillips <robertphillips@google.com>
2022-02-23 22:46:44 +00:00
Kevin Lubick
e1c79a9189 [canvaskit] Add legacy drawvertices mode to npm build
Should help with https://github.com/flutter/flutter/issues/98531
until Flutter removes c25fd021ed/gn/flutter_defines.gni (L17)

Change-Id: I151c17dbea969b787fb785b999f9d760ae3b25ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/511976
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Yegor Jbanov <yjbanov@google.com>
2022-02-23 19:38:18 +00:00
Harry Terkelsen
fe13e83056 Touch up CanvasKit build
Change-Id: I7ea4428787c69b4045a234403d8ca33c2aff2b7d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/511876
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2022-02-23 18:58:40 +00:00
Kevin Lubick
bf4b034027 [bazel] Show CanvasKit can be loaded in POC karma_test
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>
2022-02-23 14:53:01 +00:00
Kevin Lubick
a2d3958e1f [bazel] Make custom karma_test rule
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>
2022-02-23 14:53:01 +00:00
Julia Lavrova
0861eaf302 Fixing getRectForRange in case with ellipsis
Bug: skia:510084
Change-Id: I49cd012676347f298cce885827546a781698ba97
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510857
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2022-02-22 18:43:20 +00:00
Jim Van Verth
d6245fc4aa Rename GrSwizzle to skgpu::Swizzle
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>
2022-02-16 13:30:14 +00:00
Kevin Lubick
149938e8e3 [canvaskit] Rename some CK-specific defines
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>
2022-02-15 22:42:17 +00:00
Kevin Lubick
7f568e968e [bazel] Update to use emsdk 3.1.4
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>
2022-02-15 17:47:03 +00:00
Kevin Lubick
c13cd6479d Reland "Build CanvasKit using GN/Ninja"
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>
2022-02-15 16:31:10 +00:00
dependabot[bot]
9fae1e741e Bump follow-redirects from 1.13.0 to 1.14.8 in /modules/canvaskit
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>
2022-02-15 13:42:38 +00:00
dependabot[bot]
3f2effdbdc Bump karma from 5.2.3 to 6.3.14 in /modules/pathkit
Bumps [karma](https://github.com/karma-runner/karma) from 5.2.3 to 6.3.14.
<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.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>
<h2>v6.3.10</h2>
<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>
<h2>v6.3.9</h2>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.8...v6.3.9">6.3.9</a> (2021-11-16)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>restartOnFileChange option not restarting the test run (<a href="92ffe60184">92ffe60</a>), closes <a href="https://github-redirect.dependabot.com/karma-runner/karma/issues/27">#27</a> <a href="https://github-redirect.dependabot.com/karma-runner/karma/issues/3724">#3724</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.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>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.8...v6.3.9">6.3.9</a> (2021-11-16)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>restartOnFileChange option not restarting the test run (<a href="92ffe60184">92ffe60</a>), closes <a href="https://github-redirect.dependabot.com/karma-runner/karma/issues/27">#27</a> <a href="https://github-redirect.dependabot.com/karma-runner/karma/issues/3724">#3724</a></li>
</ul>
<h2><a href="https://github.com/karma-runner/karma/compare/v6.3.7...v6.3.8">6.3.8</a> (2021-11-07)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>reporter:</strong> warning if stack trace contains generated code invocation (<a href="4f23b14d3e">4f23b14</a>)</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<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><a href="5bf2df3044"><code>5bf2df3</code></a> fix(deps): bump log4js to resolve security issue</li>
<li><a href="36ad678320"><code>36ad678</code></a> chore(release): 6.3.12 [skip ci]</li>
<li><a href="41bed33bf4"><code>41bed33</code></a> fix: remove depreciation warning from log4js</li>
<li><a href="c985155a4e"><code>c985155</code></a> docs: create security.md</li>
<li><a href="c96f0c5529"><code>c96f0c5</code></a> chore(release): 6.3.11 [skip ci]</li>
<li>Additional commits viewable in <a href="https://github.com/karma-runner/karma/compare/v5.2.3...v6.3.14">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=5.2.3&new-version=6.3.14)](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/92

GitOrigin-RevId: 3ea60ab04fd34441badcf9d6aaa4961cffacdf56
Change-Id: I6f6174fe27ae93d4774a299ca8769a4105395780
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507618
Reviewed-by: Ravi Mistry <rmistry@google.com>
2022-02-13 15:18:03 +00:00
Brian Osman
40d7426345 Remove isOpaque from SkRuntimeEffect::makeShader signature
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>
2022-02-11 16:05:01 +00:00
Kevin Lubick
a59af6e4f2 Revert "Build CanvasKit using GN/Ninja"
This reverts commit ecac712bec.

Reason for revert: possibly breaking flutter, definitely breaking docker wasm builds

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: I04dbb3b1cff7511064f603d7dc7c8a4168bf0d56
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507616
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-02-11 13:35:19 +00:00
Harry Terkelsen
ecac712bec 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>
2022-02-11 13:05:44 +00:00
Kevin Lubick
7b5c0de7ce [canvaskit] Improve error when non-matrix argument passed in
Follow-up to https://skia-review.googlesource.com/c/skia/+/506458

This will also make closure not rename the DOMmatrix arguments
(it wasn't happening, but it could have).

Change-Id: Id2e141ce777579d12c5c45a3bfe9661602fed3e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506976
Reviewed-by: Brian Osman <brianosman@google.com>
2022-02-10 17:15:55 +00:00
Brian Osman
77326adc07 Remove isOpaque parameter from CanvasKit SkRuntimeEffect APIs
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>
2022-02-10 17:15:13 +00:00
John Stiles
2122f40c4b Update REPORTER_ASSERT/ERRORF to check format strings.
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>
2022-02-10 16:37:05 +00:00
Brian Osman
cd189e8a1d Remove default/deprecated arguments to makeShader calls
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>
2022-02-09 20:41:23 +00:00
Kevin Lubick
0fac7baa61 Remove experimental/xform
Requires cr/427505724 to land also.

Change-Id: I88465a234b48abf4b1ac97146c8adcf9638babd0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506396
Reviewed-by: Brian Osman <brianosman@google.com>
2022-02-09 19:56:49 +00:00
Kevin Lubick
9cb74e9079 [bazel] Compile gms for wasm and WebGL
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>
2022-02-09 18:56:17 +00:00
Florin Malita
e5d7a8ec89 Revert "[skottie] Visual-only text valign"
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>
2022-02-09 14:42:14 +00:00
Herb Derby
2562144c11 rename fontID to typefaceID
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>
2022-02-07 20:12:39 +00:00
Julia Lavrova
14f559fd23 Add SkTypeface::openExistingStream.
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>
2022-02-07 17:06:09 +00:00
Florin Malita
dcafc5d2bc [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>
2022-02-07 17:04:17 +00:00