Commit Graph

5289 Commits

Author SHA1 Message Date
Kevin Lubick
49df61f638 Reland "[fuzzer] Remove GL from (now-Vulkan) build"
This is a reland of 805acda3f3

It fixes the #if SK_GL which was causing the Android roll
to fail.

This disables unit tests on Test-Ubuntu18-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-TSAN_Vulkan
which were consistently crashing with OOM.

Original change's description:
> [fuzzer] Remove GL from (now-Vulkan) build
>
> The fuzzer runs against the Vulkan version of Swiftshader.
> There are no libGL.so (etc) on the fuzz runtime, so we
> want to avoid linking against those.
>
> The GL code that is #ifdef'd out is still necessary to
> avoid timeouts on TSAN with our NVIDIA jobs.
> https://skia-review.googlesource.com/c/skia/+/502638
>
> Procedure for testing this locally (and iterating):
>   1. In oss-fuzz checkout, run
>      `python infra/helper.py shell skia`
>      to pull up local interactive version of Docker
>      fuzzer build image.
>   2. Run `compile` in fuzzer shell. Stop after
>      the swiftshader compiles and is copied into /out
>      with Ctrl + C.
>   3. Comment out the swiftshader compilation part [1]
>      (no need to re-do this when modifying Skia code).
>      `apt-get install nano -y`
>      `nano ../build.sh`
>   4. Make change to Skia repo using normal methods.
>   5. Run the following in the Skia repo
>      `git diff origin main > foo.patch`
>      Copy the patch into the Docker shell using Ctrl+C
>      and nano.
>   6. Apply the patch inside the Docker shell
>      `git apply foo.patch`
>      and re-compile (which should skip right to
>      building the fuzzer libs)
>      `compile`
>   7. Repeat 4-7 or make small changes directly in
>      the Docker shell via nano.
>   8. When compilation and link succeeds, run
>      `ldd /out/api_mock_gpu_canvas`
>      to verify GL and friends were not dynamically linked.
>
> [1] https://github.com/google/oss-fuzz/pull/7214/files#diff-76f13875e33875cdd372f1f0933206be599cd87952f1bd1eaa57ca928ee9e3e1R49-R53
>
> Change-Id: Idf569820527c1304b0e5a68fd36295be89dfa2a0
> Bug: oss-fuzz:44132
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503016
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Kevin Lubick <kjlubick@google.com>

Bug: oss-fuzz:44132, skia:12900
Change-Id: Ia2eff9403b0035e7f86098f296d7d9b1bbfd4876
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503716
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-02-03 18:07:47 +00:00
Greg Daniel
9a7acd43c4 [graphite] Make Context no longer ref counted.
Bug: skia:12794
Change-Id: I445144f25e9573d0d9ec55d12c3a9d372772c3bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503348
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-02-03 17:18:40 +00:00
John Stiles
ffeb6f2339 Remove SkSL::String class.
The previous CLs have removed the last significant differences between
SkSL::String and std::string. This CL removes SkSL::String entirely and
replaces it with std::string throughout the code.

Apologies for the very long CL, but I have done my best to make it as
simple and reviewable as possible. The vast majority of changes are
simple replacement of `SkSL::String` with `std::string`. In the rare
spots where code is moved from one place to another, it is logically
unchanged.

Change-Id: I39563d2db45da229f17f4504dfd63e00bde7a96e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503339
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-02-03 14:59:16 +00:00
Leon Scroggins
1351a5954f Revert "[fuzzer] Remove GL from (now-Vulkan) build"
This reverts commit 805acda3f3.

Reason for revert: Looks to be breaking the Android roll. See https://android-build.googleplex.com/builds/pending/P29733268/aosp_bramble-userdebug/latest/view/logs/build_error.log

