Commit Graph

29385 Commits

Author SHA1 Message Date
Chris Dalton
e11168d060 GrStrokeHardwareTessellator cleanups
Remove the stateful "fViewMatrix" and "fStroke" members.

Bug: chromium:1172543
Change-Id: Ib7c2ca6aabfa50b3876331a3075b1688f8bd95c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372336
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-02-19 20:43:48 +00:00
Chris Dalton
d235b9178b Remove GrStrokeHardwareTessellator::fCurrentPoint
This is a step toward making the class less stateful.

Bug: chromium:1172543
Change-Id: I1fbcff53fa823c49dcca757fa970dcebc9a9aa25
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372286
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-02-19 20:17:58 +00:00
John Stiles
54f0049ddc Move Constructor generation and type-coercion out of IRGenerator.
The IRGenerator's `convertConstructor` and `coerce` were tied at the
hip--coercion can create a constructor, and creating a constructor can
cause type-coercion. This CL migrates IRGenerator::coerce to
Type::coerceExpression, and migrates IRGenerator::convertConstructor to
Constructor::Make.

Most constructor creation should go through Constructor::Make instead of
make_unique<Constructor> for best results. There are exceptions to this
rule:

- during the Compiler's `optimize` phase, we hold raw pointers to
unique_ptrs of existing expression trees, and are manually tracking
variable usage counts, so adjusting the IR tree should be done with
extreme care. Continue to use make_unique here to avoid any "surprise
improvements."

- the Rehydrator is attempting to recreate an IR tree exactly as it used
to be and doesn't want additional optimization or fixups

There are still Constructor-related optimizations in simplifyExpression
which are not yet implemented in Constructor::Make. These are migrated
to Constructor::Make at http://review.skia.org/371482

Change-Id: I0f3876f932835fc2e347ae95414bc490085f120c
Bug: skia:11342
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/370876
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-02-19 18:53:52 +00:00
Mike Reed
7b9934300a Remove unused convexity code
Clients no longer opt-in for this, so no diffs expected.

Change-Id: I8faa6f08990d877dd16d32a5a5e307948813725f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/370037
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-02-19 18:33:57 +00:00
John Stiles
ca107c9b70 Move strictES2Mode method to ProgramConfig.
This will help us migrate code out of IRGenerator.

Change-Id: Id9c70cc4577ed41b2fc5ad26f752caea13a56083
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372437
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-02-19 18:09:27 +00:00
John Stiles
b2705a1888 Replace AutoClear with SK_AT_SCOPE_EXIT.
Change-Id: I218429246da2da3e80fb1823241fdbcf84f0dd30
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372478
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-02-19 17:54:17 +00:00
Brian Osman
a443dc380c Reland "Remove (unused) gpuType from SkRuntimeEffect::Uniform"
This reverts commit 0fdcaa5757.

Reason for revert: Fix landed in Android

Original change's description:
> Revert "Remove (unused) gpuType from SkRuntimeEffect::Uniform"
>
> This reverts commit cc80a47566.
>
> Reason for revert:  IWYU cleanup broke less IWYU-clean Android,
>
> frameworks/native/libs/renderengine/skia/filters/BlurFilter.cpp:180:17: error: variable has incomplete type 'SkRRect'
>         SkRRect roundedRect;
>                 ^
> external/skia/include/core/SkCanvas.h:58:7: note: forward declaration of 'SkRRect'
> class SkRRect;
>
>
> Original change's description:
> > Remove (unused) gpuType from SkRuntimeEffect::Uniform
> >
> > Also remove some unnecessary includes, then IWYU.
> >
> > Change-Id: I41e88f0e661c59e75cb26e28768801b811fe8ee8
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371140
> > Commit-Queue: Brian Osman <brianosman@google.com>
> > Reviewed-by: John Stiles <johnstiles@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,brianosman@google.com,johnstiles@google.com
>
> Change-Id: Id655a6835ebffdb4f5f82474c287c09a69a737df
> No-Tree-Checks: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371941
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

# Not skipping CQ checks because this is a reland.

