Commit Graph

5354 Commits

Author SHA1 Message Date
Kevin Lubick
14abec45f0 [bazel] Add support for Dawn (via Vulkan)
sk_app has existing support for Dawn on top of Vulkan, and
this adds support to build //example:hello_world_dawn and
get this to run on Linux.

Dawn depends on Tint and abseil-cpp. Tint further depends on
spirv_tools and spirv_headers (for writing to the SPIR-V format).
Dawn and Tint only have GN and CMake support, so we need to make
our Bazel rules for them (see //third_party/BUILD.bazel).

abseil-cpp and the SPIR-V libraries have Bazel support, so we
can just include them (see //WORKSPACE.bazel). It is important
that @spirv_headers be called that exactly because @spirv_tools
depends on it by that name.

The hand-crafted cc_library rules for Dawn and Tint were produced
by reading the appropriate GN files and using the parts necessary
for a supporting Vulkan+Linux. If we use Dawn for other backends
(e.g. WebGPU), we will need to expand the Bazel rules. One day,
we might contribute the Bazel rules to Dawn and Tint so they
can support them and avoid breaking us if new files are added.

Suggested Review Order
 - bazel/common_config_settings/BUILD.bazel to see introduction
   of new select-able option "has_gpu_backend" which cleans up
   some of our code that is enabled for any GPU backend.
 - src/*/BUILD.bazel to see has_gpu_backend rolled out.
 - WORKSPACE.bazel to see DEPS declared there (using the files
   in third_party/externals, which are brought in via
   tools/git-sync-deps).
 - third_party/BUILD.bazel which adds Dawn and Tint rules.
   It may be helpful to look in third_party/externals for
   the Dawn [1] and Tint [2] GN files. Especially interesting
   are the Python scripts [3] Dawn uses to generate some
   header and source files.
 - All other files.

[1] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/src/dawn/native/BUILD.gn#183
[2] https://dawn.googlesource.com/tint/+/453d5ae84ec30ab51ac592c13d472412ae8b5fc9/src/tint/BUILD.gn#174
[3] https://dawn.googlesource.com/dawn/+/d9f22ce0346b222759d5510be3d1cd93caa5ab86/generator/dawn_json_generator.py#774
Change-Id: Ied5b162045d8e841b9666457f0158457e2b078d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516996
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-22 13:05:52 +00:00
Kevin Lubick
06ce3d8942 [infra] Fix timeouts on WebGL GMs+Unit Tests
We were unintentionally trying to run all GMs in 3 minutes
which sometimes took a bit longer. This uses the batch
mode that we use for unit tests too.

Change-Id: Icf9b415881d57772584a16423bdaff14d862c19d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522936
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
2022-03-22 12:42:33 +00:00
Kevin Lubick
0364f7b80e [bazel] Fix/update rules
This regenerates the files and fixes the harfbuzz rule so CanvasKit
compiles.

Change-Id: I2db2bddaabf793f360e8a4fa1a6a2b96222dfdf8
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522816
Reviewed-by: Ben Wagner <bungeman@google.com>
2022-03-21 17:19:54 +00:00
Herb Derby
5789d87b6c test slugs by converting blobs to slugs in drawTextBlob
Add the flag --blobAsSlugTesting to have SkCanvas::drawTextBlob
convert from a blob to a slug and draw it. Slugs conversion does
not support RSX form, so handle those with drawTextBlob.

Change-Id: I247ac63d27df5d44ae55bea19f90b1aa73d41fbc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522976
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-03-21 17:17:04 +00:00
Brian Salomon
99c2b29cce Reland "Add glGetFloatv and glSamplerParameterf to GrGLInterface."
This is a reland of commit 171450a1a0

Original change's description:
> Add glGetFloatv and glSamplerParameterf to GrGLInterface.
>
>
> Bug: skia:13036
> Change-Id: Ie15e0c2b0ada468b82bced818eec67c32d70126b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522100
> Auto-Submit: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:13036
Change-Id: Id594ea5fd68c76703ff61d8414c203facbf28801
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522359
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2022-03-21 16:34:43 +00:00
John Stiles
de814f81aa Add SkSL error tests that use Android RuntimeShader.
`atest` will now properly create a RuntimeShader for each of the SkSL
runtime_error tests, and report an SkQP failure if the errors listed
within the test's *%%* markers are not thrown.

This CL also fixes a string-handling bug in `get_sksl_error_tests` which
could cause garbage bytes to appear at the end of shader text. (The code
accidentally assumed that an SkData would have a zero terminator.)

Bug: skia:13042
Change-Id: I971c2a78b8e1c2801a49ce8cd660520d2df5e519
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522358
Reviewed-by: Leon Scroggins <scroggo@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-03-21 14:07:42 +00:00
Kevin Lubick
08ece0c9a0 [includes] Enforce IWYU on sksl code
PS1 regenerates the Bazel files. Use it as the base change when
    comparing patchsets.

IWYU seems to do a good job of working with MyFile.cpp and
MyFile.h, but if there is just a MyHeader.h, it doesn't always
seem to throw errors if the includes aren't correct. This was
observed with include/sksl/DSL.h This might be due to the fact
that headers are not compiled on their own, so they are never
sent directly to the IWYU binary.

This change sets enforce_iwyu_on_package() on the all sksl
packages and then fixes the includes until all those checks
are happy. There were a few files that needed fixes outside
of the sksl folder. Examples include:
 - src/gpu/effects/GrConvexPolyEffect.cpp
 - tests/SkSLDSLTest.cpp

To really enforce this, we need to add a CI/CQ job that runs
bazel build //example:hello_world_gl --config=clang \
  --sandbox_base=/dev/shm --features skia_enforce_iwyu

If that failed, a dev could make the changes described in
the logs and/or run the command locally to see those
prescribed fixes.

I had to add several entries to toolchain/IWYU_mapping.imp
in order to fix some private includes and other atypical
choices. I tried adding a rule there to allow inclusion of
SkTypes.h to make sure defines like SK_SUPPORT_GPU, but
could not get it to work for all cases, so I deferred to
using the IWYU pragma: keep (e.g. SkSLPipelineStageCodeGenerator.h)

Change-Id: I4c3e536d8e69ff7ff2d26fe61a525a6c2e80db06
Bug: skia:13052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522256
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2022-03-21 12:43:02 +00:00
John Stiles
51f7fe8d72 Add SkQPAssetManager::iterateDir to find files in a directory.
We can't use SkOSFile::Iter in the Java version of SkQP--it doesn't find
any files. We need to load our assets via the AAssetManager.

Change-Id: Id9c58fb83da810884d2fa4272fc58101e436aee7
Bug: skia:13042
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521841
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-03-18 21:10:01 +00:00
Leon Scroggins
74e0cf216e Revert "Add glGetFloatv and glSamplerParameterf to GrGLInterface."
This reverts commit 171450a1a0.

Reason for revert: Breaking Google3

Original change's description:
> Add glGetFloatv and glSamplerParameterf to GrGLInterface.
>
>
> Bug: skia:13036
> Change-Id: Ie15e0c2b0ada468b82bced818eec67c32d70126b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522100
> Auto-Submit: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:13036
Change-Id: I49fd1701b54d2144454b8e6a7ff948b85808409f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522357
Auto-Submit: Leon Scroggins <scroggo@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2022-03-18 19:13:37 +00:00
Brian Salomon
171450a1a0 Add glGetFloatv and glSamplerParameterf to GrGLInterface.
Bug: skia:13036
Change-Id: Ie15e0c2b0ada468b82bced818eec67c32d70126b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522100
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2022-03-18 15:23:11 +00:00
John Stiles
9944fb408c Remove obsolete python2 references.
gLinux has removed python2 everywhere. The officially recommended fix is
to always reference #!/usr/bin/python3 explicitly.

http://yaqs/2356833960463433728

Change-Id: I99278a18e95ac8a566e57e1f506986e69d42f57e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521360
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-03-16 19:56:37 +00:00
John Stiles
6d244a0637 Pass SkSL error tests to SkQP.java via arrays.
In a followup CL, we can attempt to compile these shaders via the
RuntimeShader API and verify that compilation fails.

Change-Id: I5366024bd3a6b2efd720acbff0d6c1a6d331e8e5
Bug: skia:13042
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521536
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-03-16 18:46:24 +00:00
John Stiles
3bdeedc497 Load the SkSL error tests when SkQP::init is executed.
Change-Id: I28d4859c13dfdf42da12d02899416aa86c944662
Bug: skia:13042
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521219
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2022-03-16 18:46:24 +00:00
John Stiles
097e63584e Factor out SkQP exclusion-list handling into a helper class.
This will be used in followup CLs to allow exclusions to the SkSL error
tests.

Change-Id: I775de492c29a94f948841a54a822c9a11e16cf25
Bug: skia:13042
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521217
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-03-16 18:42:35 +00:00
Kevin Lubick
e253cc3e55 [bazel] Use toolchain features to opt files into being IWYU compliant.
PS1 regenerates the Bazel files.

It is recommended to review this CL with a diff from PS1.

Example output when a file does not pass the test:
    tools/sk_app/CommandSet.h should add these lines:
    #include "include/core/SkTypes.h"
    #include "include/private/SkTArray.h"
    #include "tools/skui/InputState.h"
    #include "tools/skui/Key.h"
    #include "tools/skui/ModifierKey.h"
    namespace sk_app { class Window; }

    tools/sk_app/CommandSet.h should remove these lines:
    - #include "tools/sk_app/Window.h"

    The full include-list for tools/sk_app/CommandSet.h:
    #include "include/core/SkString.h"
    #include "include/core/SkTypes.h"
    #include "include/private/SkTArray.h"
    #include "tools/skui/InputState.h"
    #include "tools/skui/Key.h"
    #include "tools/skui/ModifierKey.h"
    #include <functional>
    #include <vector>
    class SkCanvas;
    namespace sk_app { class Window; }
    ---

This makes use of Bazel's toolchain features
https://bazel.build/docs/cc-toolchain-config-reference#features
to allow us to configure compiler flags when compiling
individual files. This analysis is off by default, and can
be turned on with --features skia_enforce_iwyu. When enabled,
it will only be run for files that have opted in.
Example:
    bazelisk build //example:hello_world_gl --config=clang \
       --sandbox_base=/dev/shm --features skia_enforce_iwyu

There are two ways to opt files in:
 - Add enforce_iwyu = True to a generated_cc_atom rule
 - Add enforce_iwyu_on_package() to a BUILD.bazel file
   (which enforces IWYU for all rules in that file)

Note that Bazel does not propagate features to dependencies
or dependents, so trying to enable the feature on cc_library
or cc_executable targets will only impact any files listed in
srcs or hdrs, not deps. This may be counter-intuitive when
compared to things like defines.

IWYU supports a mapping file, which we supply to help properly
handle things system headers (//toolchain/IWYU_mapping.imp)

Suggested Review Order:
 - toolchain/build_toolchain.bzl to see how we get the IWYU
   binaries into the toolchain
 - toolchain/BUILD.bazel and toolchain/IWYU_mapping.imp
   to see how the mapping file is made available for
   all compile steps
 - toolchain/clang_toolchain_config.bzl, where we define the
   skia_enforce_iwyu feature to turn on any verification at
   all and skia_opt_file_into_iwyu to enable the check for
   specific files using a define.
 - toolchain/clang_trampoline.sh, which is the toolchain is
   configured to call instead of clang directly (see line 83
   of clang_toolchain_config.bzl). This bash script used to
   just forward all arguments directly onto clang. Now it
   inspects them and either calls clang directly (if
   it does not find the define in the arguments or we are
   linking [bazel sometimes links with clang instead of ld])
   or calls clang and then include-what-you-use. In all cases,
   the trampoline sends the arguments to clang and IWYU
   unchanged).
 - //tools/sk_app/... to see enforcement enabled (and fixed)
   for select files, as an example of that method.
 - //experimental/bazel_test/... to see enforcement enabled
   for all rules in a BUILD.bazel file.
 - all other files.

Change-Id: I60a2ea9d5dc9955b6a8f166bd449de9e2b81a233
Bug: skia:13052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/519776
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-16 13:09:46 +00:00
John Stiles
9b70eeb4f8 Remove GM support from Java portions of SkQP.
We no longer intend to run visual GMs from SkQP.

Change-Id: Ib04958a3d445078d65b72e852afc69781873b93c
Bug: skia:13031
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/520546
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2022-03-14 19:18:43 +00:00
John Stiles
b9802c75ef Fix atest SkQP crash at startup.
Support for GM tests was removed from SkQP at
http://review.skia.org/516336. However, the Java harness still expects
us to supply a non-null GM array, and will crash if we don't.

Change-Id: I1f093254e680bf8d40dcb303cd29ae7b44e09b0a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/520538
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-03-14 17:45:07 +00:00
John Stiles
eda97288bd Disable SkSLPreserveSideEffects in wasm tests.
This test fails on P400 GPUs (used in our Golo machines) but the wasm
tests do not honor the dm_flags test exclusions. (Another good reason to
implement skia:13034.)

Failing on tree: http://screen/4PxKQrjxaXpL9Q2

Change-Id: I086fb3293b3f4eaad877064470002525a7d6e75f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/519621
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-03-11 00:05:47 +00:00
John Stiles
c5ca065411 Add CurrestTestHarness helper method.
This lets us differentiate SkQP from other testing harnesses (like DM or
Viewer) at runtime.

This allows us to change strictness or deactivate tests when SkQP is
running. Previously we had a macro SK_BUILD_FOR_SKQP for this, but this
did not work on a local skqp binary; it only activated when compiling
for Android.

Change-Id: I7334e04ea1eddda783a5d2f26699edd20828f81a
Bug: skia:13037
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518939
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-03-10 18:05:28 +00:00
Kevin Lubick
efce17de5d Reland "[includes] Remove link between SkImage.h and SkImageEncoder.h"
This is a reland of commit f60584eb0f

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

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

Bug: 242216
Change-Id: Ic61e4ac2878e7a51f389312a3a434856e2e32be3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518277
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-10 04:47:51 +00:00
Kevin Lubick
27be14f2ca [includes] Prepare to remove SkColor<->SkImageInfo
This breaks out the SkAlphaType and SkColorType enums into
their own files, which lets us break the dependency between
SkColor and SkImageInfo.

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

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

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

Change-Id: I331d414fe2996632ab11825c1092060ff5fe2ebd
Bug: 242216
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/517678
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-09 18:40:44 +00:00
Kevin Lubick
7ac7413f08 [bazel] Support Vulkan
PS1 regenerates BUILD.bazel files

I suggest reviewing the deltas between PS1 and the latest
PS to focus on the interesting bits.

The changes here allow for a Vulkan-only build of HelloWorld
based on sk_app. The toughest change was properly fetching
the VisualID after removing the gl calls that used to
fill that in.

There are a few changes that fix resolution of Dawn
header files, but those won't actually be built until
a follow-on CL.

Change-Id: I54fb58b5dd7ecd4313562aed401759b3eaed53c0
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516999
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-08 21:21:17 +00:00
Kevin Lubick
57c1541715 Remove old experiments
These are unowned and/or unused.

Change-Id: I2ca871be712a7bf990ff89acc23b6a519bb19374
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/517996
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-08 19:07:00 +00:00
Brian Osman
258954f29e Update build_command_buffer to copy ANGLE libs
This is required, now that the passthrough decoder is enabled
(particularly on Mac, where we run our command buffer bots).

Change-Id: Id2c5ccff1f27669c487cade04b912a7792077c38
Cq-Include-Trybots: luci.skia.skia.primary:Build-Mac-Clang-x86_64-Debug-CommandBuffer
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/517776
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-03-08 17:29:47 +00:00
John Stiles
6cb0d972c2 Remove obsolete double-initialization check.
Change-Id: I5b37d4ce1b8b78de634e6bfaa2d32bfc3b88c54f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/517756
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>
2022-03-08 16:01:48 +00:00
John Stiles
5e9388d170 Add support for conditional unit tests.
DEF_CONDITIONAL_TEST and DEF_CONDITIONAL_GPUTEST_FOR_xxxx_CONTEXTS will
allow unit tests to be considered or ignored based on a passed-in
boolean condition. DEF_TEST_DISABLED is now implemented as a conditional
test hard-coded with a "false" condition.

This allows macros (such as SKSL_TEST) to add unit tests based on the
result of a comparison.

Change-Id: Ic5325569009cfce768ba8942907c1d3e7d69ca1c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/517516
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-03-08 14:35:54 +00:00
Kevin Lubick
a573cbab1a Revert "[includes] Remove link between SkImage.h and SkImageEncoder.h"
This reverts commit f60584eb0f.

Reason for revert: Chrome and G3 issues

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

Bug: 242216
Change-Id: Idc906ff54d8baf49989d3ee24e045d7b0ca710df
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/517676
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Kevin Lubick <kjlubick@google.com>
2022-03-08 13:09:49 +00:00
John Stiles
88f360e963 Remove unused argument from skqp command-line tool.
This only affected one helper script; the others just automatically
forward any user-specified arguments.

Change-Id: Icd401d222d14e459e3c4429e2b2fec567834cada
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/517356
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-03-07 23:44:59 +00:00
Kevin Lubick
f60584eb0f [includes] Remove link between SkImage.h and SkImageEncoder.h
According to go/chrome-includes [1], this will save about
210MB (0.09%) off the Chrome build. http://screen/GVdDaRRneTRuroL

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

Canary-Android-Topic: image-encoder-2
Change-Id: If911ec283a9ce2b07c8509768a6a05446573a215
Bug: 242216
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512416
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-07 21:32:13 +00:00
John Stiles
d8590052e8 Remove GM test support from SkQP.
We only want to run pass/fail unit tests on SkQP. Gold image support has
been removed.

In this CL, the command-line argument for render tests has been left
as-is to avoid breaking scripts which rely on it. This can be removed in
a followup. The Java binding continues to exist as a no-op.

Change-Id: Ib8acb6cb490b935b10d841e2319fe4537696bda1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516336
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-03-07 19:09:53 +00:00
Kevin Lubick
7d4e12544e [dawn] Clean up include paths and dawn_native namespace
Change-Id: I343d878b2ff3b1abf52007c7612b01c53731566b
Bug: dawn:824,dawn:1275,skia:12512
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516916
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-03-07 14:38:55 +00:00
Ben Wagner
8bf4580c3c Update ImGui power sliders in Viewer
The power sliders have been deprecated in favor of specifying that the
sliders are logarithmic. This doesn't appear to work very well, but at
least it doesn't crash at runtime with an assert.

Change-Id: I2c80aaf8e387efbb878c81a1ca0f754f6c45e80a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516160
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-03-04 20:00:19 +00:00
Joe Gregorio
87496d3cc9 Fix doxygen README.md to use python3.
Change-Id: Ie4ce9604f3c00f31a1f0117afeaa0ea6f30e9bd8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/515719
Reviewed-by: Ravi Mistry <rmistry@google.com>
2022-03-04 14:21:35 +00:00
Jim Van Verth
e43d00a219 [graphite] Add isGaneshBacked and isGraphiteBacked
Bug: skia:12845
Change-Id: Ib0b87966b1559b368759ce69c48f0fd27597503a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/514836
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2022-03-02 23:35:16 +00:00
Nathaniel Nifong
387d661db9 Dump path in json representaion of DrawPath command
Bug: skia:6981
Change-Id: Ib4654b0182167e9f7d3e6240359c2d56cad5818f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/514460
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-03-02 16:34:46 +00:00
Ben Wagner
c912570a95 Handle override not modifying GlyphRunList in Viewer
It is possible that when filtering a blob for a glyph run list that the
blob does not need to be changed at all. In this case the original
glyphRunList can be used unmodified. When this happens `filterTextBlob`
does not fill out the `cache` but instead returns the original `blob`.
The existing code assumed that the `cache` was always filled and would
crash when trying to create a glyph run list out of it when it wasn't.

Change-Id: Ia8d9339c613a2157968bd2774966a7ad16edcfee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512944
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-02-25 17:55:14 +00:00
Matt Turner
9f26069e76 [skqp] Call gpuSetup() from SkQP::evaluateGM()
gpuSetup() is responsible for calling skiagm::onGpuSetup() which is
responsible for initializing compressed images used in the following
SkQP tests:

- gl_compressed_textures
- gl_compressed_textures_nmof
- gl_compressed_textures_npot
- gles_compressed_textures
- gles_compressed_textures_nmof
- gles_compressed_textures_npot
- vk_compressed_textures
- vk_compressed_textures_nmof
- vk_compressed_textures_npot

Without this patch each of these tests crash. I suspect these tests were
broken by commit a84caa3a5f ("Make some GMs compatible with the *ooprddl
configs").

Change-Id: Iae864996b9b171084c8ceb5374765d510ff56b49
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510056
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-02-23 18:40:00 +00:00
Greg Daniel
7af43100d5 [graphite] Fix shader dictionary's map key equality check.
Change-Id: I3d1433fba70d5283cb76c960c2e5e7aab0b53ef5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510816
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-02-18 20:25:39 +00:00
Brian Osman
b5282fea23 Fix viewer crash with corrupted MSKPs
If an MSKP fails to load, fPlayer will be null, and viewer will crash
when switching backends.

Change-Id: I68b63da21c8f7c5726b3c5bbbdcb6c17018a63ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/510209
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2022-02-17 22:19:18 +00:00
Jim Van Verth
d6245fc4aa Rename GrSwizzle to skgpu::Swizzle
Bug: skia:12845
Change-Id: Ia03293c4efdad4c5381a713c9d7d4857b79530c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/509398
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2022-02-16 13:30:14 +00:00
Kevin Lubick
7f568e968e [bazel] Update to use emsdk 3.1.4
PS1 regenerates the BUILD.bazel files

This allows us to use closure to minify the JS in canvaskit.js

Change-Id: Ib8326d2e3a19cd2168b740b6946f9165a2810133
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/509177
Reviewed-by: Ben Wagner <bungeman@google.com>
2022-02-15 17:47:03 +00:00
Kevin Lubick
c13cd6479d Reland "Build CanvasKit using GN/Ninja"
This is a reland of ecac712bec

Changes (best viewed comparing PS1 to latest)
 - Use emsdk 3.1.3 which includes important bug fixes
 - Remove unnecessary steps in compile.sh
 - Fix use of various gn args.
 - Avoid conflicts with Flutter's GN symbols
 - Add/update docs
 - Make activate-emsdk script compatible with our infra.

Original change's description:
> Build CanvasKit using GN/Ninja
>
> Build with
>
> ./bin/gn gen out/wasm_debug '--args=target_cpu="wasm"'
>
> or
>
> ./bin/gn gen out/wasm_release '--args=target_cpu="wasm" is_debug=false'
>
> Change-Id: Ib74586bf8397d57064a3899eaa6da76f9bce9049
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502036
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

Change-Id: I601712a8953c2799fa029e782e097905b95e6b59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507717
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-02-15 16:31:10 +00:00
Brian Osman
1bd59cf10b Remove g8 config from DM/FM. Switch CPU bots to test r8 instead.
Change-Id: I1bef9f9c8db0147d8cfb60354aa519cc3ca61b43
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507319
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-02-15 15:46:10 +00:00
Ben Wagner
51a553d8c5 Allow Viewer to filter glyphRunList.
This allows force overriding font settings embedded in the glyphRunList.

Change-Id: I49f15786ec8d35c55f769fc910e009693cfc5879
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/508179
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2022-02-14 16:58:42 +00:00
Ben Wagner
8fd41401f1 FreeType to draw COLR glyphs with drawables.
Bug: skia:12121
Change-Id: I616e1357e9209642b6e323e631f475e83e5c4b79
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507337
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2022-02-11 20:38:43 +00:00
Nathaniel Nifong
0d36473ebc Add android build files for skqp cts testing
Bug: skia:12890
Change-Id: I44dde188b7b7daf1c6e5c718b6b2874bbc28510d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506459
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2022-02-11 18:52:27 +00:00
Kevin Lubick
a59af6e4f2 Revert "Build CanvasKit using GN/Ninja"
This reverts commit ecac712bec.

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

Original change's description:
> Build CanvasKit using GN/Ninja
>
> Build with
>
> ./bin/gn gen out/wasm_debug '--args=target_cpu="wasm"'
>
> or
>
> ./bin/gn gen out/wasm_release '--args=target_cpu="wasm" is_debug=false'
>
> Change-Id: Ib74586bf8397d57064a3899eaa6da76f9bce9049
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502036
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

Change-Id: I04dbb3b1cff7511064f603d7dc7c8a4168bf0d56
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/507616
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-02-11 13:35:19 +00:00
Harry Terkelsen
ecac712bec Build CanvasKit using GN/Ninja
Build with

./bin/gn gen out/wasm_debug '--args=target_cpu="wasm"'

or

./bin/gn gen out/wasm_release '--args=target_cpu="wasm" is_debug=false'

Change-Id: Ib74586bf8397d57064a3899eaa6da76f9bce9049
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/502036
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2022-02-11 13:05:44 +00:00
Brian Osman
a7a2324f14 Reland "Add kR8_unorm_SkColorType"
This is a reland of 3225c8cc46

Original change's description:
> Add kR8_unorm_SkColorType
>
> Change-Id: I97b5bc7f90715664f233ca7b7c41c0ecbfc29ac4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505679
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

Change-Id: I73fa17625d57e0e58da1b70e2e59ba200383cfe7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506460
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-02-10 18:00:19 +00:00
John Stiles
39b978241b Update code to prepare for -Wformat-nonliteral.
-Wformat-nonliteral does not work with variadic templates, and requires
a constant format string.

These changes uncovered one incorrect format string (%u -> %lu for a
DWORD in dm.cpp)

Change-Id: Id54a5d6cbcb607ff32c758f4a9d346a7aba70df3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506616
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-02-10 14:17:33 +00:00