Original change's description:
> [fuzzer] Remove GL from (now-Vulkan) build
>
> The fuzzer runs against the Vulkan version of Swiftshader.
> There are no libGL.so (etc) on the fuzz runtime, so we
> want to avoid linking against those.
>
> The GL code that is #ifdef'd out is still necessary to
> avoid timeouts on TSAN with our NVIDIA jobs.
> https://skia-review.googlesource.com/c/skia/+/502638
>
> Procedure for testing this locally (and iterating):
>   1. In oss-fuzz checkout, run
>      `python infra/helper.py shell skia`
>      to pull up local interactive version of Docker
>      fuzzer build image.
>   2. Run `compile` in fuzzer shell. Stop after
>      the swiftshader compiles and is copied into /out
>      with Ctrl + C.
>   3. Comment out the swiftshader compilation part [1]
>      (no need to re-do this when modifying Skia code).
>      `apt-get install nano -y`
>      `nano ../build.sh`
>   4. Make change to Skia repo using normal methods.
>   5. Run the following in the Skia repo
>      `git diff origin main > foo.patch`
>      Copy the patch into the Docker shell using Ctrl+C
>      and nano.
>   6. Apply the patch inside the Docker shell
>      `git apply foo.patch`
>      and re-compile (which should skip right to
>      building the fuzzer libs)
>      `compile`
>   7. Repeat 4-7 or make small changes directly in
>      the Docker shell via nano.
>   8. When compilation and link succeeds, run
>      `ldd /out/api_mock_gpu_canvas`
>      to verify GL and friends were not dynamically linked.
>
> [1] https://github.com/google/oss-fuzz/pull/7214/files#diff-76f13875e33875cdd372f1f0933206be599cd87952f1bd1eaa57ca928ee9e3e1R49-R53
>
> Change-Id: Idf569820527c1304b0e5a68fd36295be89dfa2a0
> Bug: oss-fuzz:44132
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503016
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Kevin Lubick <kjlubick@google.com>

Bug: oss-fuzz:44132
Change-Id: I3832417c60ff425572717d37dc9609419922b18e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503351
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-02-03 13:10:09 +00:00
Brian Osman
73262111f5 Revert "Reland "Remove skstd::optional entirely.""
This reverts commit d161e2f6ec.

Reason for revert: Need to wait for Flutter fix to roll into Google3.

Original change's description:
> Reland "Remove skstd::optional entirely."
>
> This reverts commit 98e51006b9.
>
> Flutter fix: https://github.com/flutter/engine/pull/31193
>
> Original change's description:
> > Revert "Remove skstd::optional entirely."
> >
> > This reverts commit 17d0fc087c.
> >
> > Reason for revert: flutter still uses the skstd class
> >
> > Original change's description:
> > > Remove skstd::optional entirely.
> > >
> > > Skia now uses C++17's std::optional.
> > >
> > > Change-Id: I387069589baaefadd25e25bcec3f4cc6ee6fd090
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501477
> > > Reviewed-by: Ben Wagner <bungeman@google.com>
> > > Reviewed-by: Brian Osman <brianosman@google.com>
> > > Commit-Queue: John Stiles <johnstiles@google.com>
> > > Auto-Submit: John Stiles <johnstiles@google.com>
> >
> > Change-Id: I2c001588007640ac7b8c9f0760038b46c220a07e
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502702
> > Auto-Submit: John Stiles <johnstiles@google.com>
> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Osman <brianosman@google.com>
>
> Change-Id: Ia0cd41eda845b02f518c501a23293d344756a4eb
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502703
> Reviewed-by: Brian Osman <brianosman@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

Change-Id: I8f89412292ba5dfe955c3f44c403c3c232cdad2b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503336
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-02-02 16:49:05 +00:00
Kevin Lubick
805acda3f3 [fuzzer] Remove GL from (now-Vulkan) build
The fuzzer runs against the Vulkan version of Swiftshader.
There are no libGL.so (etc) on the fuzz runtime, so we
want to avoid linking against those.

The GL code that is #ifdef'd out is still necessary to
avoid timeouts on TSAN with our NVIDIA jobs.
https://skia-review.googlesource.com/c/skia/+/502638

