Commit Graph

3564 Commits

Author SHA1 Message Date
Brian Osman
1843bee81d Reland "Set GN's script_executable to "python3""
This is a reland of commit 6f0d2bf494

Includes a fix for iOS codesigning script to be python3 compatible.

Original change's description:
> Set GN's script_executable to "python3"
>
> In some environments, GN would end up running scripts with python2.
> This change requires that python3 be in the path, but is the safest
> way to guarantee that all scripts are run correctly.
>
> Change-Id: Ifc2601ff9c9f3705ac7f1057a26a87a61211ff67
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528337
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

Change-Id: I785909f3c7d51d6fd1c90114d01f114be76981f2
Cq-Include-Trybots: luci.skia.skia.primary:Build-Mac-Clang-arm64-Debug-iOS
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528441
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-04-07 20:11:27 +00:00
Kevin Lubick
d3d0ee3dc2 [debugger] Fix missing audit trails
Change-Id: I337aebf72715339ec0280bab0916968ccbe7f481
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528516
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2022-04-07 19:52:09 +00:00
John Stiles
8397365524 Optimize away same-value ternaries.
A ternary of the form `anything ? value : value` can be reduced to a
comma-expression of the form `anything, value`. This seems like a rare
case in real code, but it's easy enough to detect with our existing
toolbox.

The `anything` test-expression will be eliminated from the expression
if it has no side effects, using our existing constant-folding rules
for the comma expression.

Change-Id: I1285b04cd6a08f1bed614aa1aa6f37ea2447de91
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528439
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-04-07 19:37:00 +00:00
John Stiles
b617bced6e Use OpConstantComposite when vectorizing in SPIR-V.
Previously, when we vectorized scalars, we would not place them in the
constant buffer, so we could emit simple vectors like (0,0,0) or (1,1,1)
more than once. Now, we use `writeConstructorSplat` to vectorize, which
knows how to write constants.

Change-Id: Ic97c0ce5415fd46ff8c7fb7dac9205844633ef3a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527921
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-04-07 18:28:18 +00:00
Kevin Lubick
8499e372ce [includes] Remove more includes of SkColorSpace
While I was fixing up Chrome's uses, I found some failures
there that I did not see in Skia, and tracked them down
to a few other places where we include SkColorSpace
and it is not strictly necessary

 - SkCustomMesh.h
 - GrColorInfo.h
 - GrColorSpaceXform.h
 - SkColorSpaceXformSteps.h

For these files (and their .cpp files), I added enforcement
of include-what-you-use, and then fixed the myriad of places
which were depending on these transitive includes.

One change to help Chrome is the manual overloads of
SkImage::MakeFromAdoptedTexture instead of using default
parameters. This makes it so callers of that function
do not need to include SkColorSpace if they were going
to pass nullptr for it anyway.

Bug: skia:13052
Change-Id: I16bf8ed5e258225d887f562f2c189623b1ca9c23
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527056
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2022-04-06 21:58:24 +00:00
John Stiles
e4fbfa6a90 Separate SkSL module dehydration from SkSL test compilation.
gn flag `skia_compile_modules` now compiles the `sksl-precompile` binary
and generates dehydrated data. gn flag `skia_compile_sksl_tests`
now compiles `skslc` and builds the SkSL test corpus, but does not
generate dehydrated data. (skslc uses the raw sksl_xxxxx.sksl inputs
directly, not the dehydrated data, so this is safe.)

Change-Id: I96f6837b4312cd01309496da743a8a0e8a66d69e
Bug: skia:13164
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/528158
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-04-06 21:55:39 +00:00
John Stiles
156952dc7b Add new sksl-precompile binary to tools.
This binary will be compiled when the gn flag `skia_compile_modules` is
set. sksl-precompile will replace for skslc for module precompilation in
a followup.

Change-Id: I217127169b091f97c2e4d11e0deb655ceac84425
Bug: skia:13164
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527838
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-04-06 19:45:07 +00:00
Robert Phillips
2a04ac3ee1 [graphite] Move the UniformManager into the SkPipelineDataGatherer
This means that the UniformManager w/in the SkPipelineDataGatherer will
now collect all the uniforms into a single block of memory.

