Commit Graph

51606 Commits

Author SHA1 Message Date
skia-autoroll
938932225c Roll SwiftShader from 959f41988a18 to 31e28d20f878 (5 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/959f41988a18..31e28d20f878

2020-11-04 capn@google.com Switch Chromium/Fuchsia to use the LLVM ORCv2 JIT
2020-11-03 nicolascapens@google.com Clarify the ICD/loader compatibility
2020-11-03 swiftshader.regress@gmail.com Regres: Update test lists @ b5bf8269
2020-11-03 capn@google.com Set LLVM_ENABLE_ABI_BREAKING_CHECKS for Debug builds only
2020-11-03 jari.komppa@siru.fi Add script to verify proper Memset template use

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 bsalomon@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: bsalomon@google.com
Change-Id: Ic2b6b83a04351dec1a5de4447b93c44785002551
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331863
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-04 04:39:52 +00:00
Chris Dalton
0e54309477 Merge GrStrokePatchBuilder into GrStrokeTessellateOp
There's really no reason for these classes to be separate at this
point. Also extracts a "GrStrokeOp" base class that has the
functionality that will be shared with indirect stroking.

Bug: skia:10419
Change-Id: I960d5e6d64f0814ccb4a3852bc627af2b8082a1f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331860
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-11-03 23:39:42 +00:00
Greg Daniel
fbc60b7e9e Fix viewer last image and zoomer.
Change-Id: If4f614510b3d2a5802e87350b8f09797d9c52c96
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332036
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-03 23:00:22 +00:00
John Stiles
6e7cfaff18 Fix bad FP codegen when sample() calls are inlined.
Previously, temp variables created by sample() calls were named after
the offset of the sample() call within the code. This was
straightforward but would fail if the sample() call were duplicated via
inlining of helper functions.

FP sample() temp variables are now named using a counter, starting from
zero and counting upwards.

Change-Id: I16f9a3426117677c0df13d15772320def99cc0d6
Bug: skia:10858
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331415
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-03 19:54:45 +00:00
John Stiles
351b8d8ce2 Poison unallocated block memory in GrBlockAllocator.
This will allow ASAN to detect use-after-free errors in pooled memory,
enabling our fuzzers to catch errors sooner.

Testing with oss-fuzz:26942 : http://screen/C5TEbu3CJvHzRqA

Change-Id: Ic47d6b043998e5069525490cd25b2390cad94360
Bug: skia:10885
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331482
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-03 19:31:35 +00:00
Herb Derby
52991f8c81 move subrun instances and support to .cpp
Change-Id: I12b5110b378a53f0ae416ede5ff864af116a3166
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331457
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-11-03 19:18:45 +00:00
John Stiles
569249be6c Improve support for function prototypes in SkSL.
Previously, when a prototype was parsed, this added a function
declaration to the symbol table, but the prototype itself was not
re-emitted during code generation. This meant that the final code might
not be valid, since the absence of prototypes meant that the code might
attempt to invoke a function before its declaration. Now, prototypes are
stored in the ProgramElement list and re-emitted during code generation
for GLSL/Metal/CPP. (SPIR-V doesn't name its functions at all.)

Change-Id: I76446c796000eb0b56f964d82457122182c28b87
Bug: skia:10872
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331136
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-03 19:09:25 +00:00
Brian Salomon
49721c8437 Revert changes to unbreak bots.
f01a9d9020
is the culprit


Revert "GrRefCntedCallback has Make function."

This reverts commit b2c42140ea.

Revert "Add SkImage::MakeFromYUVATexturesCopyToExternal"

This reverts commit f01a9d9020.

Bug: skia:10632
Change-Id: Ief076f168b63ff8ca15b607163a13d5f52a733d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331798
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-11-03 18:52:45 +00:00
Herb Derby
bea4197f8b cull glyphs that have far out positions
If a glyph's position is > 32K or < -32K, then it is not
on the device. Don't bother adding it to the GrOp. This
reduces the glyph position from SkIPoint to
Vec<2, int16_t>.

But, if some of the glyphs are dropped, and the blob is
scrolled, then the glyphs may be in range. Add a flag
to track if glyphs were dropped, and force a redraw if
not exactly the same matrix is used to draw.

In addition,
* Rename VertexData to DevicePosition
* Add needed calls to GrGlyphRect

Change-Id: Ifdb8aa86d3da0b69d46c11fce5f33803781d880c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330622
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-11-03 18:46:47 +00:00
Brian Salomon
8b5d44b42a Revert "Reland "heif: Add AVIF type and AVIF sniffing""
This reverts commit 28eb592735.

Reason for revert: std::optional use is breaking bots, e.g.:
https://ci.chromium.org/raw/build/logs.chromium.org/skia/4fa8175011a1c411/+/annotations

Original change's description:
> Reland "heif: Add AVIF type and AVIF sniffing"
>
> This is a reland of 3ab5b73649
>
> Fix: Chromium does not use the heif decoder. So hide it behind
> an ifdef.
>
> Original change's description:
> > heif: Add AVIF type and AVIF sniffing
> >
> > AVIF is the image format based on the AV1 video codec. The
> > container for AVIF is very similar to that of HEIF. Add type
> > definitions for AVIF and sniffing code for detecting AVIF images.
> >
> > The underlying android platform's HEIF decoder implementation will
> > also support AVIF decoding.
> >
> > Bug: b/141654151
> > Change-Id: I7e31f4cedf0bffb8920ddf880a26601e48d0e833
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330059
> > Reviewed-by: Leon Scroggins <scroggo@google.com>
> > Reviewed-by: Derek Sollenberger <djsollen@google.com>
> > Reviewed-by: Chong Zhang <chz@google.com>
> > Commit-Queue: Leon Scroggins <scroggo@google.com>
>
> Bug: b/141654151
> Change-Id: Ie6840d6fc97789be619924fc60df8683cd58430f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331496
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Commit-Queue: Leon Scroggins <scroggo@google.com>

TBR=djsollen@google.com,scroggo@google.com,chz@google.com,vigneshv@google.com

Change-Id: I25df9f65b9d56d81be70a5fa650c3d841bd5a15e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/141654151
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331800
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-11-03 18:42:49 +00:00
Michael Ludwig
9597e2fbce Avoid redundant matrix inverse for DF text ops
Previously, if this was a DF-based text op and the shader had local coords, onPrepare() and setupDfProcessor() would both invert the same matrix.

Change-Id: I1cf989045791aabf9223728d485ce09ffb6412bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330939
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-11-03 18:10:22 +00:00
John Stiles
7d3f089e58 Fix use-after-free error discovered by the fuzzer.
When eliminating a CFG node, we now flag its exit nodes; if our
optimization pass reaches one of those flagged nodes, we stop the
current optimization process in its tracks and initiate a rescan.

We do NOT recursively mark the exits of the exit nodes, so this fix is
reliant on the CFG being ordered in a non-chaotic fashion, but in
practice this seems to be sufficient for the CFGs we generate today.

Change-Id: I892805361c5f4297e02146f37a759dfda83f5488
Bug: oss-fuzz:26942
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331597
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-03 17:59:02 +00:00
Vignesh Venkatasubramanian
28eb592735 Reland "heif: Add AVIF type and AVIF sniffing"
This is a reland of 3ab5b73649

Fix: Chromium does not use the heif decoder. So hide it behind
an ifdef.

Original change's description:
> heif: Add AVIF type and AVIF sniffing
>
> AVIF is the image format based on the AV1 video codec. The
> container for AVIF is very similar to that of HEIF. Add type
> definitions for AVIF and sniffing code for detecting AVIF images.
>
> The underlying android platform's HEIF decoder implementation will
> also support AVIF decoding.
>
> Bug: b/141654151
> Change-Id: I7e31f4cedf0bffb8920ddf880a26601e48d0e833
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330059
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Reviewed-by: Chong Zhang <chz@google.com>
> Commit-Queue: Leon Scroggins <scroggo@google.com>

Bug: b/141654151
Change-Id: Ie6840d6fc97789be619924fc60df8683cd58430f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331496
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2020-11-03 17:50:42 +00:00
skia-autoroll
3a04e209b5 Roll Dawn from 71d2e1d23d49 to 3bf9f4a2e65e (4 revisions)
https://dawn.googlesource.com/dawn.git/+log/71d2e1d23d49..3bf9f4a2e65e

2020-11-03 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from fc5a9cfaf70c to de6938789ccb (13 revisions)
2020-11-03 cwallez@chromium.org Add the -Wdeprecated-copy-dtor warning.
2020-11-03 cwallez@chromium.org Add the disallow_unsafe_apis toggle.
2020-11-03 cwallez@chromium.org ValidationTest: Make custom device creation go through a virtual method

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 cwallez@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: cwallez@google.com
Change-Id: I423afce6af135732540d7de002d716d3d8f5399d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331577
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-03 17:41:12 +00:00
Brian Osman
b047b5ddf4 Disable "any" function workaround in standalone/non-GPU caps
Change-Id: Ief57d9c102b3c7658738920cdf54ccd4d21c5c5e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331656
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>
2020-11-03 17:36:43 +00:00
John Stiles
e103f941fc Create test case for oss-fuzz:26942.
Change-Id: I19a9564ac4d52b709b8fdd757b99222372c626f4
Bug: oss-fuzz:26942
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331598
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>
2020-11-03 17:19:22 +00:00
Michael Ludwig
136d878002 Update GrAtlasTextOp::MaskType to enum class
Change-Id: I16a5938f5156fac2e93b8cd0b2a8e2ed45b46386
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330938
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-11-03 16:51:31 +00:00
Brian Salomon
b2c42140ea GrRefCntedCallback has Make function.
Each caller does not need to check for null function.

Also inherit from SkNVRefCnt.

Change-Id: I9a53c3c8e9dec1361db6cfb21b97d178173b23ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331490
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-11-03 16:49:12 +00:00
Michael Ludwig
290d6df49b Improve coverage AA for thin quads
This brings back the 2px wide picture frame approach described in these
slides: go/thin-line-aa. This has been in place when the per-edge-aa
only needed to support rectangles but was scrapped when the code path
was updated to support arbitrary quadrilaterals.

I opted to have the GrQuadPerEdgeAA logic check for degeneracy and
update what it requests for the outset. This scale factor out to a 2px
wide shape makes sense in the context of anti-aliasing, but not so for
the generalized inset/outset logic defined in GrQuadUtils. It would have
been more efficient to implement it there, but would have locked it in
to being just AA inset/outset.

I also updated SkGpuDevice's drawStrokedLine to construct the quad of
the line directly, and to always turn a line path into a rect, instead
of restricting it based on matrix or stroked width. With this new change
the quality of the fill rect is much higher under rotations and
perspective compared to the hairline.

See rect case: https://drive.google.com/file/d/1xwgG5heADcdXYShsDodgbuv2tbHfuBNt/view?usp=sharing
Hairline case: https://drive.google.com/file/d/1duNLxiYLLJhsJ94Uc01rSxjB4ar6_Ud9/view?usp=sharing

Bug: chromium:820987
Change-Id: Ibd58b89a467ad5a61c5479d11259024259f1bb47
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329418
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-11-03 16:08:11 +00:00
Greg Daniel
5943feea46 Add support for wrapped GrAttachments.
Bug: skia:10828
Change-Id: Ifab9c2b179fa981a94d03ff96718c3b31f745fee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331338
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-11-03 15:53:11 +00:00
Robert Phillips
7ffdb695dc Minor cleanup of GrTriangulatingPathRenderer
Change-Id: Iee207b861aa1a5d4036e99305b9460fd31d5129d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331537
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-11-03 15:44:11 +00:00
Tyler Denniston
dada960d79 [svg] Add feTurbulence filter (incomplete)
This was the simplest one to start with. I need to add support for the
"filter effect subregion" in order to handle tile stitching property,
so this isn't quite complete. But I believe this is enough for the
basic filters-turb-01-f test to pass, which gives us a baseline for
further filter work.

Summary of changes:
- Added attribute type and parsing for SVG integer datatype
- Added new node class for feTurbulence
- Added several new properties and parsing for feTurbulence

Bug: skia:10841
Change-Id: I8c877a5e1a837bfd527782253062eeb58febdde6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330621
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-11-03 15:41:41 +00:00
Brian Salomon
f01a9d9020 Add SkImage::MakeFromYUVATexturesCopyToExternal
Updated API for creating a RGBA texture-backed image from RGBA texture
planes with user-provided backing store using GrYUVABackendTextures.

Ultimately we would like to remove all such APIs and have the client
make a SkSurface and draw a YUVA texture image to the surface but
a recent attempt to do that in Chrome caused a not yet understood
perf regression.

Add wacky_yuv_formats variation that tests new api.

Bug: skia:10632
Change-Id: I89411216948682f13281a91a7575d5f345badda7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329956
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-11-03 15:03:21 +00:00
Robert Phillips
eb999bce4f Fix GrThreadSafeCache's abandonContext behavior
We need to abandon all the GPU resources before dropping any
refs the thread-safe cache may be holding.

Change-Id: Id1a06adf9e0241bfaf55e3f58bf8c2db928ea141
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331536
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-11-03 14:42:21 +00:00
skia-autoroll
a77ad86574 Roll Chromium from 47ad8b8f4008 to c3b9f2527bea (386 revisions)
47ad8b8f40..c3b9f2527b

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 bsalomon@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: bsalomon@google.com
Change-Id: I8b71cd718847ae1bcf5b7e383966223b29bac799
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331503
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-03 04:47:21 +00:00
skia-autoroll
47895d9951 Roll SwiftShader from e0de282e678b to 959f41988a18 (7 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/e0de282e678b..959f41988a18

2020-11-02 capn@google.com Set the LLVM module's target triple
2020-11-02 sugoi@google.com Merge changes If776b87d,I27098964
2020-11-02 capn@google.com Consistently remove double colon from llvm namespace
2020-11-02 capn@google.com Emulate gather/scatter for MSan builds
2020-11-02 capn@google.com Prevent 'most vexing parse' issue
2020-11-02 amaiorano@google.com Subzero: fix Ice::BitVector::grow not copying old to new data
2020-11-02 jari.komppa@siru.fi Ignore third party libraries during presubmit

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 bsalomon@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: bsalomon@google.com
Change-Id: Idfd84ef295f537224225e26d67ba647438dd9b3b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331500
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-03 04:41:21 +00:00
skia-autoroll
e26606f95b Roll Dawn from 0a374dce6653 to 71d2e1d23d49 (4 revisions)
https://dawn.googlesource.com/dawn.git/+log/0a374dce6653..71d2e1d23d49

2020-11-02 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 74023424daa4 to fc5a9cfaf70c (1 revision)
2020-11-02 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 5bee67fced90 to 74023424daa4 (1 revision)
2020-11-02 cwallez@chromium.org Suppress -Wdeprecated-copy-dtor for Skia.
2020-11-02 bclayton@google.com Migrate tint to use new parser constructor

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 cwallez@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: cwallez@google.com
Change-Id: I56aa12a17646c1638022a9db86ec39532972dd33
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331502
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-03 04:35:51 +00:00
Chris Dalton
5f3f8a08b7 Qiet ASAN warnings about ieee float division
TBR=michaelludwig@google.com
Change-Id: I4f950060ea75203531f081f3b62e805cadc0adf5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331484
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-11-03 01:04:34 +00:00
Chris Dalton
6bacd9ff2f Fix the grvx_approx_angle_between_vectors test
This method is only valid in the range 2^(+/-30) due to fp32 overflow.
Adds a comment to the function and updates its test.

TBR=bsalomon@google.com
Change-Id: Ifa2fc0ed4a7f9123f0bebaa02c666c61e06e62a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331481
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-11-03 00:27:54 +00:00
Tyler Denniston
b5e29be9c4 [svg] New layer for image filter if one is set
Prior to rendering a node, check the filter presentation attribute and
create a new canvas layer with a corresponding SkImageFilter set.

Also added the computation of the filter effect region and added a naive
(and incomplete) construction of the image filter DAG for a
<filter> element.

Bug: skia:10841
Change-Id: Ie94299757e059c39540ad316cddf438df5726d97
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330619
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-11-02 21:54:25 +00:00
Chris Dalton
2882e70ef3 Add GrPathUtils::findCubicConvex180Chops
This method finds the locations a cubic needs to be chopped at before
it can be passed to the stroke tessellation shader. It's an integral
part of CPU stroke preparation and therefore extremely perf sensitive.

Bug: skia:10419
Change-Id: Ib23c2583b8cfc78814ce52425f7af2c8b2f8b420
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330314
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2020-11-02 20:33:54 +00:00
Herb Derby
7e581790bf update build for Apple Silicon
You can use this to cross complie from an x86_64 mac if you have
at least XCode12 beta 2 installed, and you set target_cpu = "arm64"
in your gn args.

Change-Id: I3fcdcd162155ac0242c15260994de09177ff2f97
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328659
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-11-02 20:06:09 +00:00
Chris Dalton
4195bcc25a Use uint4 instead if int4 in grvx test
Change-Id: Ic0a4c433d1d78592613b8a2fc10098ea74ee250e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331368
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-11-02 20:04:24 +00:00
Brian Osman
e3afdd5b75 Avoid infinite inverse inner-radii in eliiptical rrect op
Bug: chromium:1139750, skia:8389
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel,win10-blink-rel
Change-Id: I69c55f505947fdec5d9d391d2b2d2d3ff6dec9b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330216
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-11-02 20:01:04 +00:00
Ben Wagner
c22288fbdb Declare FontConfig not threadsafe.
Some time ago FontConfig stopped being thread antagonistic and
documented that it was thread safe (or at least any thread un-safety was
a bug). However, until
447b9ccc7d
at least one of the basic atomic primitives was implemented incorrectly.

Resume using a mutex to serialize access to FontConfig until 2.13.93.

Bug: cl/339089311
Change-Id: I632f03bc575a37b5391390a0868aef256e3aacda
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331339
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-11-02 19:58:14 +00:00
Chris Dalton
753c1b3368 Add helpers to GrPathUtils for converting lines and quads to cubics
Bug: skia:10419
Change-Id: I4a747e1a628e636c6e20dddb1a25541500c88683
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330122
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-11-02 19:36:14 +00:00
Robert Phillips
f9a1b8208e Fill in the GrTriangulatingPathRenderer::onPrePrepareDraws
This will allow multiple DDL recording threads to share triangulated
path data.

Bug: 1108408
Change-Id: Idf204c1bb3dd03d3e1d5419c320e527bf348e38b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325576
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-11-02 19:27:14 +00:00
John Stiles
1ea7f5403b Replace ProgramElement dehydrated count with an elements-done command.
This has two advantages:
- sksl_gpu was on the verge of overflowing 255 program elements anyway
- this makes it easier to skip ProgramElements when generating the
  dehydrated data; in particular, we don't have any need to dehydrate
  function prototypes, but if we just skip them, the count would be
  wrong

Change-Id: Idbcdec53518e9e6f42473a73a53dae408ce7c980
Bug: skia:10872
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331282
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>
2020-11-02 18:56:24 +00:00
Chris Dalton
c3cb099556 Add GrVx.h
Adds grvx, Ganesh's addendum to skvx. Here we introduce familiar names
and operations from GPU languages, as well as functions that are
approximate and/or have LSB differences from platform to platform.

The initial implementation has: fast_fma, fast_acos, and
fast_angle_between_vectors. When a function is approximate, its error
range is well documented and tested.

Also establishes GrWangsFormula as the first user of grvx.

Bug: skia:10419
Change-Id: Id0682599cf9c0303eff386095afc3ef9f3a7fa1b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330119
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-11-02 18:33:54 +00:00
John Stiles
bfad3e2a4a Add test cases to function-prototype golden outputs.
- Prototypes for never-declared functions
- Prototype before use
- Prototype after use
- A variety of inputs and outputs on the prototyped functions.
- Calling declared-but-undefined functions

Currently, the prototypes are not actually emitted in the generated GLSL
or Metal output at all. This CL is demonstrates our baseline before
proper prototype support is added.

Change-Id: I6112e0a89ab9bbecefccaca9fba985bb8011fff1
Bug: skia:10872
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331376
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-02 17:17:23 +00:00
Kevin Lubick
dffd20efe9 [canvaskit] Add unit tests to wasm_gm_tests
There are currently many tests skipped, but many more pass.
This changes the built binary to have a lot of debugging logic
in it so we should be able to get backtraces on those crashes
more easily when debugging.

gmtests.html was removed as it was superceded by run-wasm-gm-tests
and make run_local.

Bug: skia:10812, skia:10869
Change-Id: I72ab34d3db83a654dc8829831b3ecb795fe23d43
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329170
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2020-11-02 16:51:23 +00:00
Chris Dalton
4dd3c8cbef Fix Wang's formula for cubics
We finally have a reference and derivation of Wang's formula, thanks to
tdenniston@. And it turns out that the formula we had been using for
cubics wasn't quite right. It was overly conservative for certain types
of curves.

This CL fixes the incorrect cubic formulas and adds a citation to the
"Pyramid Algorithms" book. We should now be getting by with fewer linear
segments.

Bug: skia:10419
Change-Id: Ib850c7b4d17b8d9f9abed800cc7cb5f074df6e17
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331156
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-11-02 16:36:43 +00:00
John Stiles
ebb26e30f2 Revert "heif: Add AVIF type and AVIF sniffing"
This reverts commit 3ab5b73649.

Reason for revert: <optional> header is C++17 only

Original change's description:
> heif: Add AVIF type and AVIF sniffing
>
> AVIF is the image format based on the AV1 video codec. The
> container for AVIF is very similar to that of HEIF. Add type
> definitions for AVIF and sniffing code for detecting AVIF images.
>
> The underlying android platform's HEIF decoder implementation will
> also support AVIF decoding.
>
> Bug: b/141654151
> Change-Id: I7e31f4cedf0bffb8920ddf880a26601e48d0e833
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330059
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Reviewed-by: Chong Zhang <chz@google.com>
> Commit-Queue: Leon Scroggins <scroggo@google.com>

TBR=djsollen@google.com,scroggo@google.com,chz@google.com,vigneshv@google.com

Change-Id: I9c9cd00af1a41bffa37725f39afc9bc0e504d616
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/141654151
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331336
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-11-02 16:08:03 +00:00
Vignesh Venkatasubramanian
3ab5b73649 heif: Add AVIF type and AVIF sniffing
AVIF is the image format based on the AV1 video codec. The
container for AVIF is very similar to that of HEIF. Add type
definitions for AVIF and sniffing code for detecting AVIF images.

The underlying android platform's HEIF decoder implementation will
also support AVIF decoding.

Bug: b/141654151
Change-Id: I7e31f4cedf0bffb8920ddf880a26601e48d0e833
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330059
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Chong Zhang <chz@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2020-11-02 15:28:21 +00:00
John Stiles
47ee0caa10 Split Texture test into separate 1D and 2D tests.
This improves the test output for Metal. Previously, the Metal output
was just an error message, since 1D textures were unsupported. Now we
have a valid golden output for the 2D case in Metal. (1D is still
unsupported and is likely to remain unsupported; Skia currently has no
use case for 1D textures.)

Change-Id: I91977712030f08e371cc6bfb2afa578940ca00b7
Bug: skia:10797
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330940
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-02 14:39:31 +00:00
Robert Phillips
67e58cb909 Add callback to thread-safe cache to resolve vertexData collisions
The triangulating path renderer can generate multiple triangulations of
the same path at different levels of precision. As previously
implemented the more precise triangulations would steal the unique
key from prior triangulations. This new callback will allow us to
replicate this behavior in the thread-safe cache.

Bug: 1108408
Change-Id: I8b445ca1e503b2fd78727a23d9376a2cf77f291c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330562
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-11-02 14:30:21 +00:00
Eric Boren
98b928fcfa Update Go Deps
Change-Id: Id97669b7916a6909a39dda79ecb9671f7fe1caf0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330818
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
2020-11-02 12:13:02 +00:00
skia-autoroll
ff8f192b49 Roll ANGLE from 39b777c6f00f to 068bb086e1c8 (20 revisions)
39b777c6f0..068bb086e1

2020-11-01 jmadill@chromium.org RapidJSON: Enable std::string handling.
2020-11-01 jmadill@chromium.org Vulkan: Fix EGL Surface robust init.
2020-11-01 lehoangq@gmail.com Metal: Suppress UniformBufferTest.ManyBlocks on Intel
2020-11-01 syoussefi@chromium.org Vulkan: Update scissor only in DRAW framebuffer's syncState
2020-10-31 lehoangq@gmail.com Metal: Convert index & vertex format on GPU when possible.
2020-10-31 lehoangq@gmail.com Metal: default integer attribs & offset mod for idx conv.
2020-10-31 lehoangq@gmail.com Metal: Implement texture swizzle
2020-10-31 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-Loader from 428654245ad3 to 07bbf14a831b (2 revisions)
2020-10-31 syoussefi@chromium.org Vulkan: Support emulated pre-rotation in dEQP testing
2020-10-30 jmadill@chromium.org Output unknown enum to aid debugging
2020-10-30 syoussefi@chromium.org Vulkan: Optimize glFramebufferSubInvalidate
2020-10-30 lehoangq@gmail.com Metal: prepare to run dEQP GLES3 tests
2020-10-30 geofflang@google.com Revert "Add a Vulkan feature to compress float32 vertex formats."
2020-10-30 jmadill@chromium.org Add option to disable SwiftShader when retracing.
2020-10-30 jmadill@chromium.org Write export labels into replay functions.
2020-10-30 jmadill@chromium.org Omit types in EVENT macros.
2020-10-30 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Vulkan-ValidationLayers from a72e7b987746 to f673b4e6ebf3 (1 revision)
2020-10-30 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from c1839ee3cedd to e6c9497255c6 (4 revisions)
2020-10-30 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 80c364fa8e53 to 1e88b939ff30 (901 revisions)
2020-10-30 syoussefi@chromium.org Add a perf test for scissored draw calls

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 bsalomon@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: bsalomon@google.com
Change-Id: I98c2df9703048ac1d1871be7998b6ac62cb91858
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331243
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-02 04:54:29 +00:00
skia-autoroll
dfd46cf06f Roll Chromium from 2357c7350401 to 47ad8b8f4008 (539 revisions)
2357c73504..47ad8b8f40

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 bsalomon@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: bsalomon@google.com
Change-Id: Ic3f94d6d9ad145a686ba04a5af88f1a65c9c778a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331259
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-02 04:47:09 +00:00
skia-autoroll
109282a752 Roll SwiftShader from e6c9497255c6 to e0de282e678b (2 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/e6c9497255c6..e0de282e678b

2020-10-30 sugoi@google.com Merge changes Idde36437,Id477959d,I68027fa8,I8e6cf710
2020-10-30 jari.komppa@siru.fi Add check for vtable in memset template

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 bsalomon@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: bsalomon@google.com
Change-Id: Idcc4cf72dd1dea39a19a9546d37af30598130ce1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331242
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-11-02 04:44:29 +00:00