Commit Graph

5480 Commits

Author SHA1 Message Date
Ben Wagner
32871e6901 Use os.path.normcase in git-sync-deps
Avoid strange issues with path case insensitivity on Windows with
os.path.normcase.

Change-Id: I9327ba9c22cf5e3ff66b49af56bedd223b24efd4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/556025
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2022-07-06 18:32:50 +00:00
Kevin Lubick
52904d35ab Make copy of skcms checkout in //modules/skcms
This will make our Bazel rules in G3 easier to use.

We will have to clean up a lot of clients (and this still
might require a manual G3 roll to land to account for the
source files).

Eventually, we will be able to delete the old one
//include/third_party/skcms and //third_party/skcms

Bug: skia:12451, b/237076898
Change-Id: I9fd55607cbb7e1196d175aa8f140e99a73505c89
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/554056
Reviewed-by: Brian Salomon <bsalomon@google.com>
2022-06-30 12:05:13 +00:00
Herb Derby
b780fc21c3 Replace SK_ARRAY_COUNT with std::size() for skia/tools
Change-Id: I7db855e675b2ece5d3cf6f237beae3294ffa1e72
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553589
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-06-28 14:42:07 +00:00
Kevin Lubick
cc91f7d709 [bazel] Fix toolchains on M1 Mac
These changes are necessary to use the toolchain on both the
M1 Mac and Intel Macs.

This adds a way to detect the host platform and choose different
compile options in the toolchain.

We cannot statically link in libc++.a from the clang zip because
it appears to be x64 only.

Finally, this fixes copts not being passed to objective c libraries.

Known issue:
 - Intel Mac building has an error about the default CC toolchain.

Change-Id: Ie8e5e83dc41513563ac684e70a8a6947b36df445
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/552472
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2022-06-27 14:02:49 +00:00
Jim Van Verth
79e12af879 [graphite] Fix assert in Viewer when displaying anisomips GM.
The anisomips GM appears to snap an image from a surface and samples it.
Because we haven't implemented that yet, validation of that texture
fails, which in turns means we don't insert a Recording into the
Context, and hence that Context has no CommandBuffer.

Added a message when we fail to validate TextureInfo, and pushed the
CommandBuffer submit in GraphiteMetalWindowContext inside the block
that checks to see if we have a Recording.

Change-Id: I74d8886a56ff703f7550bde321a4c3efbac66f30
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550708
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2022-06-22 21:39:29 +00:00
Brian Salomon
915cad6282 GrGLInterface requires glCopyBufferSubData if supported by context
Supporting Chrome change landed here:
https://chromium-review.googlesource.com/c/chromium/src/+/3710691

Bug: skia:13427
Bug: skia:12720
Change-Id: I87f5ac27723287945b4f7b0df82c7188733a4fb2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550711
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2022-06-21 19:32:01 +00:00
Jorge Betancourt
c327d1054a reland "set up GL sample app to build through Bazel Mac toolchain"
https://skia-review.googlesource.com/c/skia/+/549897

G3 error fixed with:
https://critique.corp.google.com/cl/456234733

Introduces tracking bug:
https://bugs.chromium.org/p/skia/issues/detail?id=13452