Bug: skia:12701
Change-Id: I504a014d37662619191d9b519b4e1add69eac8bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527837
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-04-06 19:31:56 +00:00
Arman Uguray
be405a8b38 [sksl][wgsl] Introduce SkSLWGSLCodeGenerator
Introduce a new WGSL codegen backend. It currently only supports
fragment/vertex stage input and output variable declarations.

Bug: skia:13092
Change-Id: If9e4e432794eb95fd33719be5c0141dfc2cb5680
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526757
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
2022-04-05 21:54:08 +00:00
John Stiles
d0242346b8 Allow prefix-expressions in IsSameExpressionTree.
This will allow expressions like `-x == -x` or `!y == !y` to be detected
as matching expressions (which enables various constant-folding paths).

(Also, migrated the analysis code into a separate cpp.)

Change-Id: I3e317fdaed3762f8fa19e684a5ed557fc9348c7c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527617
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-04-05 20:16:35 +00:00
Ethan Nicholas
b47a67ab75 Fixed SkSL positioning error with double negation
We were not propagating the position into a double-negated expression,
leading to an assertion failure in PrefixExpression.

Change-Id: I1970ff1a06d9631582626c68e151f12f6b3ef278
Bug: oss-fuzz:46381
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/527507
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2022-04-05 17:10:23 +00:00
Greg Daniel
6b52f372c3 [graphite] Add a result param to graphite callbacks.
Bug: skia:12974
Change-Id: Ie10ef5c8ab4e04647233a6039d22a2eb6437d6bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526022
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-03-31 19:26:28 +00:00
Michael Ludwig
7b04832cbe [graphite] Initial ClipStack paired down from v1::ClipStack
PS1 is the exact contents of src/gpu/v1/ClipStack.* copied to
experimental/graphite/src.

PS2+ shows all the changes to remove v1-only features and update some of
the types over to what graphite uses. The major changes are:
1. FragmentProcessors, clip atlases, stencil mask writing, and SW mask
   writing are gone.
2. SW mask caching and tracking are gone.
3. Graphite is effectively in the "forceAA" mode that the original clip
   stack supported. So branches that focused on non-AA, or comparing AA
   or handling cases where elements' AA mismatched could all be removed.
4. Updated to use Graphite's Shape and Transform classes. Did not go as
   far as moving the bounds from SkIRect to Rect, but since everything
   is AA, it will be much simpler to switch to comparing float bounds
   directly and not worry about rounding in or out. That's a more
   substantial change so will come later.
5. The original ClipStack had a "Draw" type that was used to compute
   clip interactions between SaveRecords and Elements. It was always
   just device-space bounds because of limitations of the GrClip API.
   In Graphite, we can use the exact same set of info for Draws and
   Elements, making interaction tests share code and be more accurate.
   Since that's a more involved change, I just removed the simpler Draw
   type from this version for now.
6. Tried to add TODOs for what logic and extra state will need to be
   added to actually apply graphite's clip stack as depth-only draws.

