Commit Graph

52675 Commits

Author SHA1 Message Date
John Stiles
e1c80d625b Implement getBVecComponent.
Like getIVecComponent or getFVecComponent, this retrieves the n'th
element of a Boolean compile-time constant vector. This will be used in
followup CLs.

Change-Id: Ib41c9c89cb773251e4c0d6cdcaea0437d8074e48
Bug: skia:11141
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350918
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-01-07 15:26:31 +00:00
Chris Dalton
dc8ed8fb8b Revert "Disable tessellation when we don't have indirect draw support"
This reverts commit b05571f0b8.

Reason for revert: Android crash

Original change's description:
> Disable tessellation when we don't have indirect draw support
>
> Avoids the polyfill that uses looping instanced draws. This has led to
> perf regressions on android.
>
> Bug: skia:11138 skia:11139 chromium:1163441
> Change-Id: I129bf96c6d8a3eaadc79bfca496c7d50189f737e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350738
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

TBR=bsalomon@google.com,csmartdalton@google.com

Change-Id: Iebb473211ff618c1988aa5b7306e3e39efa353f5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11138 skia:11139 chromium:1163441
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/351216
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-01-07 15:16:12 +00:00
John Stiles
f710147302 Add getConstantBool as a sibling of getConstant(Int|Float).
This will be used in a followup CL to implement getBVecComponent. At
present it's not called.

Change-Id: Idd6f18314d0835af3946ea7458e6650384f505ea
Bug: skia:11141
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350703
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-01-07 15:14:21 +00:00
Brian Osman
be0b3b7363 Strip down SkSL::ExternalValues, limit them to functions
Previously ExternalValues were flexible, and could be used as raw values
(with the ability to chain access via dot notation), or they could be
callable. The only non-test use-case has been for functions (in
particles) for a long time. With the push towards SkVM, limiting
ourselves to this interface simplifies things: external functions are
basically custom intrinsics (and with the SkVM backend, they'll just get
access to the builder, and be able to do any math, as well as
loads/stores, etc).

By narrowing the feature set, we can rename everything to reflect that,
and it's overall clearer (the SkSL types now mirror FunctionReference
and FunctionCall directly, particularly in how they're handled by the
CFG and inliner).

Change-Id: Ib5dd34158ff85aae6c297408a92ace5485a08190
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350704
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-01-07 14:28:41 +00:00
skia-autoroll
f39e76846d Roll Chromium from 302da2568953 to ebb8289a1933 (437 revisions)
302da25689..ebb8289a19

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/chromium-skia-autoroll
Please CC johnstiles@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Perf-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-CommandBuffer;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-CommandBuffer
Tbr: johnstiles@google.com
Change-Id: Ib88a26258657c2233e840e429e78828ab84f940d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/351017
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-07 05:02:40 +00:00
skia-autoroll
85dfc104b0 Roll SwiftShader from b9e179f1f239 to 7b2f93895418 (1 revision)
https://swiftshader.googlesource.com/SwiftShader.git/+log/b9e179f1f239..7b2f93895418

2021-01-07 capn@google.com Fix implicit inexact conversion

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/swiftshader-skia-autoroll
Please CC johnstiles@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Test-Debian10-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader
Bug: None
Tbr: johnstiles@google.com
Change-Id: I06958ff1232456e9ed06d3cde64585f531d632c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/351038
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-07 04:53:10 +00:00
skia-autoroll
d64a3193cd Roll Dawn from a84acc4fcca8 to fac169113df7 (3 revisions)
https://dawn.googlesource.com/dawn.git/+log/a84acc4fcca8..fac169113df7

2021-01-07 rharrison@chromium.org Remove HLSL & MSL SPIRV-Cross Fuzzers
2021-01-06 senorblanco@chromium.org Use Jamie's 7-layer burrito of Vulkan DEPS.
2021-01-06 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from e6e704145b31 to 40b4928a73b7 (11 revisions)

Also rolling transitive DEPS:
  https://dawn.googlesource.com/tint from e6e704145b31 to 40b4928a73b7

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dawn-skia-autoroll
Please CC enga@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Debug-Dawn
Bug: None
Tbr: enga@google.com
Change-Id: Idb3f7aff992caf185347d367df5b8437e842a589
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/351037
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-07 04:48:01 +00:00
Brian Salomon
756995baea Revert "Revert "Fix GPU improved noise impl and add to perlinnoise GM.""
This reverts commit 9730dc4041.

