Commit Graph

52411 Commits

Author SHA1 Message Date
John Stiles
d06d4a983f Fix matrixCompMult halfNxM implementation and add unit tests.
The existing code didn't work properly with half types since the $mat
type encompassed both halfNxM and floatNxM. This was fixed by splitting
the half types out of $mat into a separate $matH generic.

Unit tests now compile properly for GLSL, but generate errors in SPIR-V
and generate Metal code which attempts to call a non-existent intrinsic.

Change-Id: I2fff10f0dd7f00534bf6b1d5b13354543694194e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342926
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-10 20:51:59 +00:00
Brian Salomon
fb018a8d80 Add SurfaceContextReadPixels to excluded wasm tests
Cq-Include-Trybots: luci.skia.skia.primary:Test-Ubuntu18-EMCC-Golo-GPU-QuadroP400-wasm-Release-All-WasmGMTests_WebGL2

Bug: skia:10869
Change-Id: Ib924218aeb4d6dc2e383b86135123efe6eb5639a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343096
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>
2020-12-10 20:20:09 +00:00
Jason Simmons
6d14f3841d Reland "Cache text blobs computed by TextLine::paintText"
Change-Id: If166d7a2b287774054f833ac0f7b564bbcac9fa8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342936
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2020-12-10 19:03:19 +00:00
Chris Dalton
7b80726d0e Implement indirect stroking for conics
Just like for fills, we use the normal Wang's formula on the conic's
down-projected control points until we can formalize on a better
formula.

Bug: skia:10419
Change-Id: Ifd735534a2e793f79f4f5d5b7e7acf50db81fe5e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341156
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2020-12-10 19:02:39 +00:00
Brian Salomon
eebe735dea GrRenderTargetContext->GrSurfaceDrawContext
Just the class/files. variable names and additional comments to follow.

Change-Id: Ic03d07fd5009eaf3d706c2536486a117328963fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342617
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-12-10 18:51:19 +00:00
Ravi Mistry
2c98edf07f Spelling and capitalization fixes from GitHub PRs
Inspired by
* https://github.com/google/skia/pull/18
* https://github.com/google/skia/pull/22

Change-Id: I4c092978f928ff2f589b6440d1fcdd846fa2b56f
Docs-Preview: https://skia.org/?cl=342925
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342925
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2020-12-10 18:40:09 +00:00
Michael Ludwig
31dd1f8de8 Remove SkDrawIter entirely
SkDrawIter goes away, as well as the DRAW_BEGIN, DRAW_END, and
FOR_EACH_TOP_DEVICE macros. A new macro TOP_DEVICE is added that
simplifies checking for a null device (which is currently only possible
if SkCanvas::init() was called with null). The intent is that this will
be replaced with just "this->getTopDevice()->" in the future.

The rest of the auto-layer magic that happened in DRAW_BEGIN is now
explicitly written out in the draw functions. Additionally, it has
been updated to check for an image filter. When there's no image
filter, it completely bypasses the construction of the AutoLayer object.

This extra check maybe isn't worth the code complexity, but some draw
methods had previously followed this pattern, so presumably stack
allocating the AutoLayer had some overhead in tight draw loops.

Bug: skia:10986, skia:10987
Change-Id: I9c48fe4645a6d2b46e1d0006a669fd073c0e1478
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341161
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-12-10 18:33:39 +00:00
Ethan Nicholas
52e5850065 Revert "Reland "Revert "Initial land of SkSL DSL."""
This reverts commit 53f69f1539.

Change-Id: I374b016c8a08d83c99cbab800f30b882244b87f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342919
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-12-10 18:02:38 +00:00
Tyler Denniston
573923c30c Add specialized impl of Wang's formula for cubic rationals
Initial data suggests that the non-rational Wang's formula does not
form an upper bound for the rational case, so additional work is needed
to handle them. Note this new formula is not actually due to Wang,
but is an analogue.

The version added in this CL is for cubic rationals because the current
tessellation code promotes all curve segments to cubic rationals for
ease. If we end up using this approach, it would be likely simpler and
faster to implement the degree-2 version and handle conics separately
during tessellation.