Procedure for testing this locally (and iterating):
  1. In oss-fuzz checkout, run
     `python infra/helper.py shell skia`
     to pull up local interactive version of Docker
     fuzzer build image.
  2. Run `compile` in fuzzer shell. Stop after
     the swiftshader compiles and is copied into /out
     with Ctrl + C.
  3. Comment out the swiftshader compilation part [1]
     (no need to re-do this when modifying Skia code).
     `apt-get install nano -y`
     `nano ../build.sh`
  4. Make change to Skia repo using normal methods.
  5. Run the following in the Skia repo
     `git diff origin main > foo.patch`
     Copy the patch into the Docker shell using Ctrl+C
     and nano.
  6. Apply the patch inside the Docker shell
     `git apply foo.patch`
     and re-compile (which should skip right to
     building the fuzzer libs)
     `compile`
  7. Repeat 4-7 or make small changes directly in
     the Docker shell via nano.
  8. When compilation and link succeeds, run
     `ldd /out/api_mock_gpu_canvas`
     to verify GL and friends were not dynamically linked.

[1] https://github.com/google/oss-fuzz/pull/7214/files#diff-76f13875e33875cdd372f1f0933206be599cd87952f1bd1eaa57ca928ee9e3e1R49-R53

Change-Id: Idf569820527c1304b0e5a68fd36295be89dfa2a0
Bug: oss-fuzz:44132
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/503016
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-02-02 15:43:47 +00:00
Evgenii Kliuchnikov
0dae2e870d Add MVP implementation of JPEGXL decoder.
Change-Id: I90140348eeb87c849a857a12008c201efc9e328d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/482596
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-02-02 15:17:14 +00:00
John Stiles
d161e2f6ec Reland "Remove skstd::optional entirely."
This reverts commit 98e51006b9.

Flutter fix: https://github.com/flutter/engine/pull/31193

Original change's description:
> Revert "Remove skstd::optional entirely."
>
> This reverts commit 17d0fc087c.
>
> Reason for revert: flutter still uses the skstd class
>
> Original change's description:
> > Remove skstd::optional entirely.
> >
> > Skia now uses C++17's std::optional.
> >
> > Change-Id: I387069589baaefadd25e25bcec3f4cc6ee6fd090
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501477
> > Reviewed-by: Ben Wagner <bungeman@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: John Stiles <johnstiles@google.com>
> > Auto-Submit: John Stiles <johnstiles@google.com>
>
> Change-Id: I2c001588007640ac7b8c9f0760038b46c220a07e
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502702
> Auto-Submit: John Stiles <johnstiles@google.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

Change-Id: Ia0cd41eda845b02f518c501a23293d344756a4eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502703
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-02-02 14:59:45 +00:00
John Stiles
f34afe8725 Convert appendf and vappendf to static methods.
This will make it easier to migrate from SkSL::String to std::string.
These methods can then continue to exist as free functions.

Change-Id: I9f6799788aaf42f4a95c6df03d01f9e123ae52c6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502783
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-02-02 14:18:24 +00:00
John Stiles
127d22edc3 Remove starts_with and ends_with from SkSL::String.
std::string::starts_with will be available in C++20. In the interim,
prefer using a free function in skstd. This puts us a small step closer
towards removing SkSL::String.

Change-Id: I8c6b33d94c51a643d8cb99ac4c4b1c0556cb9170
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502782
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-02-02 14:14:49 +00:00
John Stiles
074a016b89 Remove skstd::string_view entirely.
We now use std::string_view throughout. SkStringView.h has been moved to
include/private/ and is only used for our C++20/23 compatibility methods
(starts_with/ends_with/contains).