Change-Id: I67deaee08f1dfea8d91121b3e665d2e6036b6139
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372216
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-02-19 17:53:47 +00:00
Ethan Nicholas
8d03eb0945 Added DSL sk_SampleCoord var
Change-Id: I539a288765243b2b9d994240c7917b036590f49d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/370916
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
2021-02-19 17:40:30 +00:00
Jim Van Verth
24ec76454a Fix directory path expansion for iOS bundles.
CFBundleCopyResourceURL is expecting a path with no trailing '/', so we
use CFURL to treat the relative path as if it's for a vanilla file and
normalize it.

Also adds in some variable renames to make it more general.

Change-Id: I0db38702cad2b42a32fd4d4516a23cea714a5f50
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372199
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2021-02-19 16:32:09 +00:00
Mike Klein
a8448470e8 cache whole luma color filter
We're caching the runtime effect, but luma filter
has no uniforms, so we can cache the whole filter.

Change-Id: I7c4b37a35928b9bc804e921f99bb1eccaf13e7a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372294
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-02-19 13:46:07 +00:00
Michael Ludwig
a50940da6d Delete deprecated SkLightingImageFilter header
Bug: skia:11230
Change-Id: I8983d160ff0317514572d13aa2a3f1218e15da8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371959
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-02-19 13:18:47 +00:00
Mike Klein
af8db303f7 promote the runtime mixer CF to the only mixer CF
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: I898fc64d8df625d22750cfe1145ba4b02acdfbb9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372078
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-02-19 11:43:47 +00:00
Chris Dalton
82094cdb9d Chain indirect stroke ops that have mismatched colors
The indirect tessellator can't combine overlapping, mismatched colors
because the log2 binning draws things out of order. But we can still
chain them together and generate a single long list of indirect draws.

Bug: chromium:1172543
Bug: skia:10419
Change-Id: Id7fc7488411a2a189e24cd7dd692e5c78497f498
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/370197
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-02-19 09:25:25 +00:00
Chris Dalton
1017a3558f Add a dynamic color attrib to hw tessellated stroking
Only adds color to the hardware tessellator. The indirect tessellator
reorders draws with is log2 binning, so we can't have different
colors.

Bug: chromium:1172543
Bug: skia:10419
Change-Id: I2a3700cd4572e8222002bfb028af05c6ec447708
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/369976
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-02-19 00:19:05 +00:00
Chris Dalton
fac4efcabe Don't use structured binding on the PathStroke struct
Change-Id: I6aa2890ac9790c41acf405f7b3f83c402479cdf4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372160
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-02-18 23:26:54 +00:00
Michael Ludwig
91bfda0ac8 Rename SkImageSource to SkImageImageFilter
Also deletes the unnecessary old header file.

Bug: skia:11230
Change-Id: Ie7c3926fe635a37e617e5e1fcac7c05eb576bbf1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368617
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-02-18 22:42:37 +00:00
John Stiles
9b7ad1b7b9 Migrate SwizzleComponent to be shared between SkSL::Swizzle and the DSL.
The SwizzleComponent enum would be useful outside of the DSL. This CL
creates a SkSL::SwizzleComponent namespace and has the DSL inject that
namespace into SkSL::dsl via using-directive. Future CLs will use values
from this enum within SkSL::Swizzle itself.

Users expect that `using namespace SkSL::dsl;` will allow statements
like `Swizzle(var, X, Y)` to work normally without any extra
qualifications, using-declarations or #includes, so this is a little
more involved than forward-declaring an enum would be normally.

Change-Id: Id4e2f109d01e465c315c6278f3d4b87027988c86
Bug: skia:11342
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372018
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-02-18 22:33:25 +00:00
Brian Osman
58ee89879f Remove "buffer" modifier from SkSL
Change-Id: I4df18946cdb3d9f1f7833461f913f2df94696821
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372197
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-02-18 21:48:05 +00:00
Brian Osman
bfcd7824cd Use 8 or 16 bit state values in lexer, depending on # of states
Change-Id: I3cde541ff8eb7239394e825061ed1433806af5c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372123
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2021-02-18 21:36:35 +00:00
Herb Derby
6b748e4462 Reland "use a linked list for GrAtlasTextOp geometries"
This is a reland of 82a8130654