From:
J. Zheng, T. Sederberg. "Estimating Tessellation Parameter Intervals for
Rational Curves and Surfaces." ACM Transactions on Graphics 19(1). 2000.

Bug: skia:10419
Change-Id: Ie02e229c089541ece05c7502217b1ef5d4799b52
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337720
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2020-12-10 17:26:08 +00:00
John Stiles
ece00fbfa5 Remove ftransform intrinsic from SkSL.
This intrinsic multiplies the vertex against the fixed-function
gl_ModelViewProjectionMatrix matrix, which is not a thing in Skia.

Change-Id: Ie361d9d631762b1397ee7be062bda317b415c7c9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342923
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-12-10 17:23:38 +00:00
Chris Dalton
55abaf5893 Add a stencil test for transparent tessellated strokes
Initially we restricted tessellated stroking to opaque solid colors.
This CL adds support for transparency by enabling a stencil test. The
stencil test also allows us to use mixed samples.

Bug: skia:10419
Change-Id: Ie40f3099d2b009f92ed49f7f43e5f269b1a479af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340798
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-12-10 17:12:38 +00:00
Florin Malita
8655eab56c [skottie] Add text colorization GM
Expand existing SkottieColorizeGM to also handle text properties and
add text-focused instance.

Update layer names in one of the json assets to match expected demo
prefix ($).

TBR=
Change-Id: I076229067523fe597be66c611a8653897f995bc8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342916
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2020-12-10 17:10:48 +00:00
Jorge Betancourt
411ee15c2d clean playback methods and constructors in SkottieView
playback methods would call on mAnimation before checking if it was null
builder constructor created unneeded confusion, as setSource() currently acts a build method

Change-Id: I90a36e39cab1ed76a12c49fb53b4518bba9bf4ef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340521
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2020-12-10 16:29:38 +00:00
Leon Scroggins
23cbb99c8e Fix blending bug in animated webp decodes
Bug: webp:490

Depending on the encoded image, SkWebpCodec may need to blend the
the output from libwebp with the prior frame. It does so using the
method blend_line, which expects the libwebp output to be unpremul.

Prior to this commit, SkWebpCodec sometimes told libwebp to premultiply,
and then passed that premultiplied data to blend_line, which
premultiplied again.

Use webpInfo's alphaType to decide whether to premultiply. Consolidate
choosing its alphaType into one block. The functional difference is that
if (blendWithPrevFrame), we no longer premul if the dst is kPremul.

Move declaration of webDst to where it's used.

Add a test.

Change-Id: Ic0cfb4d918c2ab434c6787ed5a532c4d1e67fa17
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342618
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
2020-12-10 16:24:08 +00:00
John Stiles
f64e4075f2 Add support for float/int bitcast intrinsics in Metal.
Change-Id: I7af94d89d349b67b2c070179324fcad7b62e0d1e
Bug: skia:11071
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342758
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-12-10 16:13:38 +00:00
John Stiles
cc9ff0074e Add support for float/int bitcast intrinsics in SPIR-V.
Change-Id: I1d5a056e08ba6e67016e45c52518da6074a62c8f
Bug: skia:11071
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342759
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-12-10 15:42:18 +00:00
John Stiles
2aa76823b5 Fix floatBitsToInt family of intrinsics and add tests.
floatBitsToUint was missing from our intrinsic list entirely, and
u?intBitsToFloat were misspelled.

These intrinsics aren't implemented in SPIR-V or Metal either, but that
will be handled in followup CLs.

Change-Id: Iaf9b9d5a2e46e25d41eef71903fad8bd1c177d4e
Bug: skia:11071
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342757
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-10 15:33:48 +00:00
Jim Van Verth
2597adae85 Revise creation of blitCommandEncoder for speculative fix
Flutter is seeing an issue where we're trying to create a
blitCommandEncoder but we're still in the process of encoding. This
doesn't seem to happen with renderCommandEncoders so trying to mirror
what we do there.

