Commit Graph

52934 Commits

Author SHA1 Message Date
John Stiles
9d7aa41081 Reorder GLSL output so that functions are emitted last.
The Inliner likes to move function bodies around; after inlining, code
can inadvertently move upwards, above ProgramElements that the code
relies on. We work around this by always emitting functions last.

Change-Id: Ie5486cc3a79a478920342fb9f578d575486fb4cf
Bug: skia:11186
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354669
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-01-15 23:15:46 +00:00
Leon Scroggins III
add35d9474 Deprecate (and ignore) SkAndroidCodec::ExifOrientation
This was originally added so that some clients (BitmapFactory,
BitmapRegionDecoder) could ignore exif for backwards compatibility, and
others (ImageDecoder) could respect it.

With the addition of NDK APIs for decoding all frames of an animated
image, hwui/ImageDecoder will handle compositing frames, including
handling the orientation, so it may as well always handle it.

This removes tests for SkAndroidCodec that are no longer applicable.
Android already has tests for most of them.
AndroidCodec_sampledOrientation is recreated in
ag/Ieda439910ae52e609f0710d424503616d99ae5c7.

Change-Id: Ibd280986892176f284895d543f2f50bca22d196b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344763
Commit-Queue: Leon Scroggins <scroggo@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2021-01-15 23:08:46 +00:00
Brian Osman
ea485e5285 Enforce ES2 limits on indexing expressions (in runtime effects)
This enforces an even stricter version of the rules from GLSL ES 1.0
Appendix A, Section 5. Essentially, indices (to arrays, vectors,
matrices) must be made of literals, loop indices, and expressions made
of those two.

Bug: skia:10837
Bug: skia:11096
Change-Id: I437a5ed64da58e24d5991ddbde68859f5214e98b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354665
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-01-15 22:49:27 +00:00
Florin Malita
d414e600b2 [svg] Property inheritance workaround
Property inheritance is supposed to follow the tree hierarchy, but we
implement it based on the render path.

One nasty side effect is when resolving IRI paint servers
(gradients, patterns), the referencing node properties get inherited
(leak) into the paint server fragment.  E.g.

  <pattern id="pat">
    <rect fill="green"/>
  </pattern>

  <rect stroke="blue" fill="url(#pat)" stroke="blue"/>

The pattern subtree incorrectly inherits a blue stroke property from
the referencing node when we resolve the fill.

As a temporary (and imperfect) workaround, we can reset the presentation
context when resolving IRI paint servers.

Change-Id: Ia4a8a6199222820661f805c43340b5e16902feff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354668
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2021-01-15 22:19:16 +00:00
John Stiles
4f2bcff08e Implement Type cloning for enums and structs.
As far as I know, there shouldn't be a way to introduce a struct or enum
other than at global scope; the keywords are not accepted inside a
function body. In fact, I wasn't able to find a way to exercise these
code paths in practice. But we now have concrete assurance that any
possible type can be cloned into a symbol table safely; all Types are
either built-in (available everywhere by design) or are clonable.

Change-Id: I4b006b6cab995b3e598b683736ab9689828629c9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354664
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-15 21:45:56 +00:00
John Stiles
ddcc843e8d Migrate Type-cloning logic from the Inliner into Type.
The inliner needs to clone Types from one SymbolTable to another when
cloning blocks of code. However, it seems like a poor division of
responsibility for the inliner to need to know how to clone every Type
correctly. It makes more sense for this logic to exist within the Type
class itself.

Change-Id: I4a383d5e22d5084eb35992a0b5c24865d2030282
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354662
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-15 21:38:56 +00:00
John Stiles
8f7689ce76 Revert "Disable the MSAA atlas mode for CCPR"
This reverts commit 97c476ecb7.

Reason for revert: tree breakage - Test-Debian10-Clang-GCE-GPU-SwiftShader-x86_64-Debug-All-SwiftShader


Original change's description:
> Disable the MSAA atlas mode for CCPR
>
> We have a long term path rendering plan that uses dynamic MSAA instead.
> This CL is a test to see if we can drop support for CCPR now.
>
> Change-Id: I1bff3ca3143a6b453b65a7932a1805c195922805
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354036
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

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