Bug: skia:12698
Change-Id: I418703e8f759cd5e1ddd1e302a864bf2204cf040
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525516
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2022-03-31 16:45:58 +00:00
Ethan Nicholas
3f5184cfa6 Added an SkSL Operator enum
SkSL::Operator was previously just a thin wrapper around Token::Kind and
everything was therefore written in terms of Token. Since Token is not
accessible from include/ (and we don't want it to be), this creates an
actual Operator enum and eliminates the dependence on Token. This will
enable followup changes to reference Operator from within the DSL
include files.

Change-Id: I49555c9151618fd15970a303d2284972c78c3f21
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/525976
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2022-03-31 13:20:57 +00:00
John Stiles
61e7d06c48 Remove skia_compile_processors gn flag.
This flag was meant to control compilation of .fp files, which no longer
exist. Its only meaning now is a synonym for `skia_compile_sksl_tests`.
If you had `skia_compile_processors` enabled in your gn args, you can
replace it with `skia_compile_sksl_tests`.

Change-Id: I49fe58aaf0e60d3998ec43c51c1372a6acad980a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526028
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-03-30 22:01:30 +00:00
Jim Van Verth
0361abf39d Fix setup for iOS simulator on arm64 Macs.
The current setup for the iOS simulator keys off of the fact that iOS
runs on ARM CPUs, and Macs (prior to M1) ran on x64 CPUs. So setting
the target_os to "ios" and the target_cpu to "x64" will indicate use
of the simulator. On M1, they have the same CPU architecture, so we
need another method to indicate use of the simulator SDK.

Also added a check to disable code signing, which is not needed for
running on the simulator.

Bug: skia:12880
Change-Id: I668121010cc557546c4a4e4960601a732bb985c5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526017
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2022-03-30 20:06:39 +00:00
John Stiles
121d4a2e4b Move skslc dependencies into a dedicated list.
I'm considering migrating SkSL precompilation/dehydration into a
separate binary from skslc. It would need the exact same set of Skia
dependencies. So let's factor them out.

Change-Id: I9b000ef058f7253e142cf5a8a603e468beb4d6f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526020
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-30 18:50:12 +00:00
John Stiles
674eb326f4 Improve distinct-out-param test cases.
Added new aliasing tests inspired by syoussefi@'s ANGLE changes at
http://go/crrv/c/3561278.

Change-Id: Ifa312faa9503b211b7c09edd2abd5087ead35e5f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526018
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
2022-03-30 18:49:15 +00:00
John Stiles
99b7434daf Remove get_es2_loop_unroll_info helper function.
This only needed a helper function to make error-reporting optional, but
NoOpErrorReporter (previously TrivialErrorReporter) can serve this
purpose equally well.

Change-Id: Iac249483f2013cbf8563c0ea44c680d3e03e2894
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524766
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-03-28 15:54:38 +00:00
Greg Daniel
00ce96456b [graphite] Add support for finished callbacks.
This also reworks a little bit about what we send to insertRecording
and what we store on Context.

Bug: skia:12974
Change-Id: I747a1cdd1559d4d5fbe928e689a23a734142557b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524012
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-03-25 14:47:05 +00:00
Ben Wagner
faa9f72091 Add SampleSBIX to study sbix glyph translation.
What affects the placement of an sbix image? The cbox? The bounding box?
The lsb? The offsets? In which direction? What are the side effects?

Change-Id: I5b630c2117a26481733392bc1e95428d9a67fb34
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/519078
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2022-03-25 14:43:23 +00:00
Herb Derby
3b238ceae9 add a system for building SkCanvas wrappers for testing
This adds a way to build a wrapping canvas for testing that is allowed
to manipulate the internal state of the canvas. It provides a way
to add friends to SkCanvas without having to change SkCanvas.

Change-Id: I40de8b236ba5acff45b3a8f7e440dcf6fa196fcf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/524316
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-03-24 18:11:53 +00:00
Greg Daniel
faf520c000 [graphite] Move RefCntedCallback to shared gpu file.
Bug: skia:12974
Change-Id: I15b090e2c3346d71ccf45d5f0d306da3f079821e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523996
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2022-03-23 21:19:15 +00:00
John Stiles
c29e37ad4c Rename ES2 error tests 'T' through 'Z' to .rts.
Change-Id: I528d2b7a53748077f2dd7e7e04927d2a6b78ac8f
Bug: skia:13042
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523429
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
2022-03-22 19:50:29 +00:00
John Stiles
6424dd02a8 Rename ES2 error tests starting with 'S' to .rts.
Change-Id: I1dd481ca47965e933a110a0f0a8ef7616deb034d
Bug: skia:13042
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523417
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-03-22 17:08:16 +00:00
John Stiles
04f8ee3f39 Rename ES2 error tests starting with 'R' to .rts.
Change-Id: Ibd39b45ef57c4e79e444a70aee1901cb33bcfa6a
Bug: skia:13042
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523378
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-03-22 17:03:48 +00:00
John Stiles
141f2873a9 Rename ES2 error tests 'O' through 'P' to .rts.
A few tests were divided into a Runtime Effect-compatible .rts test, and
a Runtime Effect-incompatible .sksl test.

Change-Id: Ib52554892685bdc44fe3622ab314960ee0962b90
Bug: skia:13042
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523377
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-03-22 17:03:07 +00:00
John Stiles
c5e6515e4a Rename ES2 error tests from 'H' through 'M' to .rts.
In a few cases, this involved splitting a test into two (an ES2-
compatible portion and a ES3+ portion).

Change-Id: Ie6f18f787cf7c10696a2841ff538bbe2b95bf50d
Bug: skia:13042
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523187
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
2022-03-22 16:54:32 +00:00
Michael Ludwig
0378307904 Move skgpu::v1-specific [Stroke|Path]Tessellators out of tessellate/
The static functionality for writing vertex buffers, constants, and
utility functions that were in the StrokeTessellator and PathTessellator
classes have been moved into Tessellation.h and a new
FixedCountBufferUtils.h.

The tessellator hierarchy has been moved into src/gpu/ops and all the
v1 guards are removed since they were already solely v1 after the static
functions were lifted out. The hierarchy and subclasses are preserved
but have been combined into just StrokeTessellator.h and
PathTessellator.h instead of separate files for the subclasses.

All the rest of the little changes are updating references and includes.

Bug: skia:13012
Change-Id: I90f2f53538349cf9ad1823a0c42fbdc772190a49
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523189
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2022-03-22 16:04:13 +00:00
Jim Van Verth
54340beba7 [graphite] Add skgpu::Image::onReadPixels.
Creates a new shared routine ReadPixelsHelper used by this and
Device::readPixels(). Also added MakeBitmapProxyView to the
shared file and cleaned up some headers.

Bug: skia:12845
Change-Id: I05533d2f47688daf4f14c8171eb7cd7178b4c0ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521958
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2022-03-22 15:37:23 +00:00
Robert Phillips
f8df8d8896 [graphite] Make PipelineDataCache templated
We are going to cache (and uniquify) the UniformBlocks and TextureBlocks
separate from each other.

Bug: skia:12701
Change-Id: I03837c4a38a9bdeb4224a697eab119fca24e8f8c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522916
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-03-22 14:45:07 +00:00
John Stiles
2fdcca2777 Rename ES2 error tests from 'C' through 'G' to .rts.
A few tests received minor tweaks to make them Runtime Effect-friendly.

Change-Id: I9b4f66b0974c41d38324dfbb31ac9849338f600a
Bug: skia:13042
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/523186
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Arman Uguray <armansito@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-03-21 22:50:58 +00:00
Michael Ludwig
1979ef6d56 [graphite] Share Path[Curve|Wedge|]Tessellator sources between graphite and ganesh
Cq-Include-Trybots: luci.skia.skia.primary:Test-Mac12-Clang-MacBookPro16.2-GPU-IntelIrisPlus-x86_64-Debug-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Debug-All-ASAN_Graphite,Test-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-Graphite,Perf-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Perf-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-Graphite,Build-Mac-Clang-x86_64-Release-Graphite,Build-Mac-Clang-x86_64-Debug-Graphite,Build-Mac-Clang-arm64-Release-iOS_Graphite,Build-Mac-Clang-arm64-Release-Graphite,Build-Mac-Clang-arm64-Debug-iOS_Graphite,Build-Mac-Clang-arm64-Debug-Graphite_NoGpu,Build-Mac-Clang-arm64-Debug-Graphite,Build-Mac-Clang-arm64-Debug-ASAN_Graphite
Change-Id: I2ee0fd8d208bb10e011a5552a60a1a62d7a56ba9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522423
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2022-03-21 18:50:53 +00:00
John Stiles
0d226afee9 Rename ES2 error tests starting with 'B' to .rts.
A few tests received minor tweaks to make them Runtime Effect-friendly.

Change-Id: Icbcedb84b7882e42f21425b2d40d7819705c359e
Bug: skia:13042
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522918
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-03-21 16:49:17 +00:00
John Stiles
1beeab415c Rename Runtime Effect-compatible ES2 error tests to .rts.
This is useful because it will allow these tests to be supported in
Android CTS, where only Runtime Effects are API-accessible.

This CL updates the C++ test harness so that .rts files in the error/
directory are found, and tweaks error tests as necessary to make them
Runtime Effect-compatible. For instance, Runtime Effects enforce the
parameters on main(), which adds extra errors that we don't want. And
some error tests require ES3 (e.g. array constructors) and so those
tests remain as .sksl files.

In this CL, only tests beginning with A are updated. The remaining tests
will be updated in followup CLs.

Change-Id: I70b064df4f0b3ed02d6bc8cc9add7ee844a78691
Bug: skia:13042
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522424
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2022-03-21 16:49:17 +00:00
Michael Ludwig
c71ae51400 [graphite] Implement stencil wedge tessellated path rendering
Cq-Include-Trybots: luci.skia.skia.primary:Test-Mac12-Clang-MacBookPro16.2-GPU-IntelIrisPlus-x86_64-Debug-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Debug-All-ASAN_Graphite,Test-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-Graphite,Perf-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Perf-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-Graphite,Build-Mac-Clang-x86_64-Release-Graphite,Build-Mac-Clang-x86_64-Debug-Graphite,Build-Mac-Clang-arm64-Release-iOS_Graphite,Build-Mac-Clang-arm64-Release-Graphite,Build-Mac-Clang-arm64-Debug-iOS_Graphite,Build-Mac-Clang-arm64-Debug-Graphite_NoGpu,Build-Mac-Clang-arm64-Debug-Graphite,Build-Mac-Clang-arm64-Debug-ASAN_Graphite
Bug: skia:12703
Change-Id: Iccdbc4f95c6d714d58f21fa5d23bdd14eb1f88ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/522096
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2022-03-21 01:16:04 +00:00
Michael Ludwig
d640b7e4e2 [graphite] Move stencil-and-cover RenderSteps into separate headers
Progress on exposing the RenderSteps used in the one renderer for
re-use with new renderers.

Cq-Include-Trybots: luci.skia.skia.primary:Test-Mac12-Clang-MacBookPro16.2-GPU-IntelIrisPlus-x86_64-Debug-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Debug-All-ASAN_Graphite,Test-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-Graphite,Perf-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Perf-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-Graphite,Build-Mac-Clang-x86_64-Release-Graphite,Build-Mac-Clang-x86_64-Debug-Graphite,Build-Mac-Clang-arm64-Release-iOS_Graphite,Build-Mac-Clang-arm64-Release-Graphite,Build-Mac-Clang-arm64-Debug-iOS_Graphite,Build-Mac-Clang-arm64-Debug-Graphite_NoGpu,Build-Mac-Clang-arm64-Debug-Graphite,Build-Mac-Clang-arm64-Debug-ASAN_Graphite
Bug: skia:12703
Change-Id: I134c79c37f2cdee40558161c9e73dc3221188e67
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521959
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2022-03-18 19:02:11 +00:00
Colin Cross
350ce03adc Tweak linux_glibc properties for musl builds in external/skia
For convenience, builds against musl libc currently use the
linux_glibc properties because they are almost always linux-specific
and not glibc-specific.  In preparation for removing this hack,
tweak the linux_glibc properties by either moving them to host_linux,
which will apply to linux_glibc, linux_musl and linux_bionic, or
by setting appropriate musl or linux_musl properties.  Properties
that must not be repeated while musl uses linux_musl and also still
uses the linux_glibc properties are moved to glibc properties, which
don't apply to musl.  Whether these stay as glibc properties or get
moved back to linux_glibc later once the musl hack is removed is TBD.

Bug: b/223257095
Test: m checkbuild
Test: m USE_HOST_MUSL=true host-native
Change-Id: Ie2067df4271558a0a2dc67e947d027c32f7db9ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521361
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2022-03-18 19:01:05 +00:00
Michael Ludwig
df7c47a094 [graphite] Make stencil-and-cover stencil settings accessible
This is in preparation for additional tessellation-based RenderSteps.

Cq-Include-Trybots: luci.skia.skia.primary:Test-Mac12-Clang-MacBookPro16.2-GPU-IntelIrisPlus-x86_64-Debug-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Test-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Debug-All-ASAN_Graphite,Test-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-Graphite,Perf-Mac11-Clang-MacMini9.1-GPU-AppleM1-arm64-Release-All-Graphite,Perf-Mac10.15.7-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-Graphite,Build-Mac-Clang-x86_64-Release-Graphite,Build-Mac-Clang-x86_64-Debug-Graphite,Build-Mac-Clang-arm64-Release-iOS_Graphite,Build-Mac-Clang-arm64-Release-Graphite,Build-Mac-Clang-arm64-Debug-iOS_Graphite,Build-Mac-Clang-arm64-Debug-Graphite_NoGpu,Build-Mac-Clang-arm64-Debug-Graphite,Build-Mac-Clang-arm64-Debug-ASAN_Graphite
Bug: skia:12703
Change-Id: I497ea14802201be10535ee26147838b28ab6b34d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521957
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2022-03-18 17:22:04 +00:00
Ethan Nicholas
5e035c66da Added safety checks to SkSL error reporting
This adds an assert to Position::line() to ensure that we don't run
past the end of the source string. Since the source string can
contain embedded nulls, we also switch the source handling from
const char* to std::string so we can accurately determine its length.

Change-Id: I9df47e98c1a0cbc35222a0ea709d9403762210d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/521656
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2022-03-17 16:06:06 +00:00
Robert Phillips
9565f4bd90 [graphite] Plumb Recorder down into KeyHelpers
The KeyContext is used in the addToKey methods but must appear in the
AddToKey methods bc the latter can call the former.

Bug: skia:12701
Change-Id: I3143afec8337b1e3e12f1c3cc198714009ca6930
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/520539
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-03-15 18:06:05 +00:00
Arman Uguray
e70f2e0e0f [sksl][test] Add more folding tests for side-effecting expressions
Moved the MatrixFoldingES2.sksl test case for matrix construction with
side-effects into a new PreserveSideEffects.sksl test and added new test
cases for various vector and matrix types and constructors. The new test
is written such that none of its contents should be folded away.

Note: This test does not pass on NVIDIA GPUs when using OpenGL as
discussed in skia:13035. Notably, NONE of the increments are executed on
those GPUs as ALL increment expressions seemingly get subjected to
constant-folding. The test is disabled on NVIDIA GPU bots.

This also means that the remaining MatrixFoldingES2.sksl tests now work
on NVIDIA GPUs when using OpenGL (with the exception of Tegra3 + OpenGL
ES).

Bug: skia:13035, skia:11919
Change-Id: I561bb62fe2b6b814ba80fbc492d3885bbcd6b65b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/518278
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Arman Uguray <armansito@google.com>
2022-03-10 18:06:12 +00:00
Michael Ludwig
5eb9e9e88c Reland "Convert PatchWriter to trait-oriented template"
This reverts commit bad94bc85a.

Reason for revert: the reverted CL moved the updateStrokeParamsAttrib
call into updateTolerances(), but forgot to guard it with checking
the PatchAttrib.

Original change's description:
> Revert "Convert PatchWriter to trait-oriented template"
>
> This reverts commit 2393b88311.
>
> Reason for revert: Asserts on ASAN bots.
>
> Original change's description:
> > Convert PatchWriter to trait-oriented template
> >
> > This allows the different variations to have compile-time optimizations
> > for certain features related to stroking, curve-filling, or wedges.
> > Additionally, it extends the attrib writing system to let graphite take
> > advantage of compile-time-only attribute configs and avoid using
> > VertexWriter::If per patch.
> >
> > Benchmark                              Orig   ->   ToT    ->   CL
> > StrokeFixedCountTessellator_motionmark 845us  ->  904us   ->  871us
> > StrokeFixedCountTessellator_one_chop   3.03ms ->  3.29ms  ->  2.89ms
> > StrokeFixedCountTessellator            2.15ms ->  2.21ms  ->  1.93ms
> > StrokeHardwareTessellator_motionmark   560us  ->  601us   ->  551us
> > StrokeHardwareTessellator_one_chop     2.45ms ->  4.23ms  ->  3.89ms
> > StrokeHardwareTessellator              395us  ->  478us   ->  399us
> > PathWedgeTessellator                   313us  ->  407us   ->  367us
> > PathCurveTessellator                   278us  ->  335us   ->  331us
> >
> > With these results from my workstation, we nearly recovered the
> > regression on the SFCT_motionmark benchmark and exceeded original perf
> > on the SFCT_on_chop and SFCT benchmarks. SHT_motionmark and SHT have
> > returned to original, and SHT_one_chop has improved. I'm less concerned
> > about bringing that back down since SHT is on the chopping block. We see
> > some improvements on the PWT and PCT benches.
> >
> > Change-Id: Id76d34089dbaa50fe7d5f82fe54ee3cf605d0c24
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512577
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
>
> Change-Id: Ief826c4e489742df98dbe7a38165dd72537ece3d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/519076
> 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>

Bug: skia:13012
Change-Id: Ife3e8b30c7e817b253f957b9ebd55f540b60be92
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/519077
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-03-10 14:08:29 +00:00
Brian Osman
bad94bc85a Revert "Convert PatchWriter to trait-oriented template"
This reverts commit 2393b88311.

Reason for revert: Asserts on ASAN bots.

Original change's description:
> Convert PatchWriter to trait-oriented template
>
> This allows the different variations to have compile-time optimizations
> for certain features related to stroking, curve-filling, or wedges.
> Additionally, it extends the attrib writing system to let graphite take
> advantage of compile-time-only attribute configs and avoid using
> VertexWriter::If per patch.
>
> Benchmark                              Orig   ->   ToT    ->   CL
> StrokeFixedCountTessellator_motionmark 845us  ->  904us   ->  871us
> StrokeFixedCountTessellator_one_chop   3.03ms ->  3.29ms  ->  2.89ms
> StrokeFixedCountTessellator            2.15ms ->  2.21ms  ->  1.93ms
> StrokeHardwareTessellator_motionmark   560us  ->  601us   ->  551us
> StrokeHardwareTessellator_one_chop     2.45ms ->  4.23ms  ->  3.89ms
> StrokeHardwareTessellator              395us  ->  478us   ->  399us
> PathWedgeTessellator                   313us  ->  407us   ->  367us
> PathCurveTessellator                   278us  ->  335us   ->  331us
>
> With these results from my workstation, we nearly recovered the
> regression on the SFCT_motionmark benchmark and exceeded original perf
> on the SFCT_on_chop and SFCT benchmarks. SHT_motionmark and SHT have
> returned to original, and SHT_one_chop has improved. I'm less concerned
> about bringing that back down since SHT is on the chopping block. We see
> some improvements on the PWT and PCT benches.
>
> Change-Id: Id76d34089dbaa50fe7d5f82fe54ee3cf605d0c24
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512577
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

Change-Id: Ief826c4e489742df98dbe7a38165dd72537ece3d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/519076
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-03-10 00:29:04 +00:00
Michael Ludwig
2393b88311 Convert PatchWriter to trait-oriented template
This allows the different variations to have compile-time optimizations
for certain features related to stroking, curve-filling, or wedges.
Additionally, it extends the attrib writing system to let graphite take
advantage of compile-time-only attribute configs and avoid using
VertexWriter::If per patch.

Benchmark                              Orig   ->   ToT    ->   CL
StrokeFixedCountTessellator_motionmark 845us  ->  904us   ->  871us
StrokeFixedCountTessellator_one_chop   3.03ms ->  3.29ms  ->  2.89ms
StrokeFixedCountTessellator            2.15ms ->  2.21ms  ->  1.93ms
StrokeHardwareTessellator_motionmark   560us  ->  601us   ->  551us
StrokeHardwareTessellator_one_chop     2.45ms ->  4.23ms  ->  3.89ms
StrokeHardwareTessellator              395us  ->  478us   ->  399us
PathWedgeTessellator                   313us  ->  407us   ->  367us
PathCurveTessellator                   278us  ->  335us   ->  331us

With these results from my workstation, we nearly recovered the
regression on the SFCT_motionmark benchmark and exceeded original perf
on the SFCT_on_chop and SFCT benchmarks. SHT_motionmark and SHT have
returned to original, and SHT_one_chop has improved. I'm less concerned
about bringing that back down since SHT is on the chopping block. We see
some improvements on the PWT and PCT benches.

Change-Id: Id76d34089dbaa50fe7d5f82fe54ee3cf605d0c24
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/512577
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2022-03-09 21:51:11 +00:00
Nathaniel Nifong
0832e2081d add one more test suite category for skqp
Change-Id: I3d49bfab23870bb8f96b800d5ecec8730a0b41a0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516377
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2022-03-09 19:44:12 +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
Robert Phillips
335a1d0454 [graphite] Split SkPipelineData out into its own file(s)
SkPipelineData is evolving into a big deal - it deserves it owns files.

Bug: skia:12701
Change-Id: I78b4100f1b90fa10f2b264e6d13fca6f15bba39b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516157
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-03-08 16:04:35 +00:00
Robert Phillips
0c43db950c [graphite] Make GrBlend shareable between Graphite and Ganesh
Additionally make the enums enum-classes.

We will need this to specify fixed function blend modes in Graphite.

This CL is mainly mechanical (i.e., global replace) but some fix-ups were required for our internal bit twiddling with the enum-classes.

Bug: skia:12701
Change-Id: I67abcf8274d14e691974cf253bf65dcb4697bd9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/515318
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2022-03-08 14:51:44 +00:00
John Stiles
b8cee7dab3 Reject operators =, ==, and != on void types.
The fuzzer discovered that we allow == on void types (confusing the SkVM
backend).

Change-Id: Ia9494642faf67f3f86e3a365807be8bd4a7062e4
Bug: skia:13026
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/516796
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-03-07 14:10:29 +00:00