Suggested review order.
1) tools/sk_app/* and src/gpu/ganesh/*
sets up the actual target to be built by the toolchain
2) toolchain/* and .bazelrc
changes to the mac hermetic toolchain, including support for framework dependencies, objc compilation, and dynamic lib dependency resolution

Change-Id: Id31e0adb134d385cbb4af6818f2c25c4fdae9598
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/551881
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2022-06-21 19:22:16 +00:00
Herb Derby
1aea903381 Reland "Move SkSubRun to src/text"
Added changes for public.bzl

This is a reland of commit 4a375fe213

Original change's description:
> Move SkSubRun to src/text
>
> Change-Id: I5c1040b8236dc792de20495a3fea3c0be6e31c20
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549847
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

Change-Id: I86e342a416a3c97bf972c496b93b37e35cd09c19
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550496
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-06-18 17:20:42 +00:00
John Stiles
03b2e3aeee Revert "set up GL sample app to build through Bazel Mac toolchain"
This reverts commit 9be648ad64.

Reason for revert: breaking G3 roll

Original change's description:
> set up GL sample app to build through Bazel Mac toolchain
>
> Suggested review order.
> 1) tools/sk_app/* and src/gpu/ganesh/*
> sets up the actual target to be built by the toolchain
> 2) toolchain/* and .bazelrc
> changes to the mac hermetic toolchain, including support for framework dependencies, objc compilation, and dynamic lib dependency resolution
>
> Change-Id: Ic8209b97a0d8448f984d43a579e600ba4e9118e1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549897
> Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

Change-Id: I5414b94f2c6175ea8c7dbc6cd72c7dd8d1b47892
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/551236
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-06-17 20:07:06 +00:00
Jorge Betancourt
9be648ad64 set up GL sample app to build through Bazel Mac toolchain
Suggested review order.
1) tools/sk_app/* and src/gpu/ganesh/*
sets up the actual target to be built by the toolchain
2) toolchain/* and .bazelrc
changes to the mac hermetic toolchain, including support for framework dependencies, objc compilation, and dynamic lib dependency resolution

Change-Id: Ic8209b97a0d8448f984d43a579e600ba4e9118e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549897
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2022-06-17 13:54:14 +00:00
Brian Salomon
00bead8e63 Add glCopyBufferSubData to GrGLInterface
Will be used in SkMesh buffer update API and likely for unit testing of changes related to Issue 13427.

Bug: skia:13427
Bug: skia:12720

Change-Id: I487ee512d4b8bb61c533c7047bdbffcde9779885
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549570
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2022-06-16 18:12:23 +00:00
John Stiles
008d60e58c Revert "Move SkSubRun to src/text"
This reverts commit 4a375fe213.

Reason for revert: breaks google3, probably needs public.bzl fix

Original change's description:
> Move SkSubRun to src/text
>
> Change-Id: I5c1040b8236dc792de20495a3fea3c0be6e31c20
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549847
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

Change-Id: Ic6f3ecd81e2bfd03320f820bb5301b0d1c5d6c9a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550181
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-06-15 22:33:12 +00:00
Herb Derby
4a375fe213 Move SkSubRun to src/text
Change-Id: I5c1040b8236dc792de20495a3fea3c0be6e31c20
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549847
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-06-15 20:37:16 +00:00
Ethan Nicholas
4144b8abb4 Added preliminary SkSL Metal compute shader support
This adds mostly-functional compute shader output to SkSL. This does not
add overall compute shader support to Skia; it still needs to be
integrated into the Skia pipeline before it is possible to actually use
compute shaders in practice.

Change-Id: Ic5c69863704f141d16bb191224a817e44f4a8565
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539060
Reviewed-by: Arman Uguray <armansito@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-06-15 18:52:42 +00:00
Herb Derby
8ccbeeebc3 Remove SkMakeSpan
Change-Id: I33121076bac3ceca19c81ff9fb47e4b024a14230
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549838
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-06-15 17:26:32 +00:00
Nicolette Prevost
29dffe9ba4 Reland "Add Perfetto library (gn & bazel) and bare-bones SkPerfTrace class"
This reverts commit d78d52a86f.

That reason this CL was reverted in the first place is that it broke the Android roller - perfetto.h could not be located.
We now disable the use of perfetto for Android in the gn_to_bp.py script, so the roller should be good to go.

Reason for revert: Relanding

Original change's description:
> Revert "Add Perfetto library (gn & bazel) and bare-bones SkPerfTrace class"
>
> This reverts commit bfc9b94840.
>
> Reason for revert: new dependency causing Android build error
>
> Original change's description:
> > Add Perfetto library (gn & bazel) and bare-bones SkPerfTrace class
> >
> > First incremental step to incorporating Perfetto tracing into Skia, more CLs to follow
> >
> > NOTE: The presubmit check is failing. This appears to be due to the known issue where the presubmit check bugs out if the DEPS file is edited, which it was on this CL (modified to include Perfetto).
> >
> > Bug: skia:13303
> > Change-Id: I908be0392b520e8da14b34588b842bf6d955bd93
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/543081
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Nicolette Prevost <nicolettep@google.com>
>
> Bug: skia:13303
> Change-Id: Ia2b883bbab1f8fb4f3914b63104a39240cc60e86
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/544239
> Reviewed-by: Tyler Denniston <tdenniston@google.com>
> Auto-Submit: Tyler Denniston <tdenniston@google.com>
> Reviewed-by: Nicolette Prevost <nicolettep@google.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Tyler Denniston <tdenniston@google.com>

Bug: skia:13303
Change-Id: Ibd369b9c8c0e69fc9615fc05cf588ee4440c8ed5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/544244
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Nicolette Prevost <nicolettep@google.com>
2022-06-15 16:35:05 +00:00
John Stiles
061a80c264 Update color-space flags to avoid shutdown destructors.
Note that both `unordered_map` and `sk_sp` had non-trivial
destructors.

Change-Id: I39ffc2193c7935e71aab9b5c7474a64b5f93f753
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550176
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-06-15 14:15:16 +00:00
Jim Van Verth
6ed17ef4c5 Fix some remaining SK_GRAPHITE_ENABLED defines.
Change-Id: I7a4cd8e2c629ba53e40adc379ea92f86f70d11da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549857
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
2022-06-14 17:24:53 +00:00
Jim Van Verth
56e6286317 [graphite] Add ContextOptions
Bug: skia:13118
Change-Id: I0d6e0a9f542680456d3de82a32376722c5b9cd1d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549097
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2022-06-14 15:39:21 +00:00
Ben Wagner
f15f78c905 [debugger] Handle '\0' and such in json strings.
This allows mskps produced with Chromium to be displayed in the
debugger. Previously, the debugger would produce invalid json if any
string contained characters which needed to be escaped. The debugger
also treated all strings like NULL terminated strings, but json is
Unicode based and code point U+0000 is a perfectly good code point.

Change-Id: I28150bad666b02be9f1e4af4078a4ca1e65bf000
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/549098
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2022-06-11 17:49:01 +00:00
Aditya Kushwah
8397375ef8 [Part 1]: Update the label string.
In this CL:
1. Replace the empty label string with the label name for
different Skia components.
2. If the label string is empty, avoid sending it.
3. Append "_Skia_" at the beginning of the label string.

Bug: chromium:1164111
Change-Id: I8154f960591f0c001c6746f25e1939e0eb65d7fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/548516
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-06-09 20:13:50 +00:00
Aditya Kushwah
fd86891407 Implement onSetLabel method.
In this CL, the GrSurfaceProxy's and GrDrawOpAtlas's label strings
are plumbed so that it can be stored in the label string of
GrGpuResource. onSetLabel method, which is called from setLabel
method of GrGpuResource, will pass labels to Skia OpenGL backend
using ANGLE's labeling API.

Bug: chromium:1164111
Change-Id: I516c06f0ebbf6bbe6d31ea5a4a64b2baeedd1560
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/545717
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2022-06-08 18:43:34 +00:00
John Stiles
2a376045ca Remove accessor functions from ShaderCaps.
Change-Id: Ifc4616c99bddd7d40d5a0bd2dd3c57bfb973500f
Bug: skia:12559
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/547825
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2022-06-08 14:16:07 +00:00
John Stiles
fd40889786 Disable SkSLStructFieldNoFolding test in wasm-gm-tests.
It fails on the Nvidia Linux GLSL drivers used in the Golo.

Change-Id: I79cfbb9955aef6a6a57d22c82ab94a657434be7d
Bug: skia:13395
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/547447
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-06-07 14:48:49 +00:00
Greg Daniel
3ee928de80 Fix checks for vk ycbcr helper support in tests.
We need to make sure we have the required chroma sampling options for the
format.

Bug: skia:12820, skia:13265
Change-Id: I6e0d0f9b50a5730ecbe5de2626bf1d1ee1051d7a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/546861
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-06-06 14:23:18 +00:00
Robert Phillips
a7b8e3fb75 [graphite] remove 'testPrecompile' from Graphite config options
Change-Id: I2f8c35c6d65d73f2778c3a8f32d7cfb823a64d2c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/546199
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-06-06 14:16:39 +00:00
Kevin Lubick
ee62fad9a4 [bazel] Add "skia_internal" target that exposes private API for tests/tools.
Organization v3.5, if we are keeping track :)

This splits the "srcs" filegroup into "srcs" and "private_hdrs",
and renames "hdrs" to "public_hdrs".

To assist with the split, I created the macro split_srcs_and_hdrs.
Rather than keep two separate lists of header and source files,
I figured it would be easiest, at least for the common case,
to keep one list of files and then have a for loop split them
apart. I've tried to be consistent with having the list
of files be named with a _FILES suffix - maybe we can use this
as a marker to generate .gni files in the future?

Suggested review order:
 - //bazel/macros.bzl. Note this needs a corresponding
   G3 change (http://cl/452279799) as well. The exports_files_legacy
   change is the better approach to something I manually
   handled yesterday when fixing the G3 roll.
 - //BUILD.bazel to see the new target skia_internal and
   the previous skia_core renamed to skia_public.
 - //src/core/BUILD.bazel to see a typical usage of
   split_srcs_and_hdrs.
 - //include/... to see the change to public_hdrs and
   private_hdrs
 - //src/... to see many more usages of split_srcs_and_hdrs
 - //tools/... to see changes to skia_internal where
   appropriate.
 - Everything else. Note that //modules/... might also need
   to be built with skia_internal instead of skia_public,
   but we can fix that up later, if necessary.

Change-Id: Ie1cc969455d97b029b2d77faa222c4a9bad70671
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/545716
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2022-06-02 11:23:50 +00:00
Kevin Lubick
c123b5a93d [bazel] Add rules for CanvasKit and dependent modules
This may look like a lot, but //modules/canvaskit/BUILD.bazel
is nearly identical to how it was with gazelle:
162dfca340/modules/canvaskit/BUILD.bazel

I removed the "wasm_gm_tests" targets from it, because they
had bitrotted slightly and fixing them is its own task.

CanvasKit depends on Skottie and Particles, which depend on
the SkParagraph, SkShaper, SkUnicode, and SkResources modules.

I've structured the BUILD.bazel files in the //modules directory
in a similar fashion as the "hierarchical filegroup"
introduced in https://skia-review.googlesource.com/c/skia/+/543977

Suggested Review Order
 - //modules/skottie/...
 - //modules/skparagraph/...
 - all other modules.
 - Note that modules/canvaskit/go/gold_test_env/BUILD.bazel is
   generated from gazelle, because we like how gazelle handles
   golang files and deps.
 - All other files in any order.

Change-Id: I0aa9e6f81dba2c00f15cae7b19fe49a2027dcf1d
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/544676
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2022-05-31 14:14:54 +00:00
Kevin Lubick
5810c7ad0b [bazel] Add new rules for various tools
This adds or fixes rules to build three binaries that previously
had Bazel support.

How we build skslc with Bazel differs from GN in a large way:
GN has a small set of C++ files [1] it compiles in, but with
Bazel that was too hard/clumsy to pipe through (and get the
headers to work well). So, I just had skslc depend on
//:skia_core for simplicity. skslc did need to include something
in //src, so I made a special filegroup for it. For more
complex executables that need more headers from //src, we
should probably make a "src_hdrs" filegroup or something
to expose those. That or a skia_for_tests cc_library that
has all headers as "public".

[1] https://github.com/google/skia/blob/main/gn/sksl.gni#L235
Change-Id: Ie1382e982228059369886f4bfef4947f686b11b5
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/544637
Reviewed-by: Ben Wagner <bungeman@google.com>
2022-05-31 14:14:54 +00:00
Kevin Lubick
956704b387 [bazel] Get GPU examples working
This adds targets which test our Dawn, GL, and Vulkan backends.

It follows the hierarchical filegroup pattern, as
outlined in https://skia-review.googlesource.com/c/skia/+/543977

Suggested Review order:
 - tools/sk_app/BUILD.bazel. For many things in tools, I anticipate
   they will depend on //:skia_core and other //tools targets.
   sk_app shows this off, as well how to make the target
   specific to a given platform and pull in the proper native code.
   I'm trying out setting test_only = True, to see if we can
   partition Skia's tests and helpers from the actual Skia library.
 - other changes to //tools/, especially looking at sk_app's
   dependencies.
 - //example/BUILD.bazel. This uses the cc_binary_with_flags which
   existed previously [1] to make it so people don't have to
   specify all the flags for a given binary and can build it as is.
   These targets nows how up in //bazel/Makefile
 - //include/... and //src/..., where some typos from previous
   CLs were fixed and rules expanded.
 - Misc changes to .cpp files to remove unnecessary includes
   that were assuming the GL backend was being compiled in.
 - All other changes

[1] 162dfca340/bazel/cc_binary_with_flags.bzl
Change-Id: Ieacec464d44368cad0da0890c7dc85a6c0b900c9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/544317
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2022-05-31 14:14:54 +00:00
Kevin Lubick
4511c7b7fb [bazel] Delete gazelle-based BUILD.bazel files
gazelle ended up being more liability than asset for our C++ rules.

It required devs to manually run the command frequently (and was
easy to forget until the CQ failed). The fact that we still had to
edit the source files (e.g. the "srcs" cc_libraries) meant that
the mixture between generated and hand-written caused some
tension (see include/third_party/vulkan for a good example).

The combination of gazelle and our IWYU enforcement added several
bits of churn without any real benefit. The generated rules
also didn't help identify cases where we were not keeping tight
boundaries (e.g. non-gpu code and gpu code).

Identifying third_party deps automatically ended up being trickier
than anticipated (see the deleted //third_party/file_map_for_bazel.json)

Using the "maximum set of dependencies" worked ok, but ended up
increasing build time unnecessarily. For example, compiling
CanvasKit for WebGL always needed to compile Dawn because
SkSLCompiler.cpp sometimes needs to include tint/tint.h.

Follow-up CLs will rebuild the BUILD.bazel rules without gazelle.

Note to Reviewers:
 - The only file worth manually reviewing here is bazel/Makefile.

Change-Id: I36d6fc3747487fabaf699690780c95f1f6765770
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/543976
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2022-05-31 14:14:54 +00:00
Jorge Betancourt
13fda2a4e7 implement animatable particle drawables
this change relands: https://skia-review.googlesource.com/c/skia/+/538042

It addresses the problem that skqp was excluding skottie source files but still loading particles.

Change-Id: I8849c5285bd2c41b76c2e5fd77b06eca0184719e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/542144
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2022-05-26 19:03:31 +00:00
Tyler Denniston
d78d52a86f Revert "Add Perfetto library (gn & bazel) and bare-bones SkPerfTrace class"
This reverts commit bfc9b94840.

Reason for revert: new dependency causing Android build error

Original change's description:
> Add Perfetto library (gn & bazel) and bare-bones SkPerfTrace class
>
> First incremental step to incorporating Perfetto tracing into Skia, more CLs to follow
>
> NOTE: The presubmit check is failing. This appears to be due to the known issue where the presubmit check bugs out if the DEPS file is edited, which it was on this CL (modified to include Perfetto).
>
> Bug: skia:13303
> Change-Id: I908be0392b520e8da14b34588b842bf6d955bd93
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/543081
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Nicolette Prevost <nicolettep@google.com>

Bug: skia:13303
Change-Id: Ia2b883bbab1f8fb4f3914b63104a39240cc60e86
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/544239
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Auto-Submit: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Nicolette Prevost <nicolettep@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2022-05-26 16:21:27 +00:00
Tyler Denniston
6a67f1f40f Revert "Reland "Create updateResourceLabel method.""
This reverts commit 35ef74b7a4.

Reason for revert: causing chrome roll failure?

Original change's description:
> Reland "Create updateResourceLabel method."
>
> This is a reland of commit 605f92c7d7
>
> Original change's description:
> > Create updateResourceLabel method.
> >
> > In this CL, the GrSurfaceProxy's and GrDrawOpAtlas's label strings
> > are plumbed so that it can be stored in the label string of
> > GrGpuResource. updateResourceLabel method, which is called from
> > setLabel method, will add labels to Skia OpenGL backend using ANGLE's
> > labeling API.
> >
> > Bug: chromium:1164111
> > Change-Id: I370715d186357e920d260d624d77586cdddd11e8
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/541230
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
>
> Bug: chromium:1164111
> Change-Id: Ia20a81d22e320813cbc4ad1d41e06e47dc3827bb
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/544058
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

Bug: chromium:1164111
Change-Id: Icacb3a0f2f2ee03afc09e03c2ee59b03d5bdd811
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/544241
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Tyler Denniston <tdenniston@google.com>
2022-05-26 15:25:22 +00:00
Aditya Kushwah
35ef74b7a4 Reland "Create updateResourceLabel method."
This is a reland of commit 605f92c7d7

Original change's description:
> Create updateResourceLabel method.
>
> In this CL, the GrSurfaceProxy's and GrDrawOpAtlas's label strings
> are plumbed so that it can be stored in the label string of
> GrGpuResource. updateResourceLabel method, which is called from
> setLabel method, will add labels to Skia OpenGL backend using ANGLE's
> labeling API.
>
> Bug: chromium:1164111
> Change-Id: I370715d186357e920d260d624d77586cdddd11e8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/541230
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

Bug: chromium:1164111
Change-Id: Ia20a81d22e320813cbc4ad1d41e06e47dc3827bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/544058
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-05-26 14:16:41 +00:00
Nicolette Prevost
bfc9b94840 Add Perfetto library (gn & bazel) and bare-bones SkPerfTrace class
First incremental step to incorporating Perfetto tracing into Skia, more CLs to follow

NOTE: The presubmit check is failing. This appears to be due to the known issue where the presubmit check bugs out if the DEPS file is edited, which it was on this CL (modified to include Perfetto).

Bug: skia:13303
Change-Id: I908be0392b520e8da14b34588b842bf6d955bd93
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/543081
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Nicolette Prevost <nicolettep@google.com>
2022-05-25 14:50:57 +00:00
Tyler Denniston
b946b55586 Revert "Create updateResourceLabel method."
This reverts commit 605f92c7d7.

Reason for revert: breaking bots on CQ

Original change's description:
> Create updateResourceLabel method.
>
> In this CL, the GrSurfaceProxy's and GrDrawOpAtlas's label strings
> are plumbed so that it can be stored in the label string of
> GrGpuResource. updateResourceLabel method, which is called from
> setLabel method, will add labels to Skia OpenGL backend using ANGLE's
> labeling API.
>
> Bug: chromium:1164111
> Change-Id: I370715d186357e920d260d624d77586cdddd11e8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/541230
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

Bug: chromium:1164111
Change-Id: I1f2d8585fefde6b74d23f2ea14d91ee6d3e1e60d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/543486
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-05-25 14:36:13 +00:00
Aditya Kushwah
605f92c7d7 Create updateResourceLabel method.
In this CL, the GrSurfaceProxy's and GrDrawOpAtlas's label strings
are plumbed so that it can be stored in the label string of
GrGpuResource. updateResourceLabel method, which is called from
setLabel method, will add labels to Skia OpenGL backend using ANGLE's
labeling API.

Bug: chromium:1164111
Change-Id: I370715d186357e920d260d624d77586cdddd11e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/541230
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-05-25 14:02:55 +00:00
Jim Van Verth
a25aeff052 Move GrTextBlobRedrawCoordinator to sktext:gpu namespace.
Also makes SDFMaskFilter available.

Bug: skia:13118
Change-Id: I27ca3ed85a057267387841be5dad10d8e6c7f7bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/543079
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2022-05-24 15:36:34 +00:00
Michael Ludwig
767586b330 Update Sk4px to use skvx instead of SkNx
Adds a saturated_add function that was on SkNx and used in
SkXfermode_opts, but hadn't been ported to skvx yet.

Removes the Sk4px_opts variants and simplifies some of its functions;
many were already defined skvx.

The largest change is that Sk4px does not extend skvx::byte16, since it
used to extend Sk16b. Now it just has a vector as a data type. This
was necessary so that we could define operators that were typed for
Sk4px and Wide w/o conflicting with the free operators that were
defined for the base skvx types.

Change-Id: I8c667ba86f662ccf07ad85aa32e78abfc0a8c7ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/542645
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2022-05-23 17:41:53 +00:00
Michael Reed
14aa53bf38 Add rive to third_party
Add rive slide to Viewer

Change-Id: Id25a7ac2a65e816544159ff4b3f582249f9ba0ce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/541742
Auto-Submit: Mike Reed <mike@reedtribe.org>
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2022-05-20 13:33:30 +00:00
Jorge Betancourt
7f99451720 [particles] add support for multiframe asset bindings
Change-Id: I19df412434e755cbd08883639211372d358f9137
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540747
Reviewed-by: Florin Malita <fmalita@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2022-05-19 19:39:12 +00:00
Kevin Lubick
606876995e [infra] Fix dangling Python2-specific issues
subprocess.check_output needs encoding or it defaults
to bytes.

Python 3 has / be float division and // be integer
division.

The skpbench fix is speculative.

Change-Id: I13d0e976c03bba30761c8ab533e6fdd041b795c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/541696
Reviewed-by: Ravi Mistry <rmistry@google.com>
2022-05-18 14:37:02 +00:00
Brian Osman
c2d42fe243 Add #version directive to SkSL
ProgramSettings now has a fRequiredVersion, based on the #version
directive (if any). There is plenty more to do, and this is an
intermediate state where the "fEnforceES2Restrictions" bool still
exists. Eventually, that will go away, or change into a check between
the required version and the SkCapabilities supplied (also in
ProgramSettings).

As a proof-of-concept, this migrates some use-cases to insert the new
version directive, and unlock ES3 features in some tests and benches.

Bug: skia:11209
Change-Id: I964975931039588d7a302bfedd09246e3d4a79d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540037
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-05-17 15:42:31 +00:00
Kevin Lubick
add9e135dd Reland "[infra] Remove old python scripts and urllib2 references"
This is a reland of commit 167e608bb3

Original change's description:
> [infra] Remove old python scripts and urllib2 references
>
> I was searching for urllib2 while resolving issues with
> https://skia-review.googlesource.com/c/skia/+/538636
> when I found several old, apparently unused scripts.
>
> Rather than fix them, let's get rid of them. If they
> are still in use, the conversion to urllib.request is
> pretty easy.
>
> Change-Id: I27d419601e81c93a3d53e280188a379dfab927c4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538936
> Auto-Submit: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Ravi Mistry <rmistry@google.com>
> Reviewed-by: Ravi Mistry <rmistry@google.com>

Change-Id: I656b45cbcbde61c45d6d9daa0d6b97324d738631
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/541077
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
Auto-Submit: Kevin Lubick <kjlubick@google.com>
2022-05-16 20:15:49 +00:00
Kevin Lubick
24f0b884c0 [bazel] Move Dawn BUILD.bazel to third_party/bazel
Rather than having a monolithic third_party/BUILD.bazel, this moves
our Dawn rules to their own subdirectory and makes it callable via
@dawn instead of //third_party/dawn.

This will help with the G3 roll and make our rules more organized in
general.

This also rolls Dawn
Roll Dawn from ab9757036bd6 to e831fb61046b (22 revisions)

https://dawn.googlesource.com/dawn.git/+log/ab9757036bd6..e831fb61046b

Suggested Review Order:
 - WORKSPACE.bazel, where we define @dawn and its deps
   (@vulkan_headers and @vulkan_tools). I initially thought
   I needed to define all of Dawn's deps in the workspace_file_content
   for new_local_repository, but that WORKSPACE file is
   ignored when building Skia rules.
 - third_party/dawn/BUILD.bazel, the contents of which were copied
   from //third_party/BUILD.bazel and modified largely via
   find-and-replace to point to files relative to
   //third_party/externals/dawn. One exception is the cpu_wasm
   config_setting because @dawn isn't able to see Skia's
   //bazel/macros.bzl.
 - All other files

Change-Id: Ib2d7bc972ef00b6b68370ce5c2839ffb70ed9a2f
Bug: skia:12541, skia:13211
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538638
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-05-16 14:06:59 +00:00
Derek Sollenberger
d4aa36a9b6 Revert "create ParticleDrawable for animated Skotties"
This reverts commit ddd64d35c6.

Reason for revert: breaking the android build

Original change's description:
> create ParticleDrawable for animated Skotties
>
> Change-Id: Ieaea5e9c358604a25f0fecd7bac71a0450359653
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538042
> Reviewed-by: Florin Malita <fmalita@google.com>
> Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

Change-Id: Ida2bfe6359790a49a8c2b4f8a3b96d9b14da5600
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539083
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Derek Sollenberger <djsollen@google.com>
2022-05-11 23:35:08 +00:00
John Stiles
b1b1a67647 Disable optimizations when viewing shaders in the 'SkSL' setting.
Most shader text displayed in SkSL mode is passed through, exactly as
written--comments and all--and is unaffected by the optimization
setting. However, runtime effects go through the pipeline stage which
can subject them to optimizations. This is unexpected in "SkSL" mode,
where the goal is to display the shader as close to the original input
as possible.

Now, when Viewer displays a runtime effect in "SkSL" mode, it will not
have optimizations applied (other than some basic stuff like constant
folding, which is currently non-negotiable in SkSL).

Change-Id: I9bd3d8f7067d7124b3fbe88e8a422212b645597a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539200
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-05-11 21:18:35 +00:00
Jorge Betancourt
ddd64d35c6 create ParticleDrawable for animated Skotties
Change-Id: Ieaea5e9c358604a25f0fecd7bac71a0450359653
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/538042
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-05-11 17:44:53 +00:00
John Stiles
2f13b32f79 Add dedicated golden test for enabling/disabling fOptimize.
Previously we didn't have any mechanism for disabling the optimizer when
building golden outputs, so every golden output always had optimizations
applied.

Change-Id: I8f370b06daab6cb50bb4339eab0d39578621413b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/539198
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-05-11 13:37:12 +00:00