Change-Id: I9f472807f743b8ddfee92800ee3b62609f2d4717
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354673
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-01-15 21:38:38 +00:00
Brian Osman
035606d291 Enable matrix-negation interpreter test
This was disabled a long time ago, when this was (incorrectly) forbidden
by the IR generator, most likely.

Change-Id: I14585d249104b263c152fa59cbeba0c4e9a2e074
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354666
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-01-15 21:30:46 +00:00
Mike Reed
bfd330d081 Add filter param to picture-shader
Bug: skia:7650
Change-Id: I5eb6d73cf92c22b3846d4f4b81c7a8c06e2889a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354659
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-01-15 21:05:56 +00:00
Heather Miller
d5412d9f80 update release notes for m89
Change-Id: Ie23baa11be7c52f969676512efabc44648c23dc4
Docs-Preview: https://skia.org/?cl=354663
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354663
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
2021-01-15 19:58:19 +00:00
John Stiles
9f079f7c0d Add Type::isEnum helper method.
Change-Id: I62755dfcf5c8bb5bd7e0cc742e675aacf4afbb78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354658
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-01-15 19:52:56 +00:00
Tyler Denniston
a25e1a38dd [svg] Implement feBlend filter
Note we are still not passing filters-blend-01-b because we don't yet
support feImage.

Bug: skia:10841
Change-Id: Ibca52c0e8e8d45e73473dea3b0252d6b81eaa584
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354657
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-01-15 19:45:56 +00:00
Brian Osman
bf061a32ef Fix an (int + float) error in "cube" particle demo
Also fix a crash if you try to play an effect that has never compiled
correctly. (After the first compile, the arrays were always large enough
to set "dt" -- this code is all going to be reworked soon for SkVM, but
I hit this while diagnosing the type coercion error).