Bug: skia:10536
Cq-Include-Trybots: luci.skia.skia.primary:Test-Ubuntu18-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_PreAbandonGpuContext_SK_CPU_LIMIT_SSE41
Change-Id: I6a61ec6e52d7c9e71516b1b5949d698f6576e653
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350958
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-01-07 01:45:10 +00:00
John Stiles
9730dc4041 Revert "Fix GPU improved noise impl and add to perlinnoise GM."
This reverts commit bef02dca9d.

Reason for revert: PreAbandonGpuContext failing on tree

Original change's description:
> Fix GPU improved noise impl and add to perlinnoise GM.
>
> GPU was recently busted when switching alpha-color type swizzles from
> aaaa to 000a.
>
> There was no GM that exercised SkPerlinNoiseShader::MakeImprovedNoise.
>
> It draws wrong before and after this change with the CPU backend.
>
> Bug: skia:10536
> Change-Id: I514e304d022fcccae80699a99facafa8ce947e9f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350916
> Auto-Submit: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: Iac635028b402e6008e3a8050bdfa66052d94fd10
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10536
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350956
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-01-06 23:30:22 +00:00
Brian Salomon
bef02dca9d Fix GPU improved noise impl and add to perlinnoise GM.
GPU was recently busted when switching alpha-color type swizzles from
aaaa to 000a.

There was no GM that exercised SkPerlinNoiseShader::MakeImprovedNoise.

It draws wrong before and after this change with the CPU backend.