Change-Id: I281509116a5666ebd67c19e4d8a21a83076861e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342621
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-12-10 15:23:28 +00:00
Brian Salomon
1fa76dd8fc Add read pixels test for GrSurfaceContext
Remove more limited tests that exercise the same code.

Reduce the number of test cases to improve run time.

Bug: skia:11019
Change-Id: I68b5b18ebf077e825a260285223b4a31243dcb4d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341456
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-12-10 15:07:38 +00:00
Jorge Betancourt
53f69f1539 Reland "Revert "Initial land of SkSL DSL.""
This reverts commit a3b8ac76e5.

Reason for revert: Need to revert again, red tree.

Original change's description:
> Revert "Revert "Initial land of SkSL DSL.""
>
> This reverts commit dd213e9d46.
>
> Change-Id: I43be020dd1b07dc13862150a9d95493f8c48b3b1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342622
> Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

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

# Not skipping CQ checks because this is a reland.

No-Presubmit: true
No-Try: true
Change-Id: I8e967ef8ecb7f01dc578d38264e2600b04e9b62d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342917
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-12-10 15:02:30 +00:00
John Stiles
01957273e7 Add SPIR-V support for modf intrinsic.
Change-Id: I887e700a7bf11bf2d5359c9721798f72f00e53f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342756
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-10 14:21:18 +00:00
Ethan Nicholas
a3b8ac76e5 Revert "Revert "Initial land of SkSL DSL.""
This reverts commit dd213e9d46.

Change-Id: I43be020dd1b07dc13862150a9d95493f8c48b3b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342622
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-12-10 14:17:38 +00:00
Mike Reed
410681932a Use explicit sampling param
Change-Id: Ifcb074365da8113fd5e0186d4afcf41041862e82
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342761
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-10 14:01:58 +00:00
Mike Reed
ddc27d806b Remove cons_moveTo() complexity
... now that we know we can rely on reliable verb sequencing.

Follow-on to https://skia-review.googlesource.com/c/skia/+/342616

Change-Id: If32186ba8a8690812cc1fe03ea71ae29eba4765b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342760
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-10 14:01:28 +00:00
Mike Klein
2e9a03ec11 Revert "Cache text blobs computed by TextLine::paintText"
This reverts commit ff7bfea4ab.

Reason for revert: several broken bots, e.g.

../SRC/skia/modules/skparagraph/src/TextLine.cpp:309:21: error: non-const lvalue reference to type 'skia::textlayout::TextLine::TextBlobRecord' cannot bind to a temporary of type 'void'
    TextBlobRecord& record = fTextBlobCache.emplace_back();
                    ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Original change's description:
> Cache text blobs computed by TextLine::paintText
>
> Change-Id: I7d4414fb64b14a714623e4c20199cab06e6ed18c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342297
> Commit-Queue: Jason Simmons <jsimmons@google.com>
> Reviewed-by: Julia Lavrova <jlavrova@google.com>

TBR=jsimmons@google.com,jlavrova@google.com

Change-Id: I467c61eead7b0d8c190cb2f883b05537de97a08e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342856
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-12-10 13:28:09 +00:00
skia-autoroll
22f80a60b1 Roll ANGLE from 27e52ca05dc7 to 067a12f05951 (10 revisions)
27e52ca05d..067a12f059