Change-Id: I5bfab539c7304bde2da36b0b0604991d5b5b303a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354660
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-01-15 19:15:16 +00:00
Mike Klein
7de307a64f pull arm64 binary on arm64 Mac/Linux
Really I just want the Mac binary, but Linux kind of comes along for
free.  (It'd work for Windows too if there were arm64 GN binaries.)

Python2 calls Linux 'linux2', while Python3 calls it 'linux'.

Change-Id: I8ef3d482a956acfe6b1eec3d7b5429b25c528c54
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354556
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-01-15 19:00:46 +00:00
Tyler Denniston
a22d21e447 [svg] Fix incorrect optimization for opacity layer
When both filter and opacity attributes are set on a leaf node, the
opacity must be applied as a separate layer so that the results of the
filter are modified by the opacity. Previously in this circumstance we
were incorrectly applying the opacity to the paints only (without a
layer).

To illustrate:

<svg viewBox="0 0 1000 500" version="1.1"
     xmlns="http://www.w3.org/2000/svg"
     xmlns:xlink="http://www.w3.org/1999/xlink">
  <defs>
    <filter id="Green" x="0%" y="0%" width="100%" height="100%">
      <feFlood flood-color="lime" flood-opacity="1" />
    </filter>
  </defs>
  <rect x="30" y="20" width="400" height="100" fill="red" opacity="0.1"
        filter="url(#Green)"/>
  <g filter="url(#Green)">
    <rect x="30" y="200" width="400" height="100" fill="red" opacity="0.1"/>
  </g>
</svg>

The two rects should render differently. In the <g> case, the filter
output (opaque green) overrides the translucent red pixels of the rect.
In the <rect> case, the filter output overrides the translucent red
pixels with opaque green, but then is modified by the opacity on the
<rect>.

Relevant W3C test is filters-blend-01-b (and possibly others).

Change-Id: I165eed36c546f1f99457865cee58ee2b3bffe6f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354879
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-01-15 18:55:16 +00:00
Chris Dalton
97c476ecb7 Disable the MSAA atlas mode for CCPR
We have a long term path rendering plan that uses dynamic MSAA instead.
This CL is a test to see if we can drop support for CCPR now.

Change-Id: I1bff3ca3143a6b453b65a7932a1805c195922805
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354036
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-01-15 18:43:56 +00:00
Mike Reed
2ac6ce8e6e Simplify common case for recttorect
Change-Id: I70e295a677b8cac3d578e3cd57472c833af03877
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354336
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-15 18:37:46 +00:00
John Stiles
e6c67c5bc4 Restrict the creation of built-in types to BuiltinTypes class.
This CL limits the availability of functions like "MakeLiteralType" and
"MakeScalarType" to the BuiltinTypes class. This allows us to know,
definitively, that whenever we encounter these types, they are part of
the BuiltinTypes class and available anywhere in the program without
needing to be cloned.

The remaining MakeXxxxxxTypes in SkSL::Type are constructed dynamically
and injected into child symbol tables during parse/IR generation. These
types must be treated with special care when being moved or cloned:
- Arrays (MakeArrayType)
- Structs (MakeStructType)
- Enums (MakeEnumType)

Change-Id: I5490d6739c2a5ffdd54195f5a0b9b5be05d07953
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354878
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-01-15 17:49:26 +00:00
Florin Malita
b2aa04d184 [svg] Minor cleanup
Replace a bunch of no-op stubs with a default template impl.

Change-Id: I37b24361dcf3d7c247a12a7c20a9f3a967b6f9e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354877
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2021-01-15 17:32:16 +00:00
John Stiles
ac01aca0fe Migrate BuiltinTypes to a separate file from Context.
No code or functionality changes.

Change-Id: I24317767570ae9ebbfea56f873d98709fb22d8b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354876
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-15 17:23:16 +00:00
Mike Reed
5ec22387ff Simplify common case of linear filtering with no mips
Change-Id: I08b4a7bc088705b93a0aa680f6733d09c7ad23dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354221
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-15 16:47:16 +00:00
Mike Klein
4f4c064d5b roll gn to latest
Nice periodically, and this version also has a Mac arm64 binary.

Refine a few visibility rules from ":*" (any target in this file)
to "./*" (any target in any .gn file anywhere under this directory).

Use frameworks over libs where now required.

Change-Id: Ic19e1533e2810d18ae4684645d8555b422320b7f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354536
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-01-15 15:34:00 +00:00
Florin Malita
73d57bf4e8 [svg] Add support for mask color-interpolation
https://www.w3.org/TR/SVG11/painting.html#ColorInterpolationProperty

Bug: skia:10842
Change-Id: I3e97577ee257c9afe64d924c768c85badbfab07d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354220
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2021-01-15 15:19:40 +00:00
John Stiles
6a1a98c313 Fix for fuzzer-discovered use-after-free.
The inliner discovered that when a binary expression is inlined, its
type is not cloned into the destination's SymbolTable. This meant that
when the inlined-from function was later dead-stripped, the type pointer
would become dangling. Did a quick pass over inlineExpression and
inlineStatement and ensured that types are always copied.

Also found that `copy_if_needed` was making a copy of eligible types
each time one was encountered, instead of making one copy and reusing
it. This is fixed as well.

Change-Id: Iee3259ab038dfb04034bf0110af1909ccffec3de
Bug: oss-fuzz:29444
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354219
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-01-15 15:11:00 +00:00
Tyler Denniston
5878ecef2f [svg] Implement feOffset filter
https://www.w3.org/TR/SVG11/filters.html#feOffsetElement

We should now be passing filters-felem-02-f W3C test.

Bug: skia:10841
Change-Id: I642cf3c8816b83bdf88066c55103e432ae9c9d5a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354216
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-01-15 15:04:30 +00:00
Brian Salomon
2ba80af000 Test all YUVA image factories with different encoded origins.
Now that SkImage_GpuYUVA stores a GrYUVATextureProxies it supports
encoded origins.

Modify wacky_yuv_format GMs to use different origins and remove
restriction in SkImage::MakeFromYUVAPixmaps.

Bug: skia:10632
Change-Id: I02477d592b7baba164944d629eeac48223698c10
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353623
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-01-15 14:55:10 +00:00
John Stiles
4ed174526b Honor fIsScope when emitting a Block's description.
Change-Id: I93d580e67cb66d388bd66b280ff229cb79e5b154
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354218
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-01-15 14:43:40 +00:00
Florin Malita
cf1e2f3d9b [svg] Fix mask edge artifacts
Per spec, the explicit <mask> bounds [x,y,w,h] are used to also clip
the content (the actual mask geometry may extend beyond these bounds).

This clip is currently scoped such that it applies both to the mask
layer and the content layer.  When the clip is not pixel-aligned,
we're anti-aliasing both layers' edges -- which darkens the composition
result (producing dark hairlines around the mask).

Push the clip down such that it applies to content only.

Change-Id: I32169e2b6dc9685e50a51c6b22cfaaac1a897239
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354217
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2021-01-15 14:31:50 +00:00
Greg Daniel
70ea0d97c1 Fix caps checks for vulkan indirect and instanced draws.
Change-Id: I74314d233582618b526ac0db14da5b41553ddbff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353096
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-01-15 14:11:10 +00:00
skia-autoroll
7f81cb6901 Roll SwiftShader from 5255c465bbba to aedd133cd85f (1 revision)
https://swiftshader.googlesource.com/SwiftShader.git/+log/5255c465bbba..aedd133cd85f

2021-01-14 amaiorano@google.com VulkanBenchmarks: fix memory leaks

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 ethannicholas@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: ethannicholas@google.com
Change-Id: Ib58ece5c5c409ad0a384611d1a3a3c95e1cb2ce5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354377
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-15 05:02:42 +00:00
skia-autoroll
b1847d2c87 Roll ANGLE from 198dc345383e to 50c82f42e33f (10 revisions)
198dc34538..50c82f42e3

2021-01-14 geofflang@google.com Don't index into SystemInfo gpus if it's empty.
2021-01-14 timvp@google.com Tests: Add Magic Tile 3 trace
2021-01-14 syoussefi@chromium.org Vulkan: Move xfb buffer decl to translator in emulation path
2021-01-14 timvp@google.com Capture/Replay: Only get source for linked programs
2021-01-14 jmadill@chromium.org Revert "Vulkan: Prefer host cached memory for Buffers"
2021-01-14 natsu@google.com Update roll AOSP scripts to reflect vulkan-deps subdirectory
2021-01-14 timvp@google.com Fix call to getImageFormatFeatureBits() in SurfaceVk.cpp
2021-01-14 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from 3549479dc4cc to 5255c465bbba (6 revisions)
2021-01-14 angle-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 50bcbaad4cbf to 5869a809d551 (4 revisions)
2021-01-14 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 451c64aaec04 to fabc0b0b129a (518 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 ethannicholas@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: ethannicholas@google.com
Test: Test: angle_perftests --gtest_filter=TracePerfTest.Run/*magic_tiles_3*Test: Test: scripts/roll_aosp.sh && m ANGLE
Change-Id: Iabeb174f583296c7f99a2d4d546b41a8aee4f047
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354358
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-15 04:56:32 +00:00
skia-autoroll
1895425ffc Roll Chromium from 2930e73f7b89 to e330bc98d133 (559 revisions)
2930e73f7b..e330bc98d1

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 ethannicholas@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: ethannicholas@google.com
Change-Id: I653f407cc97cbde82bb924d68981d2fb9f321d30
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354376
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-15 04:45:23 +00:00
skia-autoroll
819622a2d0 Roll Dawn from 6f833b7f78c9 to 5a6fda1a6fcc (6 revisions)
https://dawn.googlesource.com/dawn.git/+log/6f833b7f78c9..5a6fda1a6fcc

2021-01-14 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 0f4638b9e499 to 0a68b365ebff (4 revisions)
2021-01-14 bclayton@google.com Convert StorageTextureTests to WGSL
2021-01-14 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from a7b52e33d5e8 to 0f4638b9e499 (2 revisions)
2021-01-14 dsinclair@chromium.org Update texture storage syntax.
2021-01-14 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 904c5b9621da to a7b52e33d5e8 (3 revisions)
2021-01-14 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 313ae9e87f37 to 904c5b9621da (2 revisions)

Also rolling transitive DEPS:
  https://dawn.googlesource.com/tint from 313ae9e87f37 to 0a68b365ebff

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 dsinclair@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: dsinclair@google.com
Change-Id: I88ca7601de1e51c460f70d75a6eb187706e43499
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354357
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-15 04:45:22 +00:00
Chris Dalton
68b8bd5ba7 Add GrTriangulator::TriangulateInnerPolygons
Unlike TriangulateSimpleInnerPolygons, this new method *always*
succeeds. It works by introducing a concept of "breadcrumb" triangles.
The breadcrumb triangles serve as a glue that erases T-junctions
between the outer curves and inner polygon triangulation.

This CL also introduces a test to verify the breadcrumb triangles
actually guarantee to eliminate T-junctions. It works by cancelling
out shared edges in the combined breadcrumb triangles and inner
triangulation, and then verifying that the resulting edge list is
bit-for-bit identical to the outer edges from the original polygon(s).

Bug: skia:10419
Change-Id: Iea8ee2ca3701697246309dceb90e63279aabdfe4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353536
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-01-14 23:22:52 +00:00
Brian Osman
4cf85073e6 Enforce (valid) array sizes in many more places
Unsized arrays are now allowed in exactly one place: On the declaration
of an interface block. This satisfies the one existing use-case, which
is the gl_in (sk_in) declaration for geometry shaders. There is no other
useful scenario, and most of our backends don't support them anyway.

Several spots were using less strict checks when attaching sizes to
arrays, allowing for zero or negative-sized arrays, so those are all
fixed now.

The existing tests that initialize arrays are still a problem, because
Metal doesn't support that (neither does GLES2). Also, ArrayConstructors
has gone from generating an error in the Vulkan backend, to invalid
SPIR-V.

Bug: skia:11013
Bug: skia:11127
Change-Id: Ib08dfe9aeec96bf605661665d6f166419d27e8bc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353817
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-01-14 22:14:59 +00:00
Tyler Denniston
94730febf9 [svg] Handle std input case for filter subregion calculation
From the spec [1], if any inputs of a filter are one of the standard
inputs (SourceGraphic, FillPaint, etc. -- anything except another
filter), then the default filter primitive subregion is equal to the
filter effect region.

[1] https://www.w3.org/TR/SVG11/filters.html#FilterPrimitiveSubRegion

Bug: skia:10841
Change-Id: I70632e5119861c46c9e48af944d2c7cfdfc3c351
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354119
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-01-14 22:04:48 +00:00
Tyler Denniston
3df6c20a05 [svg] Fix <use> bounds calculation
Previously we were using fX and fY as the top left of the returned
bounds. We need instead to offset the referenced node's bounds by fX,
fY.

While I was here I updated the attribute parsing to the new form and
changed the type of fHref from SkSVGString to SkSVGIRI.

Change-Id: I4bfb91bca62e47f5dabfbb4aad48cbb301a7ea36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354118
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-01-14 21:35:58 +00:00
Mike Klein
a738fb5d58 restore select() in bool->int
Change-Id: Ia3ac338bef376aa1649569b9ebd3f7feb23ffd52
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353936
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-01-14 21:09:58 +00:00
Julia Lavrova
68afd4802b Fixed TextBehavior for one line
3 different cases cases: text, empty line inside text, empty paragraph

Bug: skia:11167
Change-Id: I139a3974511d0984dddd86b6fbf72be3983f8394
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353579
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2021-01-14 20:56:49 +00:00
Florin Malita
3c10618d37 [svg] Add clipPathUnits support
https://www.w3.org/TR/SVG11/masking.html#ClipPathElementClipPathUnitsAttribute

Bug: skia:10842
Change-Id: Idf3b5b6da08dfaee165f0bbb549427f298a40cec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353713
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2021-01-14 20:18:15 +00:00
Mike Klein
9c03ffbedc get rid of I32a/F32a
These were meant to make it easier to pass constants to skvm::Builder,
but I think they've caused more problems than they solve.

This change is pretty much just mechanical, expanding all the existing
combinations of F32/F32a into (more) combinations of F32/float, and same
for I32/I32a/int.  In general for an N-ary function we'll end up with
2^N-1 variants (1->1, 2->3, 3->7), requiring at least one I32/F32.

As before, some functions have fewer variants where using a constant
doesn't actually make sense (the condition for select, the denominator
for divide, etc).

Change-Id: Ic7bbd82e7f1452d604479cdde0b3b6a60ffe8b8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353839
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-01-14 19:53:25 +00:00
John Stiles
774f45bc07 Enforce strict type coercion between int and uint.
This better matches GLSL's type coercion behavior.

Change-Id: I73fcfd8a9e57fd4cdb1692074d73ebd8fb788ac2
Bug: skia:11164
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353712
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-01-14 19:38:55 +00:00
John Stiles
ff4f76352d Update int/float mismatch test to include uints.
Change-Id: I47d02ca63ce64d9cfb3de0888d84b2b8a822f2b5
Bug: skia:11164
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353710
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-14 19:38:30 +00:00
Florin Malita
4ea46b71ac [svg] Fix null text context crash
The input may contain invalid text constructs lacking a root <text> node
e.g.  <svg><tspan>foo</tspan></svg>

Since we don't perform content model validation at the moment and text
contexts are only instantiated for root nodes, we must guard against
this case at render time.

Bug: oss-fuzz:29558
Change-Id: I7e39c1c4048900ce5becb3549802dc66bb1d242b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353711
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2021-01-14 19:03:25 +00:00
John Stiles
4a2d651243 Enforce stricter type coercion rules in SkSL.
Literals are still flexible; we still allow `1` to coerce to float.
However, we no longer accept code like `int x = sqrt(2);` or
`int x = 0; float y = x;` without an explicit cast.

Change-Id: Ieb294a4877447e2336252f876e8bc489d1e4a59a
Bug: skia:11164
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353417
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-14 18:59:45 +00:00
Florin Malita
491911003e [svg] Mask support
https://www.w3.org/TR/SVG11/masking.html#Masking

Implement masking based on a classic two-layers + kSrcIn blending
approach.

An additional layer is used to filter the mask content (but could be
avoided in a pinch -- see inline comments).

Also consolidate the objectBoundingBox rect resolution logic as
SkSVGRenderContext::resolveOBBRect().

Bug: skia:10842
Change-Id: I273318e97cc28d599d1ecf01706b6117eecb62d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353631
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2021-01-14 18:50:46 +00:00
John Stiles
a60fb178b5 Add SPIR-V support for casts to boolean scalar.
Change-Id: Icd8982d604881effee31cc1392e2717cb112d06d
Bug: skia:11172
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353629
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-14 18:35:25 +00:00
Brian Osman
890b2b406a Disallow switch statements in runtime effects
Bug: skia:10680
Change-Id: Ic77f7355866363ef476a93d8da180cf53207fa6d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353707
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-01-14 17:45:16 +00:00
Brian Osman
01f322cce4 Move all runtime effect error tests to runtime_errors
Also renamed Discard to IllegalStatements, and added testing of while
and do loops.

Change-Id: Ibacf69131267a0436808e2e022ad126704af16ef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353706
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-01-14 17:40:54 +00:00
Mike Klein
aebcf73404 always init function fReturnValue
It's not sound to pass undefined (skvm::NA) values into select(),
but this is working today because the F32a argument is 'fixing' it.

The first time through this snippet updating fReturn value,

    int i = 0;
    for (skvm::Val& slot : currentFunction().fReturnValue) {
        slot = select(returnsHere, f32(val[i]), f32(slot)).id;
        i++;
    }

the call to f32(slot) creates an F32{builder, NA}.  We pass that to
select() and that argument's F32a(F32) constructor, resulting in
F32a{builder, NA, 0.0f}.  Then when we need that as an F32, we resolve
it as splat(0.0f) because the F32a's id field is NA.

In short, best to remove F32a. :)

Added some SkASSERTs that would have caught this.

Change-Id: I67324cf20ad39ca555e69b9c407f379d14046043
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353838
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-01-14 17:22:04 +00:00