Original change's description:
> use a linked list for GrAtlasTextOp geometries
>
> Instead of using a GrTBlockList<Geometry> to hold the geometries
> in the op. Allocate them on the RecordTimeAllocator, and
> link them together.
>
> Change-Id: I32af5724e7abeca1ddb6d38b26afbff7919cbc76
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341725
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

Change-Id: I526d8b0b06fca13046c065cbc06f0c0e1103ce11
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371996
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-02-18 21:21:55 +00:00
Adlai Holler
17776e38ef Move GrProxyProvider down to GrRecordingContext
Bug: skia:10286
Change-Id: I474cb0e4cbde3b576604e80891912104990b786c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372118
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
2021-02-18 20:06:25 +00:00
Brian Osman
51963d3c4b Remove "precision" from SkSL lexer
This wasn't even referenced by the parser.

Change-Id: Id6246c3909b7f2b499908a742bdd61f4918f023a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372119
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-02-18 19:59:37 +00:00
Brian Osman
9ca38ff4b4 Remove GLSL memory qualifiers from SkSL
These were all unused, and only implemented on one backend.

Change-Id: Ibd2fcef1a971e6c1bd9da0784c5d852a60708484
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372117
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-02-18 19:57:05 +00:00
Chris Dalton
42582fc97b Add dynamic stroke attribs to tessellated stroking
Allows us to batch together strokes that have different SkStrokeRecs.

Bug: chromium:1172543
Bug: skia:10419
Change-Id: I11dc01e60bc17a6bb3c3b635f9edb2944a2f2edc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/369579
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-02-18 19:35:25 +00:00
Brian Osman
9cb3f98191 Remove PLS support from SkSL
Change-Id: I885149c73be63c223ac88a697ffe046a7f8384d0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372116
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-02-18 19:16:45 +00:00
Michael Ludwig
e548dcbf1b Delete deprecated SkDropShadowImageFilter header
Bug: skia:11230
Change-Id: I9da638b5e1de50aee9a805547f51e013e55747b4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368598
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-02-18 18:20:42 +00:00
Mike Klein
c301cc72f3 Revert "split working-format filter into two parts"
This reverts commit 5db699af9d.

Reason for revert: the wrapped color filter now no longer is told that it's in the working format... its asFragmentProcessor() / program() calls will be fed the destination surface's format instead of the working format.

Original change's description:
> split working-format filter into two parts
>
> The old filter represented the whole (xform -> child -> xform) sandwich,
> where this new one represents just one xform, with the factory now using
> Compose() to piece the sandwich together.
>
> This is conceptually simpler, which is nice, and we should also be able
> to use this to replace SkSRGBGammaColorFilter (next CL).
>
> Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
> Change-Id: I6dee3c968329ab74f24e01fcdb82872141cdd496
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371456
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,reed@google.com

Change-Id: I2c0daa03dde396a5b2414a8cfe8d3754d6bf6e0c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372076
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-02-18 17:24:14 +00:00
Brian Osman
2c350761c2 Route Dawn shader compile errors through the error handler
Change-Id: Ia7fb5dfc0239ab0fdd3259246b727b7f901dca7b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372017
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-02-18 17:17:32 +00:00
Brian Osman
8b01c6d113 Enforce "C" locale when building shaders in Dawn
All other backends do this (to avoid floating point numbers with
commas), was just missing here.

Needed for https://skia-review.googlesource.com/c/skia/+/368876

Change-Id: I506dbadf969c3b000b3e90b3f5864c4fe499a884
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371873
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-02-18 17:10:03 +00:00
Brian Salomon
bde1eb681c Remove GrDirectContext::ComputeImageSize. Use SkImage::textureSize.
Bug: skia:11208
Change-Id: Ie5f56b6d168ab43189be75bb2be60b315e724569
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371958
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-02-18 16:56:19 +00:00
Greg Daniel
d2a3912e88 Updated vulkan persistently mapped to work with new transfer type.
When I adding the new kTransferCpuToGpu enum for vulkanmemory the
persistently mapped property was dropped for those buffers and this adds
this back.