2020-12-09 cclao@google.com Reland "Vulkan: Use specialization constant for halfRenderAreaWidth"
2020-12-09 cclao@google.com Vulkan: Add dirty bits instead of direct access FBO state
2020-12-09 syoussefi@chromium.org Suppress test requiring VK_EXT_transform_feedback on Nvidia/win7
2020-12-09 courtneygo@google.com Add VK-GL-CTS autoroller link to wrangler doc
2020-12-09 syoussefi@chromium.org Fix varying packing of I/O block fields
2020-12-09 xinghua.cao@intel.com D3D: throw a perf warning for uniform block
2020-12-09 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from a3984b7ec4ae to 3fc522ff6579 (498 revisions)
2020-12-09 syoussefi@chromium.org Don't output matrix qualifiers in I/O blocks
2020-12-09 syoussefi@chromium.org Vulkan: Fix query pause on framebuffer binding change
2020-12-09 jiawei.shao@intel.com Enable ComputeShaderTest/DrawDispatchDispatchDraw on Intel/Win/Vulkan

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 jmbetancourt@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: jmbetancourt@google.com
Change-Id: I1c230955ddd16fdd56976012553d32f14069fbc8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342748
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-12-10 04:58:18 +00:00
skia-autoroll
d968480232 Roll SwiftShader from 84b9bb6621c7 to d94a77b304f4 (9 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/84b9bb6621c7..d94a77b304f4

2020-12-10 natsu@google.com Set prefersDedicatedAllocation for AHB
2020-12-09 natsu@google.com Treat AHB YUV as external format
2020-12-09 natsu@google.com Handle AHARDWAREBUFFER_FORMAT_YV12
2020-12-09 srisser@google.com Update SPIR-V version to VK_1_1_SPV_1_4
2020-12-09 natsu@google.com Handle VkExternalFormatANDROID in VkCreateImage
2020-12-09 srisser@google.com Add decorate operations new to SPIR-V 1.4
2020-12-09 natsu@google.com Handle more image properties from external device memory
2020-12-09 natsu@google.com Update AHB default YUV dataspace to YCBCR_709
2020-12-09 sugoi@google.com Make Constants a singleton instead of a global

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 jmbetancourt@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: jmbetancourt@google.com
Change-Id: I5a0c75d2dd00610dbdf322b68c4c857d0ab0e640
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342749
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-12-10 04:51:38 +00:00
skia-autoroll
af11a00f78 Roll Dawn from 30805557e651 to 29fd62989338 (3 revisions)
https://dawn.googlesource.com/dawn.git/+log/30805557e651..29fd62989338

2020-12-09 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 195917c0be32 to 7a0daa233d8a (8 revisions)
2020-12-09 cwallez@chromium.org Introduce SubresourceStorage (1/N)
2020-12-09 cwallez@chromium.org CMake: set DAWN_ENABLE_WGSL to ON by default.

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 rharrison@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: rharrison@google.com
Change-Id: If2e0b3799dbfec5e172345bf0e569bf08356fbbf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342747
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-12-10 04:43:38 +00:00
Jason Simmons
ff7bfea4ab Cache text blobs computed by TextLine::paintText
Change-Id: I7d4414fb64b14a714623e4c20199cab06e6ed18c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342297
Commit-Queue: Jason Simmons <jsimmons@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2020-12-10 01:11:37 +00:00
Chris Dalton
c2a1746b42 Implement stroke tessellation with indirect draws
Adds a vertex shader that maps a variable-length triangle strip to a
stroke and its preceding join. Adds a new op that generates stroke
instances from a path, bins them by log2 triangle strip length (using
SIMD for the calculations), and renders them with indirect draws.

Bug: skia:10419
Change-Id: I6d52df02cffe97d14827c6d66136957f1859f53b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339716
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-12-10 00:25:17 +00:00
Mike Reed
41a98e0a50 Assert that SkPath is always internally consistent
Follow-on to https://skia-review.googlesource.com/c/skia/+/342616

Assuming this survives, we can probably simplify other code in SkPath
(e.g. Iterators) that today worry about consing up moves after close.

Change-Id: I913d6be9c20547267230c287d394fd300b985d31
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342619
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-12-09 23:56:17 +00:00
John Stiles
3679cd1151 Add support for isinf/isnan intrinsics to SPIR-V.
Change-Id: I674d758c11071582e9fbedcda5596c540bfb5f71
Bug: skia:11054
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342558
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-12-09 22:11:27 +00:00
John Stiles
5f675be193 Add tests for SkSL intrinsic functions.
This does not give us 100% coverage of intrinsics yet, but it is a
pretty good start.

Change-Id: I97d49324db1afd9f2975c2eeafbacdead710d4aa
Bug: skia:11054
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341977
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2020-12-09 22:02:17 +00:00
Jim Van Verth
201bcee38a Use full precision for QuadEdge attributes on iOS.
We're passing in QuadEdge attributes as half precision, but
kStableLargeNegativeValue is well past any value that can be handled
by half float. Increasing the precision used fixes the issues we're
seeing on iOS 14.

Bug: skia:10594
Change-Id: I650a0930cf8dd9a2369bfeeffc132c0f7f0fa79e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342303
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-12-09 21:40:47 +00:00
Tyler Denniston
04e03bc181 [svg] Convert stop-color and stop-opacity to presentation attrs
These are somewhat the first presentation attributes of their kind,
in that they are non-inherited but also not applied via canvas layers.

Implementation-wise the main difference is that these attributes are
not propagated through the fInherited field of the render context's
presentation attribute list.

Change-Id: I0909507b0ecbd21732b3f80c46a343f5a0a9bf7a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340661
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-12-09 21:37:17 +00:00
Tyler Denniston
7416571f4e [svg] Split out SkSVGColor from paint
This color type will be shared in paint, stop-color, and flood-color
attributes (mainly so they can use 'currentColor').

Change-Id: Ib4200ea729a91a0db5da069c68d64e5e8e3f5010
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340617
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-12-09 21:28:07 +00:00
John Stiles
06b84efcb3 Improve Metal support for out parameters.
We now insert helper functions which defer the assignment of out-
parameters back into their original variables to the end of the
function call. This allows us to match the semantics listed the GLSL
spec in section 6.1.1:

"All arguments are evaluated at call time, exactly once, in order, from
left to right. [...] Evaluation of an out parameter results in an
l-value that is used to copy out a value when the function returns.
Evaluation of an inout parameter results in both a value and an l-value;
the value is copied to the formal parameter at call time and the lvalue
is used to copy out a value when the function returns."

This technique also allows us to support swizzled out-parameters in
Metal, by reading the swizzle into a temp variable, calling the original
function, and then re-assigning the result back into the original
swizzle expression.

At present, we don't deduplicate these helper functions, so in theory
there could be a fair amount of redundant code generated if a function
with out parameters is called many times in a row. The cost of properly
deduplicating them is probably larger than the benefit in the 99% case.

Change-Id: Iefc922ac9e2b24ef2ff1e9dacb17a735a75ec8ea
Bug: skia:10855, skia:11052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341162
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-09 21:13:57 +00:00
Nathaniel Nifong
5ef2267a88 Reland "Always attempt to flatten images with mskp image ids"
This is a reland of eca04eeeb8

Problem was that any error during image flattening left the json encoder
in an invalid state. this closes the object before all early returns.

Original change's description:
> Always attempt to flatten images with mskp image ids
>
> b:skia:11041
>
> Change-Id: I9eeac07b5cad7809d1e8ec9f9b12149f016227e0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341798
> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
> Commit-Queue: Nathaniel Nifong <nifong@google.com>

Change-Id: I622dbaa3ce5db85c9f790f822d51be247af528bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342463
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-12-09 21:03:17 +00:00
Mike Klein
3e1b3550af use SkVM_fwd.h in SkColorFilterBase.h
Change-Id: Id2135834062fed316d53e1419389a664e8d39c64
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342677
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-12-09 20:50:17 +00:00
Ethan Nicholas
dd213e9d46 Revert "Initial land of SkSL DSL."
This reverts commit 6e599511d4.

Reason for revert: Breaking bots: https://logs.chromium.org/logs/skia/5061fbd134144011/+/steps/dm/0/stdout

Original change's description:
> Initial land of SkSL DSL.
>
> This is not 100% complete: it lacks support for several kinds of nodes
> and supports only a bare handful of builtin functions, but it
> demonstrates the core functionality and it should be relatively
> straightforward to fill in the missing pieces.
>
> Change-Id: I3058089338e20eebc3da18ac5571801abcaab564
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331177
> Reviewed-by: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

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

Change-Id: Iee77e5322a0b1efb0f3718ec1f5976a4d4e7323a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342620
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-12-09 20:49:39 +00:00
Mike Reed
0dd0ed6d1e Update our lastmoveindex if addPath ended with a kClose verb
Bug: 1153516
Change-Id: Id6ab162ba3bbf902048009ae2b48b2c67f814b99
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342616
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-09 20:27:36 +00:00
Ethan Nicholas
6e599511d4 Initial land of SkSL DSL.
This is not 100% complete: it lacks support for several kinds of nodes
and supports only a bare handful of builtin functions, but it
demonstrates the core functionality and it should be relatively
straightforward to fill in the missing pieces.

Change-Id: I3058089338e20eebc3da18ac5571801abcaab564
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331177
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-12-09 20:13:46 +00:00
Florin Malita
9c1f1be078 [svg] xml:space support
Add xml:space attribute and implement related white space filters.

(https://www.w3.org/TR/SVG11/text.html#WhiteSpace)

Bug: skia:10840
Change-Id: I52fda50fae1cd7cf8b0dd7c1a2ee2e667ffa947b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342299
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-12-09 20:07:25 +00:00
Adlai Holler
a4bd478bc2 Destroy GrRecordingContext::fAuditTrail last when
In crbug.com/1155871, the audit trail is used during destruction of the
drawing manager.

Bug: chromium:1155871
Change-Id: I74015a033c7620bdad03ac7a3cf5a7ee671482f4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342305
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-12-09 19:10:15 +00:00
Eric Boren
32c6099d92 Revert "Reland "[infra] Switch from isolate to RBE-CAS""
This reverts commit 540b51ce8f.

Reason for revert: RPI disk space

Original change's description:
> Reland "[infra] Switch from isolate to RBE-CAS"
>
> Bug: skia:10883
> Change-Id: Iec82a07fdf3c0807a9bb1870309eded85d4f0b1e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341679
> Commit-Queue: Eric Boren <borenet@google.com>
> Reviewed-by: Weston Tracey <westont@google.com>

TBR=borenet@google.com,westont@google.com

Change-Id: I0156842b995d275d8deb5bd73c6877de7f8af72e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10883
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342596
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
2020-12-09 18:09:39 +00:00
Nathaniel Nifong
050ea3a580 Revert "Always attempt to flatten images with mskp image ids"
This reverts commit eca04eeeb8.

Reason for revert: breaks playback for regular skp files

Original change's description:
> Always attempt to flatten images with mskp image ids
>
> b:skia:11041
>
> Change-Id: I9eeac07b5cad7809d1e8ec9f9b12149f016227e0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341798
> Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
> Commit-Queue: Nathaniel Nifong <nifong@google.com>

TBR=nifong@google.com,lovisolo@google.com

Change-Id: I034229b5b22aa478cdcc26d3a0bcb4e543606c04
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342462
Reviewed-by: Nathaniel Nifong <nifong@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-12-09 17:58:36 +00:00
John Stiles
d0614f2a7b Support comma operator with mixed types in SPIR-V.
Change-Id: Iac8096f6c225258b430858bad90199ec00b93b6c
Bug: skia:10998
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342304
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-12-09 17:18:09 +00:00
Eric Boren
540b51ce8f Reland "[infra] Switch from isolate to RBE-CAS"
Bug: skia:10883
Change-Id: Iec82a07fdf3c0807a9bb1870309eded85d4f0b1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341679
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Weston Tracey <westont@google.com>
2020-12-09 17:14:39 +00:00
John Stiles
15b4892925 Simplify constant single-value SkSL constructors.
Prefer the simplified form half4(N) instead of half4(N, N, N, N) where
we can. Slightly easier to humans to read and for computers to parse.

Change-Id: Ibfe6d1c5ef6ebddc157ff39c7bdeddeb27131689
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337722
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-09 16:31:49 +00:00
John Stiles
47b4b19af2 Parenthesize intrinsic comparisons properly in Metal.
Previously, `equal(a, b).x` would emit `a == b.x`.

Change-Id: I311116f45fb275b158a948a0fd165d97688ce8ff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341978
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2020-12-09 16:24:19 +00:00