* Removes unnecessary static function (it's been copied elsewhere).
* Uses Caps info for colorTypeToFormat.
Bug: skia:12845
Change-Id: I557da58ec4456db1d8b1bb9a3d419e3330200a47
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525178
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
It looks like the fuzzer specified many subruns, but all were failing.
There was a TODO to exit early after the first subrun failed.
I implemented the TODO.
Bug: oss-fuzz:45704
Change-Id: I719d5bf8fa3fe8d7eb6963dbd79854dae877e7d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525176
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Originally, these radio buttons would allow the user to immediately
switch between different compile stages and view the change in output.
At some point, this broke, and clicking the radio buttons would clear
the shader list, so that the user would need to click View again to see
the shaders. This made it much harder to visualize the difference in
compilation stages at a glance.
Now the radio buttons work normally again.
Change-Id: I234c305817909c4345dd12318df3cbe4505121a8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524936
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This only needed a helper function to make error-reporting optional, but
NoOpErrorReporter (previously TrivialErrorReporter) can serve this
purpose equally well.
Change-Id: Iac249483f2013cbf8563c0ea44c680d3e03e2894
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524766
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
The builtin variable scanner did not check builtin code for the presence
of sk_FragColor, etc. We currently get away with this because none of
the existing builtin code uses a builtin variable.
Now FindAndDeclareBuiltinVariables checks shared program elements too.
Change-Id: Ifb3ee3857ef73b18d9e4f406970f0f67681dd4be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525042
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Bug: skia:12845
Change-Id: If3ac2b6ba2c8e28328ee5805a29fc83353220364
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524756
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
No visible effect yet, but this will enable better error reporting in a
future CL.
Change-Id: I09e1c5d3bb423a7ce42701f15c4bb142b0a9473c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524638
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
The toolchain now uses extract_ar from
https://skia-review.googlesource.com/c/buildbot/+/524764
which is a static executable to extract the .deb files.
This was necessary because the llvm-ar that had previously
been used requires glibc 2.31+ to run, but our Debian10
machines on Swarming have an older version (2.28).
A longer-term fix is to have Bazel support .ar files,
which I plan to attempt to contribute this week.
The RBE task will be added as an experimental CQ job, to
see how it handles the load of running often. With the
remote execution cache, I hope it performs well, once
the toolchains are cached on both the Swarming
machines and in the RBE workers.
Note: We had to add several files to the CAS spec
(see compile_cas.go) which are required for Bazel to work.
Change-Id: Ie70c70d5f33768c957760f9eeb7835025109b487
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524759
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
A new RBE worker-pool called gce_linux was created in
conjunction with this CL. See
https://docs.google.com/document/d/14xMZCKews69SSTfULhE8HDUzT5XvPwZ4CvRufEvcZ74/edit#
for some details on that.
Note: everything under bazel/rbe/gce_linux was autogenerated
and can be ignored from manual review. It basically specifies
what files are on the RBE image that are necessary for running
Bazel.
Testing it out can be done by authenticating for RBE
gcloud auth application-default login --no-browser
Then, run make -C bazel rbe_known_good_builds
to test it out.
On my 4 core laptop with an empty local cache, but a
warm remote cache, the build took <2 min instead of the
10+ minutes it would have [1].
The folder structure in //bazel/rbe is meant to let us
have multiple remote configurations there, e.g.
//bazel/rbe/gce_windows.
Suggested Review Order:
- bazel/rbe/README.md
- bazel/rbe/gce_linux_container/Dockerfile to see the
bare-bones RBE image.
- bazel/rbe/BUILD.bazel to see a custom platform defined.
It is nearly identical to the autogenerated one
in bazel/rbe/gce_linux/config/BUILD, with one extra
field to force the gce_linux pool to be used.
- .bazelrc to see the settings needed to make
--config=linux-rbe work. The naming convention was
inspired by SkCMS's setup [2], and allows us to have
some common RBE settings (i.e. config:remote) and
some specialized ones for the given host machine
(e.g. config:linux-rbe) A very important, but subtle
configuration, is on line 86 of .bazelrc where we say
to use our hermetic toolchain and not whatever C++
compiler and headers are on the host machine (aka
the RBE container).
- toolchain/build_toolchain.bzl to see some additional
dependencies needed in the toolchain (to run IWYU) which
I had installed locally but didn't realize were important.
- third_party/BUILD.bazel to see an example of how failing
to specify all files can result in something that works
locally, but fails remotely.
--execution_log_json_file=/tmp/execlog.json helped debug
these issues.
- All other files.
[1] http://go/scrcast/NjM1ODE4MDI0NzM3MTc3Nnw3ODViZmFkMi1iOA
[2] https://skia.googlesource.com/skcms/+/30c8e303800c256febb03a09fdcda7f75d119b1b/.bazelrc#20
Change-Id: Ia0a9e6a06c1a13071949ab402dc5d897df6b12e1
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524359
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
The file generation logic that dawn [1] uses to make some
source files requires jinja2, which also requires MarkupSafe.
The GN build handles this by specifying those repos in
DEPS, checking them out at a certain git hash, and then
providing them via a command line arg [2].
We do not have to do it this way in Bazel to have reproducible
builds. This CL specifies an exact version (verified by sha256)
of those two deps and then uses a hermetic version of
Python 3.9 to run all py_binary commands.
Previously, we would rely on the system Python (and installed
libraries). That happened to work on my machine, but not on
other machines without jinja2 and MarkupSafe installed. After
this CL, it should work on machines that do not have python
even installed.
I chose the same jinja2 version used by Dawn [3], which was
2.11.3. Then I chose the newest version of MarkupSafe that
was compatible with jinja2 (2.0.1).
If we have other python scripts that need external deps, we
should be able to specify them in the py_binary that needs
them and in requirements.txt. Then, the pip_install() step
in WORKSPACE.bazel will download them and make them available.
[1] https://dawn.googlesource.com/dawn.git/+/refs/heads/main/docs/dawn/overview.md
[2] https://dawn.googlesource.com/dawn.git/+/e45ff6a4b3c2f06dade68ec0f01ddc3bfd70c282/generator/generator_lib.gni#77
[3] ee69aa00ee
Change-Id: I3d0074f3003de179400e239e00107c34f35f4901
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524217
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Most of these are pretty mechanical generated changes.
IWYU noticed one issue with DSLCore.h, which was fixed here.
Change-Id: I5629565ad3c2817daa71907c62f932d93f9d78ab
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524617
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This closes one of the last gaps in SkSL's constant-folding abilities.
Change-Id: I65c0f2e5fe11a7d47ab2069b2992403fca78b8a7
Bug: skia:12819
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524761
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Arman Uguray <armansito@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
CTFontCopyVariationAxes appears to be extremely slow due to localizing
the name of the axis. WebKit moved to using the internal SPI
CTFontCopyVariationAxesInternal to avoid this cost. Since Skia would
like to avoid using internal SPI, just cache this information per
typeface to avoid the cost of calling it as often.
Bug: https://github.com/flutter/flutter/issues/100523
Bug: https://bugs.webkit.org/show_bug.cgi?id=232690
Change-Id: I175e34e9aa526d58e6b7a4ff54cb13d1ef8a9fd9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524760
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Bug: skia:12701
Change-Id: Ib7e52f26b31cfed8fb4da1929755035a69951ca5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524220
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This does not test blobs that have RSXForm, but all other text is
drawn using slugs.
This is not perfect, there are some non-text GM that are different,
and a few text GMs involving blurring that are different. But,
it's good enough to find regressions.
Change-Id: I465a697994414480e910b737270eaafb1b9fad46
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523936
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
This also reworks a little bit about what we send to insertRecording
and what we store on Context.
Bug: skia:12974
Change-Id: I747a1cdd1559d4d5fbe928e689a23a734142557b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524012
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
What affects the placement of an sbix image? The cbox? The bounding box?
The lsb? The offsets? In which direction? What are the side effects?
Change-Id: I5b630c2117a26481733392bc1e95428d9a67fb34
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/519078
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Double check sizes coming into sub run allocator.
Bug: oss-fuzz:45638
Change-Id: Ice9ab49dc0af789bf59efde270024321c5cf0f28
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521836
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Bug: skia:12787
Change-Id: I5d061d535878df55ce57add7d0831e86caadc321
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524009
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
The expression `!x ? y : z` can be optimized to `x ? z : y`, saving a
bit-not. SkVM now supports this optimization.
Change-Id: I06a0d2a716947de1021ba66b054b92e25568c641
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524226
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
SkVM has a `bit_clear` opcode dedicated to the operation `x & ~y`, but
the optimizer was not smart enough to combine a bit-and with a bit-not
and replace it with a bit-clear. Now, it can.
Change-Id: Ida5345c3def0a4bf7afa08bb7f7835e1e2e37677
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524225
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Arman Uguray <armansito@google.com>
For entirely RTL text the ellipsis expected to be on the left side.
Bug: skia:13069
Change-Id: I853687e1e741dd57af950f17717fa8553648b477
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523856
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Previously, our ID canonicalization was simply "lower ID numbers before
higher ID numbers" and was done separately at every opcode by taking
the min and max of (x.id, y.id).
Now, this logic is factored out into a helper function
`canonicalizeIdOrder` and has two rules:
- Immediate values go last; that is, "x + 1" instead of "1 + x".
- If both/neither are immediate, lower IDs before higher IDs (as
before)
This change lets us remove a lot of simplification logic. We no longer
need to check for both `x + 0` and `0 + x` when removing no-op
arithmetic; now we can be certain that the immediate will always come
last, so just checking for `x + 0` is sufficient.
Change-Id: I66cc5c23bba414041c0bc556521d3db57fac504d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524222
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This adds a way to build a wrapping canvas for testing that is allowed
to manipulate the internal state of the canvas. It provides a way
to add friends to SkCanvas without having to change SkCanvas.
Change-Id: I40de8b236ba5acff45b3a8f7e440dcf6fa196fcf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524316
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Herb Derby <herb@google.com>
SkTArray::reset() got rid of any reserved space, so previously we never
actually got to a high-water allocation. Updated the stack to use
SkTDArray just for consistency so we only had to include that instead of
<vector>, too.
Cq-Include-Trybots: luci.skia.skia.primary:Build-Mac-Clang-arm64-Debug-ASAN_Graphite,Build-Mac-Clang-arm64-Debug-Graphite,Build-Mac-Clang-arm64-Debug-Graphite_NoGpu,Build-Mac-Clang-arm64-Debug-iOS_Graphite,Build-Mac-Clang-arm64-Release-Graphite,Build-Mac-Clang-arm64-Release-iOS_Graphite,Build-Mac-Clang-x86_64-Debug-Graphite,Build-Mac-Clang-x86_64-Release-Graphite,Perf-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-Graphite,Perf-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Debug-All-ASAN_Graphite,Test-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Test-Mac12-Clang-MacBookPro16.2-GPU-IntelIrisPlus-x86_64-Debug-All-Graphite
Change-Id: I94c9a38d0e630c7d7f1a3eeeb85076067e066a2f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524000
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Users have been updated and this flag is no longer used.
Change-Id: I43442128b13c58059a5257a167075609d62e1570
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524221
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Bug: skia:12701
Change-Id: Ide780f9dac1b92855e634726d261630ef5d017fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523426
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Bug: skia:13086
Change-Id: I5276f44ee4101a05357408a206050a54ced19adc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523428
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:12974
Change-Id: I15b090e2c3346d71ccf45d5f0d306da3f079821e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523996
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Bug: skia:13086
Change-Id: I0fc3243fb3f3974a32726237358522171ae33c41
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523419
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
This is needed for accurate error reporting when we start reporting
ranges rather than line numbers.
Change-Id: If465317e04685e91ab7c408d29e82028b5d59d1a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523425
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Bug: skia:13078
Change-Id: If459a96eba09fb10e967bc364435f79b83fdc1ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522099
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This test fails on Nvidia GPUs on OpenGL due to an issue that only
affects GLSL. Disabling this test to reduce developer noise until we
have a way to re-enable it more selectively in dm.
Bug: skia:13034,skia:13035
Change-Id: I60e0d976774bd474676380583af24865e88471c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523976
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>