Also we are now using the special DEVICE_LOCAL and HOST_VISIBLE memory
so disable the persistent mapping for those buffers (see deleted comment
and added comment in caps).

Change-Id: I9353b6da5da57b3c8ae1f93cc89c671174a86b84
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371476
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2021-02-18 16:56:17 +00:00
Michael Ludwig
1d60c19a08 Rename SkDisplacementMapEffect to SkDisplacementMapImageFilter
Also deletes unnecessary header and deprecated types
associated with implementation.

Bug: skia:11230
Change-Id: Ibfd7dcf305febae794edfe777fc64efc0559909b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368597
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-02-18 16:51:14 +00:00
John Stiles
70e51e6d76 Enable printf warnings on SkSL::String.
Change-Id: Ifea2b490b86e69b871d31dea544407e857dc4677
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371484
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-02-18 14:16:35 +00:00
Ethan Nicholas
9f8e9ece8a Converted GrConvexPolyEffect to SkSL DSL
Change-Id: I3df21c585ae399d5a78d8b8dd9f4b3253f5f1fa2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/370877
Reviewed-by: John Stiles <johnstiles@google.com>
2021-02-18 14:12:02 +00:00
Mike Klein
0fdcaa5757 Revert "Remove (unused) gpuType from SkRuntimeEffect::Uniform"
This reverts commit cc80a47566.

Reason for revert:  IWYU cleanup broke less IWYU-clean Android,

frameworks/native/libs/renderengine/skia/filters/BlurFilter.cpp:180:17: error: variable has incomplete type 'SkRRect'
        SkRRect roundedRect;
                ^
external/skia/include/core/SkCanvas.h:58:7: note: forward declaration of 'SkRRect'
class SkRRect;


Original change's description:
> Remove (unused) gpuType from SkRuntimeEffect::Uniform
>
> Also remove some unnecessary includes, then IWYU.
>
> Change-Id: I41e88f0e661c59e75cb26e28768801b811fe8ee8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371140
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,brianosman@google.com,johnstiles@google.com

Change-Id: Id655a6835ebffdb4f5f82474c287c09a69a737df
No-Tree-Checks: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371941
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-02-18 13:16:33 +00:00
Robert Phillips
6933774c44 Revert "use a linked list for GrAtlasTextOp geometries"
This reverts commit 82a8130654.

Reason for revert: I believe this is blocking the Chrome roll

Original change's description:
> use a linked list for GrAtlasTextOp geometries
>
> Instead of using a GrTBlockList<Geometry> to hold the geometries
> in the op. Allocate them on the RecordTimeAllocator, and
> link them together.
>
> Change-Id: I32af5724e7abeca1ddb6d38b26afbff7919cbc76
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341725
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

TBR=herb@google.com,robertphillips@google.com

Change-Id: I238f7e91e1b1131c46ad1097371855eda2dbf553
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371956
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-02-18 12:58:13 +00:00
Herb Derby
82a8130654 use a linked list for GrAtlasTextOp geometries
Instead of using a GrTBlockList<Geometry> to hold the geometries
in the op. Allocate them on the RecordTimeAllocator, and
link them together.

Change-Id: I32af5724e7abeca1ddb6d38b26afbff7919cbc76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341725
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-02-18 05:14:29 +00:00
Brian Osman
2fe67f9680 Disallow initializers on uniform variables
Bug: skia:11335
Change-Id: I88c952cbfe2d2c5920e17675da1674928f37b982
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371480
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-02-18 01:01:38 +00:00
Brian Osman
5e603c3a46 Support global variables in pipeline stage generator
Bug: skia:11295
Change-Id: Iec11f3f4d26eb5b1c07707b3cedd09096bad80d0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371478
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-02-18 00:54:49 +00:00
Mike Klein
5db699af9d split working-format filter into two parts
The old filter represented the whole (xform -> child -> xform) sandwich,
where this new one represents just one xform, with the factory now using
Compose() to piece the sandwich together.