Bug: skia:10536
Change-Id: I514e304d022fcccae80699a99facafa8ce947e9f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350916
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-01-06 22:40:10 +00:00
Brian Osman
f4a77739f3 Use SkVM for (many) interpreter tests
Continue to test everything with the ByteCode interpreter, and run most
tests with the new SkSL-to-SkVM utilities, as well. A few tests rely on
features that aren't yet implemented (function calls, looping), and some
of the bespoke tests (that don't use the test() helpers) use even more
exotic features that need to be implemented or disallowed in the IR
generator. This is getting us closer to not needing ByteCode at all,
though.

Refactored a bunch of the helper code to reduce copy-paste among the
many different 'test' functions.

Change-Id: I138d4a24266f2d862742245c5ee895d86c01018e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350560
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2021-01-06 21:58:40 +00:00
Chris Dalton
a7b7964a23 Don't let stroke-width circles become degenerate
Bug: skia:11134
Change-Id: I0b0a3f530452d5bb5c08da7f247728298c234dd7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350583
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-01-06 21:32:20 +00:00
Chris Dalton
b05571f0b8 Disable tessellation when we don't have indirect draw support
Avoids the polyfill that uses looping instanced draws. This has led to
perf regressions on android.

Bug: skia:11138 skia:11139 chromium:1163441
Change-Id: I129bf96c6d8a3eaadc79bfca496c7d50189f737e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350738
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-01-06 21:30:30 +00:00
Mike Klein
279ca2e10c don't dedup loads or stores
We've been assuming that all Ops with the same arguments produce the
same value and deduplicating them, which results in a simple common
subexpression eliminator.

But we can't soundly dedup two identical loads with a store between;
that store could change the memory those loads read, producing different
values, as demonstrated by the first new unit test.

Then, by similar reasoning, it may first seem fine to deduplicate
stores, e.g.

   store32 arg(0), v1
   store32 arg(0), v1

That second store certainly does look redundant.  But if we slot a
different store between, it's no longer redundant:

   store32 arg(0), v1
   store32 arg(0), v2
   store32 arg(0), v1

If we dedup those two v1 stores, we'll skip the second and be left with
v2 in our buffer instead of v1.  This is the second new unit test.

Now, uniform32 and gather ops also touch memory... are they safe to
dedup?  Surprisingly, yes!  Uniforms are easy: they're read-only.  No
way to store to uniforms, so no intervening store can invalidate them.

Gathers are a little fuzzier, in that the buffer we gather from is
uniform in practice, but not strictly required to be... it's not
impossible to construct a program that gathers from a buffer that the
program also stores to, but you'd have to go out of your way to do it,
and it's not a pattern we use today, and SkVM does not provide the
synchronization primitives you'd need to make attempting that even
vaguely sensible.  So gathers in practice can also be deduplicated.

In general it's safe to dedup an operation unless it touches _varying
memory_, i.e.  loads and stores.  uniform32 and gathers touch
non-varying memory, so they're safe, and while index is varying, it
doesn't touch memory.

Change-Id: Ia275f0ab2708d3f71e783164b419436b90f103a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350608
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-01-06 21:17:10 +00:00
Mike Klein
0a80427bf7 gathers aren't necessarily varying
I noticed is_always_varying() is a little wrong, and this new test demos
how.  This isn't terribly important: in most practical situations
gathers will indeed be varying.

Change-Id: I456d4c7287147726c49ebb5af5af347c65cd21d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350602
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-01-06 21:13:10 +00:00
John Stiles
cd80689192 Deduplicate vector constants in SPIR-V output.
Many of our shaders generate the same vector constant dozens of times,
e.g. Gaussian blur uses float4(1) repeatedly. This change avoids
re-emitting redundant vector constants.

Change-Id: I22a71cd8b2783fb997f52d485b49031f64ca6d96
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350701
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-01-06 21:05:50 +00:00
Kevin Lubick
95c1a08b24 [canvaskit] Fix typo in docs example
Change-Id: Ie3b9ad724fa0d71ad1f433324cfcb76c769bfebe
No-Try: true
Docs-Preview: https://skia.org/?cl=350837
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350837
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-01-06 21:01:07 +00:00
Brian Osman
d1b47ba7bf Remove glslang from DEPS
This was needed (transitively) by Dawn previously, but no longer

Cq-Include-Trybots: luci.skia.skia.primary:Build-Debian10-Clang-x86_64-Debug-Dawn,Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-Dawn
Change-Id: I15089298a295be41d7564fe53779e3fafd01229c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350702
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-01-06 20:27:30 +00:00
Ben Wagner
a5784a7b54 Remake SkStrikeCache::commonSetup as constructor.
Also explicitly default all special methods of SkStrikeCache to get
nicer warnings.

Change-Id: I8856a905c6075ca52d4ad900ccd0dacc581cd485
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350637
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2021-01-06 19:46:00 +00:00
Chris Dalton
75887a2321 Move GrTriangulator internal struct definitions to the .h file
This makes them reusable for the edge-AA code when we move it.

Bug: skia:10419
Change-Id: I20042a419617717214535d45fc92a8cae986fb33
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/349356
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-01-06 19:30:32 +00:00
Robert Phillips
edc5b4d706 Expand GrGLGpu::flushViewport
and update GrGLGpu::flushScissorRect's signature to match it.

Change-Id: I9082003934168306833f86d310b942a8d7527384
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350612
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-01-06 19:23:00 +00:00
Mike Reed
b746b1f598 Pass sampling to surface.draw
Bug: skia:7650
Change-Id: I97941a44faa4176f94d57a9c1626ac36b0c0c4ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350557
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-06 19:05:00 +00:00
Kevin Lubick
c294b82260 [canvaskit] Fix examples with makeShaderCubic
Change-Id: I1b89fc690ca93f829181d3e4e582c2285ab95573
No-Try: true
Docs-Preview: https://skia.org/?cl=350700
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350700
Auto-Submit: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
2021-01-06 18:28:31 +00:00
John Stiles
acb091f71d Avoid emitting duplicate constant values in SPIR-V.
Previously, we had constant-value deduplication, based on the SkSL type
of the constant. However, we were still generating redundant constants,
because we would emit a separate constant for Float(n) and Half(n), or
Int(n) and Short(n), even though we generate the exact same instruction
for these constants. We now deduplicate based on the type's number-kind,
separating constant literals into three categories: floats, signed ints,
and unsigned ints. This better matches our type-handling in
getActualType.

Change-Id: I5777d4b3d567839b7aa72dc8de76908c18fc387e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350031
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-06 18:27:10 +00:00
skia-autoroll
83a60d9ac4 Roll skcms from 069b8f699b59 to 8247d3c2481b (1 revision)
https://skia.googlesource.com/skcms.git/+log/069b8f699b59..8247d3c2481b

2021-01-06 mtklein@google.com generalize hlg curves

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skcms-skia-autoroll
Please CC johnstiles@google.com,mtklein@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Tbr: johnstiles@google.com,mtklein@google.com
Change-Id: I5cbfaf6ee8a908c57e97554a1cc666be9f7fb192
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350601
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-06 18:13:10 +00:00
Robert Phillips
14357849e4 Add GrDDLTask::dump method
Change-Id: I763db23e200a359b8eae3514c9cd244f358ea3c2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350605
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-01-06 18:07:10 +00:00
Ethan Nicholas
9ead3df423 Refactor some IRGenerator functions
This CL adds additional variants of some IRGenerator functions to enable
them to be more easily called from upcoming DSL code. This should not
change functionality (other than a slightly different error message in
one case).

Change-Id: Ic727c194fca5111d4283007f4ec23653598a853b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350017
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
2021-01-06 17:58:55 +00:00
Greg Daniel
d15176dbab Track resources on GrVkCommandBuffer as sk_sps.
Bug: skia:11136
Change-Id: I4234cdcbcfba524e030c510ae0a4ce1616c0b94e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350029
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-01-06 17:54:10 +00:00
Greg Daniel
99c4c8331f Move GrcommandBufferRef.h to more generic GrRefCnt.h
I plan to add at least one more gr_* class, so I figure it makes sense
to just keep all this similar things in one place.

Bug: skia:11136
Change-Id: I96d24dd094731e9694201e012fec37926cce564d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350639
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-01-06 17:53:50 +00:00
Robert Phillips
cd11e27a25 Fix DefaultGeoProc member variable names
The pattern appears to be that the variable that stores the uploaded
value has a "Prev" suffix.

Change-Id: I78ea449d75f5fd091c113cf08af919331467eb8d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350638
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-01-06 17:46:00 +00:00
Greg Daniel
417743f806 Add workaround to use full screen loads for vk discardable msaa.
Bug: skia:10979
Change-Id: I81b8692b0bb1582b60a9324492a782d04a09538f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344963
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-01-06 17:28:00 +00:00
Nathaniel Nifong
4a5656834e Accept a callback used in MultiPictureDocument::endPage
Tested on a pixel 3, captures file, shows images.

b:skia:9765

Change-Id: I96f2e854dab21a9e15ff0f6f23c4e84f7616773e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344158
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Alec Mouri <alecmouri@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2021-01-06 16:52:50 +00:00
Joe Gregorio
6094ed698d Include svg module in Doxygen generated output.
Bug: skia:11108
Change-Id: I2c676d674ede2455f35a69d7063b042f8409aea5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350617
Auto-Submit: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
2021-01-06 16:40:09 +00:00
John Stiles
3e72231e7b Clean up constructors for SkSL Literal types.
IntLiteral and FloatLiteral each had a pair of public constructors: one
which takes a Type (what type of Int/Float is this?), and another
constructor which takes a Context (assume the generic Float/Int type).

BoolLiteral had a public Context-based constructor, but its Type-based
constructor was private. The Type-based constructor is now public to
match its siblings. This allows us to create Booleans without needing
a Context&, if we have an fBool_Type, and fixes make_unique (which
doesn't like private constructors).

Change-Id: Iffb4980947a73b3a89aa1452cc90dce63620bd67
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350636
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-01-06 16:38:40 +00:00
John Stiles
32d68537a8 Add SkVM support for conversion constructors to and from boolean.
Change-Id: Ia4a1c38161046b94dc56a1a76704766f1e14aab7
Bug: skia:11131
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350019
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-06 15:23:09 +00:00
John Stiles
53f0ddfa4e Unify conversion constructor simplification code.
Previously, the IR generator had code which could simplify conversion
constructors like `int(1.23)`. Separately, the optimizer's constant
propagation pass had its own separate implementation of these
simplifications as well.

This CL unifies the two implementations. Previously, the constant-
propagation pass version of the code only supported integer literals, so
this change also improves our code generation slightly.

Change-Id: I32c70a5f2aed210d03bef3166b1178a2d40cdabd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350024
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-06 15:13:29 +00:00
Brian Salomon
6cab033499 exclude surfacecontextwritepixels from CK
new unit tests is crashing like many others.

Bug: skia:10869
Change-Id: Ic9418468cb4720a52aebf2486cc359dc456c9983
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350558
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-01-06 14:42:19 +00:00
Brian Salomon
674d2168a3 Revert "Add more comprehensive test for GPU write pixels."
This reverts commit 237911a4d8.

Reason for revert: timeouts

Original change's description:
> Add more comprehensive test for GPU write pixels.
>
> Similar to existing SurfaceContextReadPixels but for writes. Tries all
> combinations of src/dst color type and alpha type for write pixels.
> Always reads back pixels for verification using the ImageInfo of the
> tested surface context.
>
> Bug: skia:8862
> Bug: skia:11130
>
> Change-Id: Id01f6aa511f00c4be47c32746dca872368cd5d82
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/348886
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: I5498be0b20604e520ad887898695a81ca82936ca
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8862
Bug: skia:11130
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350559
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-01-06 14:24:00 +00:00
Greg Daniel
91b37b1cef Fix inline uploads when using vulkan load resolve.
If using discardable msaa surfaces in vulkan, when we break up a
render pass for an inline upload, we must do a load msaa subpass for
the second render pass. However, if the original render pass did not
have this load subpass (e.g. clear or discard load op), then all the
GrProgramInfos for draws that end up in the second render pass will
have been recorded thinking they will be in a render pass with only 1
subpass. Thus we add an override flag to the makeDesc call to force
the actually VkPipeline that gets created to be created using a render
pass with 2 subpasses. We do lose the pre-compile abilities with this
approach, but inline uploads are very rare and already slow.

Ideally we would find a way to pull inline uploads into their own
GrRenderTasks so all this could be known ahead of time. But currently
we allow uploads to happen between draws of the same Op so it makes it
difficult to break up and even know when they'll occur at record time.

Bug: skia:10979
Change-Id: I247b007813dd0be280ce8a72fc6af70fe21f082d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344962
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-01-06 14:17:24 +00:00
Brian Salomon
b43d699bb7 Revert "Revert "Reland "Make textures used with alpha-only color-types produce 0s for RGB""""
This reverts commit 1fb7ecb744.

Cq-Include-Trybots: luci.chromium.try:linux-blink-rel,linux-rel
Change-Id: If6692949edd7722e23bc3b64213e75bc15b91a13
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350026
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-01-06 14:16:09 +00:00
John Stiles
c23c8c7a92 Fix cross-platform deviations in SkStrAppendScalar for inf/nan.
We rely on exact output from SkStringAppendScalar in our
Housekeeper "Generated Files" bot. However, we can't trust snprintf(%g)
to emit the same string for infinite and NaN values on every platform.
For instance, the bits 0xFFFFFFFF as a float are `-nan` on Linux and
`nan` on OS X. Infinity is represented as `inf` on Linux/Mac and
 `1.#INF00` in Visual C++.

This CL standardizes on the strings `inf`, `-inf` and `nan` across all
platforms. This solves a GeneratedFiles issue in the followup CL:
http://screen/5RVdSnLmBupzpja

Change-Id: I648fd32571f8300998ec427dcb3d1e7d7215dbdd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350496
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-06 14:12:19 +00:00
Brian Osman
cdde253e40 Runtime effects: Disallow bitwise ops and integer remainder
Bug: skia:10680
Bug: skia:11088
Bug: skia:11127
Change-Id: I25ea288d03df13147b31bc4ca4b224bbe2fa924e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350030
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-01-06 14:05:59 +00:00
skia-autoroll
6a718c4e90 Roll SwiftShader from ff29e249d317 to b9e179f1f239 (1 revision)
https://swiftshader.googlesource.com/SwiftShader.git/+log/ff29e249d317..b9e179f1f239

2021-01-05 capn@google.com Clarify 3-level caching of sampling routines

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/swiftshader-skia-autoroll
Please CC johnstiles@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Test-Debian10-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader
Bug: None
Tbr: johnstiles@google.com
Change-Id: I54614ce564b5db96258492e39eb40b791c71cf54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350487
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-06 05:02:44 +00:00
skia-autoroll
cb0e22a0dc Roll ANGLE from 026a067c38ef to b590fd1b9a59 (6 revisions)
026a067c38..b590fd1b9a

2021-01-06 ynovikov@chromium.org Roll chromium_revision b5dfde1f4d..481852c5d8 (840075:840387)
2021-01-05 jmadill@chromium.org Vulkan: Clean up "actual"/"intended" naming.
2021-01-05 syoussefi@chromium.org Complete I/O block GLSL tests
2021-01-05 syoussefi@chromium.org Vulkan: Directly capture non-gl_Postion builtins
2021-01-05 jdarpinian@chromium.org Remove tabs from volk.c/h
2021-01-05 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 094b96f7f336 to b5dfde1f4de5 (71 revisions)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/angle-skia-autoroll
Please CC johnstiles@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Release-ANGLE;skia/skia.primary:Test-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC5i7RYH-GPU-IntelIris6100-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUC8i5BEK-GPU-IntelIris655-x86_64-Debug-All-ANGLE;skia/skia.primary:Test-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Debug-All-ANGLE
Tbr: johnstiles@google.com
Change-Id: Ib79f626be58ba3de626044f5470f5fe4634d18f0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350486
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-06 04:58:19 +00:00
skia-autoroll
8b641ebc6c Roll Dawn from cdbd295cc6c4 to a84acc4fcca8 (7 revisions)
https://dawn.googlesource.com/dawn.git/+log/cdbd295cc6c4..a84acc4fcca8

2021-01-06 jiawei.shao@intel.com Enable CompressedTextureZeroInitTest on Win/Intel/Vulkan
2021-01-06 enga@chromium.org Revert "Update PrimitiveTopologyTests to use WGSL"
2021-01-05 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 9a644c7903ca to e6e704145b31 (1 revision)
2021-01-05 enga@chromium.org Update PrimitiveTopologyTests to use WGSL
2021-01-05 enga@chromium.org dawn_wire: Return early in callbacks after the server is destroyed
2021-01-05 enga@chromium.org Use a common helper for std::nothrow
2021-01-05 hao.x.li@intel.com Remove internal resolve buffer from Timestamp compute shader

Also rolling transitive DEPS:
  https://dawn.googlesource.com/tint from 9a644c7903ca to e6e704145b31

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dawn-skia-autoroll
Please CC enga@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Debug-Dawn
Bug: None
Tbr: enga@google.com
Change-Id: Ieb157e0113caffe67e127bdf11dd199b6c7d109e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350485
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-06 04:57:39 +00:00
skia-autoroll
2ca3991958 Roll Chromium from 46171be2c7d7 to 302da2568953 (403 revisions)
46171be2c7..302da25689

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/chromium-skia-autoroll
Please CC johnstiles@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/master/autoroll/README.md

Cq-Include-Trybots: skia/skia.primary:Perf-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-CommandBuffer;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Debug-All-CommandBuffer
Tbr: johnstiles@google.com
Change-Id: Ibbcaa07a7d60af89da376543bbef78d22fdcccde
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350484
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-06 04:35:09 +00:00
Brian Salomon
237911a4d8 Add more comprehensive test for GPU write pixels.
Similar to existing SurfaceContextReadPixels but for writes. Tries all
combinations of src/dst color type and alpha type for write pixels.
Always reads back pixels for verification using the ImageInfo of the
tested surface context.

Bug: skia:8862
Bug: skia:11130

Change-Id: Id01f6aa511f00c4be47c32746dca872368cd5d82
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/348886
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-01-06 01:40:41 +00:00
Chris Dalton
854ee85736 Delete GrTriangulator::Mode
Bug: skia:10419
Change-Id: Ia81c615538ff1f0fe2372ea2e7bf437ceec08d7e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/349336
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-01-05 23:53:01 +00:00
Chris Dalton
57ea1fcb74 Convert GrTriangulator to a class
This simplifies the argument lists for functions and will also allow us
to extract the AA logic into its own subclass.

Bug: skia:10419
Change-Id: If51e86a7633da7a3ee9352c0236258a0a21f2ebe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347976
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2021-01-05 22:10:11 +00:00
Florin Malita
736c992966 [svg] Deferred text position adjustments
Upcoming textPath changes require position adjustments (relative offset,
rotation) to be applied after mapping to path, at chunk flush time.

Bug: skia:10840
Change-Id: Ifccea2983d5d5c57876d0a25e1da113e4c9cd51a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350018
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2021-01-05 21:52:25 +00:00