Change-Id: I961842c6778256a03868e7602d48add34f420763
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502306
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-02-01 21:16:41 +00:00
Kevin Lubick
53acf74030 [canvaskit] Fix GM tests
Change-Id: Ia6301f14af6acb875e7d17b4e0fec52dd79572db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502776
Reviewed-by: John Stiles <johnstiles@google.com>
2022-02-01 19:57:53 +00:00
John Stiles
98e51006b9 Revert "Remove skstd::optional entirely."
This reverts commit 17d0fc087c.

Reason for revert: flutter still uses the skstd class

Original change's description:
> Remove skstd::optional entirely.
>
> Skia now uses C++17's std::optional.
>
> Change-Id: I387069589baaefadd25e25bcec3f4cc6ee6fd090
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501477
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>

Change-Id: I2c001588007640ac7b8c9f0760038b46c220a07e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502702
Auto-Submit: John Stiles <johnstiles@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-02-01 18:47:44 +00:00
John Stiles
17d0fc087c Remove skstd::optional entirely.
Skia now uses C++17's std::optional.

Change-Id: I387069589baaefadd25e25bcec3f4cc6ee6fd090
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501477
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-02-01 18:30:39 +00:00
Kevin Lubick
98d664096d [bazel] Regenerate files and build with c++17
See toolchain/clang_toolchain_config.bzl for the c++17 switch.
Most of the other changes were automatically generated
(with the exception of //third_party).

Change-Id: I8c0f4b29b5967da3f48b17eb298a7e92156277ac
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502407
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2022-02-01 13:15:22 +00:00
John Stiles
1d0d1e9f16 Update iOS test apps to require C++17.
Fixes these build breaks: http://screen/5kZxPUFhoSrwpZ8

Change-Id: Ib4c92c0c33c9b0fdd639092e901f475e6f6bc655
Bug: skia:12882
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502307
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-01-31 23:17:15 +00:00
John Stiles
0f6baf469d Update CommaSideEffects test to run on GPU.
Change-Id: Ia218fb2249abd479db9d27527b965fd0b8ad3367
Bug: skia:12858
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501276
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-01-31 21:35:13 +00:00
Derek Sollenberger
3034776433 Cleanup SkQP build scripts
Change-Id: Ie226bc605baad4788976ad4c37dc455d36b11793
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/494136
Reviewed-by: Nathaniel Nifong <nifong@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2022-01-31 15:43:48 +00:00
John Stiles
a458b86c31 Enable Swiftshader for Vulkan testing on Mac.
This allows dm to run basic Vulkan tests, albeit without GPU
acceleration.

Change-Id: Idb738125ad302054be290d50f92b494d6fc6a84c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501686
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Christopher Dalton <csmartdalton@google.com>
Commit-Queue: Christopher Dalton <csmartdalton@google.com>
2022-01-28 19:14:56 +00:00
John Stiles
952bcb0732 Re-enable SkSL tests in CanvasKit/wasm.
We can disable SkSL tests on a case-by-case basis via the skip list in
`run-wasm-gm-tests.html`. This doesn't allow us to exclude by GPU, but
in practice the Golo machines tend to all have a uniform setup (with
Quadro P400s) so we can just work around failures as they come up.

Change-Id: I46f709691282e576d00d5191e9dbd46b740e4a5f
Bug: skia:12876
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501682
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-01-28 16:22:33 +00:00
John Stiles
f07421bcbd Remove unnecessary ctors now that we have C++17 copy-elision.
This CL backs out C++14 compatibility changes from
http://review.skia.org/457298 :

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

Change-Id: I33a833d33b221e757bf6a6459835a7215b4e6b66
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/501240
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-01-27 20:26:54 +00:00
Robert Phillips
1042c00130 [graphite] Replace GrSLType with SkSLType
This is mostly mechanical. The only interesting bit is that GrSLType was in include/private while SkSLType is in src/core so some #include patterns changed.

Bug: skia:12701
Change-Id: I80bd86ee93796b145f86ded9b4cbf52f24fa59e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497607
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-01-26 17:30:12 +00:00
Florin Malita
fb6d8929b2 Remove some unused vars from skqp
Change-Id: I5c3d04c17628f46c01814db6eead0337ebe68e16
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/500276
Commit-Queue: Florin Malita <fmalita@chromium.org>
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2022-01-26 17:29:42 +00:00
Nathaniel Nifong
9eb1679b77 Add regular expression capability to SKQP unittest filter
Current behavior, as an example, is to run every test not matching ".+ES3"
but this is subject to change based on Brian Osman's input

Bug: skia:12796
Change-Id: Ib798a6a6e6323ae0cf349010fce3f5982f2038bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/498976
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2022-01-25 21:39:44 +00:00
Dominik Röttsches
013397884c [tools] Add git.bat to search list
On Windows, with depot_tools, git might be a batch file called
git.bat. Add that to the default search list to make it easier
to find a git command.

Change-Id: I825432e0f7fc72c37a1f2394a68e2f3f3e65f958
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/497056
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Dominik Röttsches <drott@google.com>
2022-01-20 17:33:21 +00:00
Greg Daniel
7022d74567 [graphite] Hook up viewer
Bug: skia:12633
Change-Id: Id0bd892375e3a3e2886714f19b7fd8da2232e4e2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/479736
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-01-18 15:49:51 +00:00
Chris Dalton
fb1b30b346 Update existing SwiftShader jobs to use Vulkan instead of OpenGL
The SwiftShader OpenGL frontend is officially unsupported. They strictly
support their Vulkan frontend only.

Bug: skia:12218
Bug: skia:12820
Bug: skia:12826
Bug: skia:12829
Change-Id: Ib2e43783e18fcabfa2df9268c29bcd610350e5a2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437149
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Christopher Dalton <csmartdalton@google.com>
2022-01-14 18:05:37 +00:00
Greg Daniel
6658fd1584 In vulkan tests, use vkGetInstanceProcAddr to get vkGetDeviceProcAddr.
We've run into drivers a few times now that have bugs where they only
expose vkGetInstaneProcAddr and not vkGetDeviceProcAddr. The latest
being swiftshader (which is getting fixed). To avoid this issue in the
future we can just have our tests use vkGetInstanceProcAddr to get
vkGetDeviceProcAddr.

Change-Id: I6d73abde507519c145b873042393f50ce6c4527c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/494822
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-01-14 17:04:16 +00:00
Robert Phillips
bf489abbf6 [graphite] Add SkTileModeToStr
This is to be used in the PaintParamKey's block dumping methods.

Bug: skia:12701
Change-Id: I14de21d2d8b30e0fa69ac2e33fa975dc20f6656c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/493217
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-01-11 16:19:53 +00:00
Corentin Wallez
41e994f735 Replace uses of deprecated dawn_native::BackendType
Bug: dawn:824
Change-Id: I261c3329e53de62df83b4cca10aa9e909dd293df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/492456
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@google.com>
Commit-Queue: Stephen White <senorblanco@google.com>
2022-01-11 15:12:45 +00:00
Kevin Lubick
7a14f783bd [bazel] Sketching out HelloWorld sk_app using GL
bazel run //example:hello_world --config=clang
causes a window to open and draws a circle and a square.
Text to follow in a future CL.

To make this work, I had to get rid of musl and use glibc.
All the shared libraries (.so files) that were pre-built
and available for download (e.g. from https://packages.debian.org/bullseye/amd64/libgl1/download)
were compiled against glibc. When I tried to run a
program statically linked with musl and dynamically linked
against things using glibc, I got a segmentation fault
on things like calloc().

Initial attempts to use glibc had failed because it was thought
that the libc.so.6 file could only be referred to by absolute
path (and thus Bazel would not be happy about it). As it turns out,
that was simply a misconfiguration of the builtin_sysroot
parameter to cc_common.create_cc_toolchain_config_info
(see //toolchain/clang_toolchain_config.bzl). By setting that
to `external/clang_linux_amd64` and not
`external/clang_linux_amd64/usr`, the libc binary which had
been extracted to `external/clang_linux_amd64/lib/x86_64-linux-gnu`
was perfectly reachable from
`external/clang_linux_amd64/usr/usr/lib/x86_64-linux-gnu/libc.so`

To bring in the shared libraries to link against (e.g. X11, GL)
I made build_toolchain.bzl easier to modify in that we simply need
to add a debian download url and sha256 hash to a list (rather than
having to plumb this through via arguments).

Recommended Review Order:
 - example/BUILD.bazel (not sure if we always want to set bare
   link arguments like that or if we want to use "features" to
   pass those along to the toolchain).
 - tools/sk_app/BUILD.bazel to see initial cc_library for
   wrapping sk_app code.
 - toolchain/build_toolchain.bzl to see removal of musl and
   new list of debs.
 - toolchain/clang_toolchain_config.bzl (where use of the
   no-canonical-prefixes was key to compilation success).
   Notice also that we statically linked libc++ (I did not
   have any shared libraries for it locally, so I guessed
   a typical developer might not either).
 - Rest of toolchain/ for trivial renames.
 - bazel/Makefile to see extra docs on those targets and
   a new target that compiles all the exes so far for a
   quick way to test the build.
 - third_party/BUILD.bazel and src/gpu/BUILD.bazel which have
   non-generated changes. (all other BUILD.bazel files do).
 - go.mod, which needed to update the infra repo version in
   order to pick up http://review.skia.org/491736).

Change-Id: I8687bd227353040eca2dffa9465798d8bd395027
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/492117
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-01-11 13:06:19 +00:00
Brian Salomon
8a85ab0d96 Reland "drawVertices in GPU backend uses drawVustomMesh implementation."
This is a reland of 73657689b6

Original change's description:
> drawVertices in GPU backend uses drawVustomMesh implementation.
>
> This still allows batching across view matrix changes but does not batch
> across SkVertices that have different attributes.
>
> Bug: skia:12720
> Change-Id: I34b58e2ae3aa7330b1fe3280b9448197e2bb68b0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491047
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:12720
Change-Id: I24230e2a284b98ce71ccf034ff71d903896f1da1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/492357
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2022-01-10 23:06:15 +00:00
Derek Sollenberger
8b2513a986 Build the NDK compliant shared library to be used by JNI in SkQP.
This CL creates a new build target with a customized set of GN
flags that enable the native components of SkQP to be built using
NDK APIs.

Bug: skia:12777
Change-Id: I8341eafa7fc794cfb759045b7c7238e69c29b0a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491447
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2022-01-10 17:11:48 +00:00
Brian Osman
90263a14b5 Revert "Spruce up SkSL slide with a much nicer editor"
This reverts commit 88c5af7ecd.

Reason for revert: Various input bugs in the new editor make it somewhat unusable.

Original change's description:
> Spruce up SkSL slide with a much nicer editor
>
> Pulls in a new GitHub repo that implements a syntax-highlighting code
> editor ImGui widget.
>
> Change-Id: I968e5eb827c226259eaaad2996eeaad9de592e37
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491444
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

Change-Id: Ifa5bc87327785d107956201c4d866c7259006ec2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/492359
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-01-07 15:56:16 +00:00
Brian Osman
5bb80e1ee0 Revert "drawVertices in GPU backend uses drawVustomMesh implementation."
This reverts commit 73657689b6.

Reason for revert: Many bad GMs.

Original change's description:
> drawVertices in GPU backend uses drawVustomMesh implementation.
>
> This still allows batching across view matrix changes but does not batch
> across SkVertices that have different attributes.
>
> Bug: skia:12720
> Change-Id: I34b58e2ae3aa7330b1fe3280b9448197e2bb68b0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491047
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:12720
Change-Id: I2aa0a62323e54cb999cc89eccd72cf9b93dccba9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/492356
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-01-07 14:12:16 +00:00
Brian Salomon
73657689b6 drawVertices in GPU backend uses drawVustomMesh implementation.
This still allows batching across view matrix changes but does not batch
across SkVertices that have different attributes.

Bug: skia:12720
Change-Id: I34b58e2ae3aa7330b1fe3280b9448197e2bb68b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491047
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2022-01-06 21:05:33 +00:00
Kevin Lubick
048545d249 Set up basic hello world sk_app
Change-Id: I233e7653eadcce87067def841b2f28c700f96045
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/492096
Reviewed-by: Brian Salomon <bsalomon@google.com>
2022-01-06 20:29:35 +00:00
Kevin Lubick
96e4053be7 Update Bazel files
- Use latest emscripten toolchain (3.1.0)
 - Autogenerate the atoms and manually fix some of the file lists.
 - Add a known_good_builds target to bazel/Makefile to help
   check the things we expect to work with Bazel.

Change-Id: Ia5f51e7b9eb5c108386820ad59180c8f862f5a70
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491438
Reviewed-by: Ben Wagner <bungeman@google.com>
2022-01-06 18:10:57 +00:00
Brian Osman
88c5af7ecd Spruce up SkSL slide with a much nicer editor
Pulls in a new GitHub repo that implements a syntax-highlighting code
editor ImGui widget.

Change-Id: I968e5eb827c226259eaaad2996eeaad9de592e37
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/491444
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-01-05 20:19:49 +00:00
Derek Sollenberger
1afa5fb64b Reduce scope of SkQP to pass/fail runs of GMs and UnitTests
Going forward specific GMs can be added to the rendertest.txt
in order to do a basic pass/fail run based on whether the GM
can successfully complete without crashing.

The output of the executable was also updated to print one test
per line in order to make following its execution more readable.

Bug: skia:12777
Change-Id: I98f6fa7af765130ddf68203d62c972659fd4e325
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/489617
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2022-01-04 18:07:48 +00:00
John Stiles
d67f1f8f50 Provide bit-casted slot values from DebugTracePlayer.
Previously, the VariableData returned from a DebugTracePlayer contained
values in an int32_t, regardless of the slot's NumberKind. We had a
helper function which could stringize the bits, but otherwise the caller
was responsible for bit-casting the value manually.

Now, the DebugTracePlayer will automatically manage bit-casting for the
caller. The value returned in the VariableData is now a double (so it
is able to store an int32, uint32, or float at full precision).

This change was inspired by the recent Typescript port. (The value in
the Typescript VariableData uses a compound `number | boolean` type, so
it is able to fully represent any slot value natively.)

Change-Id: I5eec414236f76ad0ff51b0b19974e4a0025c4d62
Bug: skia:12666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/489896
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-12-29 18:30:19 +00:00
John Stiles
81134a7a62 Add checkbox to disable Shadertoy uniform support.
Generally these are harmless, but in some cases, they get in the way.
(e.g. when trying to make a minimal debug trace)

Change-Id: I2218e68c70fdbf85c3e10df232955038e2aaed29
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/488376
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-12-28 15:04:50 +00:00
John Stiles
87ced29082 Track line reachability on a step-by-step basis.
Since we know the entire flow of execution ahead of time, at any point
during trace playback, we can know if a line will be reached again or
not. We no longer highlight lines as reachable (or allow setting
breakpoints) if the line will not be reached again during trace
playback.

Change-Id: Iff563b13e2f6efb5d4f2ff37215f2ff4fb5945ed
Bug: skia:12666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/486496
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-12-22 19:33:17 +00:00
Greg Daniel
cdeb092655 [graphite] Move GrProcessorKeyBuilder to generic skgpu::KeyBuilder class.
This also allows the KeyBuilder class to be used in Graphite. In Graphite
I plan to use it for other keys besides building up shaders/processors
so I dropped that from the name. There was nothing special abouts its
implementation that made it specific to Processors anyways.

Bug: skia:12754
Change-Id: I1b25730b061f9342b61e3b2e4ac43328b8074d59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/486897
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-12-20 20:41:17 +00:00
Brian Salomon
dd9ef457d9 Reland "Add support for explicit attribute offsets and strides."
This is a reland of 6927ab9311

Original change's description:
> Add support for explicit attribute offsets and strides.
>
> Previously attribute offsets were always computed based on their
> position in an attribute array and the stride was determined
> by the offset and size of the last attribute.
>
> Now a GP has the option to create attributes with explicit offsets
> and specify an explicit vertex stride. All attributes must either
> be implicit or explicit (enforced by assert).
>
> GrGeometryProcessor::AttributeSet is now responsible for handling
> implicitly determined attribute offsets and strides. The backends
> no longer compute them.
>
> Bug: skia:12720
> Change-Id: I0211673dc70d4797c2d66b2555d8f5fb430be056
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/484736
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:12720
Change-Id: Ic4975b5b2e52f2d8213154da0e585eca6dfdd78d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/486098
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-12-20 14:50:20 +00:00
John Stiles
44a8392620 Add breakpoint support in SkSL debugger.
Line numbers were previously Text. They are now SmallButtons; clicking
them sets and clears breakpoints. The set of active breakpoints is
stored in an unordered_set of line numbers. Breakpoints are visualized
by setting the color of the SmallButton controls to red.

We now also have "Reset" (start over) and "Run to Breakpoint" buttons.

http://screen/8rtenW2vszxDgCp

Change-Id: I30a79bb09811e1d8a4e4e8535cbe62020f20f111
Bug: skia:12747
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/485861
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-12-16 20:46:56 +00:00
Brian Salomon
38d5328926 Revert "Add support for explicit attribute offsets and strides."
This reverts commit 6927ab9311.

Reason for revert: breaking roll?

Original change's description:
> Add support for explicit attribute offsets and strides.
>
> Previously attribute offsets were always computed based on their
> position in an attribute array and the stride was determined
> by the offset and size of the last attribute.
>
> Now a GP has the option to create attributes with explicit offsets
> and specify an explicit vertex stride. All attributes must either
> be implicit or explicit (enforced by assert).
>
> GrGeometryProcessor::AttributeSet is now responsible for handling
> implicitly determined attribute offsets and strides. The backends
> no longer compute them.
>
> Bug: skia:12720
> Change-Id: I0211673dc70d4797c2d66b2555d8f5fb430be056
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/484736
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:12720
Change-Id: I938bc3776d598f0906465eb2677208c79676642f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/486016
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-12-16 20:00:18 +00:00
Brian Salomon
6927ab9311 Add support for explicit attribute offsets and strides.
Previously attribute offsets were always computed based on their
position in an attribute array and the stride was determined
by the offset and size of the last attribute.

Now a GP has the option to create attributes with explicit offsets
and specify an explicit vertex stride. All attributes must either
be implicit or explicit (enforced by assert).

GrGeometryProcessor::AttributeSet is now responsible for handling
implicitly determined attribute offsets and strides. The backends
no longer compute them.

Bug: skia:12720
Change-Id: I0211673dc70d4797c2d66b2555d8f5fb430be056
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/484736
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-12-16 14:38:12 +00:00
John Stiles
eff367ac83 Highlight reached/unreached lines differently in Debugger.
This is useful to know because breakpoints can only meaningfully be set
on a line of code which is reachable. In other words, we know the
entire execution path ahead of time, so we can tell you that some
branches aren't actually taken without needing to set a breakpoint at
all.

Change-Id: I72b2cddcf92fd6f75ea12d302230bae42b7112bc
Bug: skia:12666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/485218
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-12-15 20:08:06 +00:00
John Stiles
457f1b9f41 Show the variables pane even when it is empty.
The widget layout shouldn't change when there are no variables.

Change-Id: Iedb48642486944127fa800072c1f4c57a574b513
Bug: skia:12666
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/484836
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-12-15 18:13:26 +00:00