This is conceptually simpler, which is nice, and we should also be able
to use this to replace SkSRGBGammaColorFilter (next CL).

Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: I6dee3c968329ab74f24e01fcdb82872141cdd496
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371456
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-02-17 23:01:38 +00:00
John Stiles
973009b04b Clean up type coercion code and IRGenerator::checkValid().
When coercing a type, we would previously call checkValid() so we could
detect function-references and type-references, so we could get a nicer
error message.

It turns out that we can just do the "is this a type-reference/
function-reference?" check directly inside coerce() and get the same
improved error messages. Since we should be coercing all our values to
the right type, and type/function-references aren't coercible to
anything, this should catch them all. I don't expect any of these
to survive all the way to the end of IR generation.

(In case one of these types does slip through, I've left the error case
in checkValid, but I've also put in an assertion. If the fuzzer can
make that assertion fire, we are probably missing a call to coerce()
somewhere.)

This cleanup is meant to help migrate coerce() out of IRGenerator.

Change-Id: I031809adf439b1766048768b782c57e7f2494006
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371479
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-02-17 22:39:48 +00:00
John Stiles
d12046432d Remove ProgramSettings from IRGenerator and the Inliner.
These classes now read the program configuration from the Context.

Change-Id: I15c95cacebb9836ee8f2162c4f4b7f99d453639c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371396
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-02-17 22:17:22 +00:00
Brian Osman
a5ab63a062 Tweak GlobalVariables.rte test, and adjust .stage output
Adds trivial name mangling to the .stage output, so we can verify that
it's working in all places (declarations, references, etc). Also added
another global variable whose initializer is - in turn - another global.

Bug: skia:11295
Change-Id: Ic220bfae0a6d1eeeba66ade30d3d781af15c5dea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371477
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-02-17 22:13:19 +00:00
Mike Klein
6bba1bcdc1 impl WorkingFormatCF::getFlags()
The only color filter flag is isAlphaUnchanged(), so since alpha is
unchanged through any working format transformation, we can just return
whatever flags the child filter claims.

Add a simple test.

Change-Id: I2ce0300d9db55f953660ed157510070755c4c677
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/370824
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2021-02-17 21:25:58 +00:00
Ethan Nicholas
4635b5dad0 Added assert to catch unbalanced DSL FP Start/Ends
Change-Id: Ic2c823ed8d8ac77fd6654cc2db1347eb648edf56
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371397
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-02-17 20:42:04 +00:00
Brian Osman
c057669d1b Support initializers on global variables in SkSL to SkVM
Bug: skia:11295
Change-Id: I72c09b75a3ff5d668e99dcc3620850b82071b560
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371340
Reviewed-by: Mike Klein <mtklein@google.com>
2021-02-17 20:40:32 +00:00
Brian Osman
cc80a47566 Remove (unused) gpuType from SkRuntimeEffect::Uniform
Also remove some unnecessary includes, then IWYU.

Change-Id: I41e88f0e661c59e75cb26e28768801b811fe8ee8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371140
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-02-17 20:33:28 +00:00
Greg Daniel
d50ccf2d53 Remove SK_USE_LEGACY_VK_ALLOCATOR_USAGE_NAMES code.
Bug: skia:11207
Change-Id: I7e6f7bc93bac6d36c61c2e6500a2c5e0f7556bcb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/369477
Auto-Submit: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-02-17 20:30:48 +00:00
John Stiles
270cec21a7 Make program configuration accessible from the SkSL context.
During IR generation, this information was previously only accessible
from inside the IRGenerator class. Now anyplace with access to the
Context can look up the program settings or kind.

Moving the ProgramKind inside the ProgramSettings struct would be an
interesting future goal, but this ends up causing significant ripple
effects outside of SkSL and may not be worth untangling. Many of our
callers expect to compile a Vertex, Fragment, and/or Geometry shader all
at once with the same Settings but differing ProgramKind, so perhaps
the distinction between Kind and Settings is relevant and worth
keeping as-is.

Change-Id: I8b3a61510911b4ff309549663f81f3b960bdb0da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371256
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-02-17 18:49:34 +00:00
Herb Derby
eeb30aea42 a few text blob and text op cleanups
Change-Id: I2dd7cacc19232c0ff9d890c613fe6cc2346e8553
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/371142
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-02-17 18:38:16 +00:00