Commit Graph

52256 Commits

Author SHA1 Message Date
Florin Malita
512ff75a0b [svg] Initial <tspan> support
Introduce classes to support text node nesting:

  - TextContainer -- base class for nestable text containers
    (<text>, <tspan> etc)
  - TextLiteral -- actual text string/payload

Example structure mapping:

  <text>Foo<tspan>Bar</tspan>Baz</text>

  TextContainer[text]
    TextLiteral["Foo"]
    TextContainer[tspan]
      TextLiteral["Bar"]
    TextLiteral["Baz"]

Also add text layout state (SkSVGTextContenxt) to SkSVGRenderContext.
This will be used to track layout across a text subtree.

For now we don't touch rendering, so the output is quite garbled for
non-trivial text (no advance propagation -> things draw on top of each
other).

Bug: skia:10840
Change-Id: Ic6d3990ec8635b586f5d3d226be070fbf134e391
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341236
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2020-12-07 15:29:19 +00:00
Kevin Lubick
f3b959c000 [canvaskit] Respect Exif metadata for animated images.
Change-Id: I58a5095ea3314a21d895f34a4b8cab9484c29b1d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340717
Reviewed-by: Leon Scroggins <scroggo@google.com>
2020-12-07 11:10:07 +00:00
Kevin Lubick
e7c1a731ff [canvaskit] Remove 2d point arrays from API.
I kept in an array of Color (Float32Array) because it's very convenient
and not worth the hassle of removing.

Change-Id: I34c430c2b5112b6d073b049a81994e946428f21c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340797
Reviewed-by: Nathaniel Nifong <nifong@google.com>
2020-12-07 11:09:49 +00:00
skia-autoroll
d90e578fb4 Roll ANGLE from 2ded93db0a0d to 251ba5cb119f (15 revisions)
2ded93db0a..251ba5cb11

2020-12-05 syoussefi@chromium.org Vulkan: Fix transform feedback with in-render-pass clears
2020-12-05 zentaro@chromium.org Mark classes with final dtors as final
2020-12-05 syoussefi@chromium.org Vulkan: Support for geometry shader with max_vertices=0
2020-12-05 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 78187c025ba6 to 6991410be08c (262 revisions)
2020-12-04 timvp@google.com Batch replace std::unordered_map with angle::HashMap in src/
2020-12-04 syoussefi@chromium.org Vulkan: Fix transform feedback spanning multiple render passes
2020-12-04 syoussefi@chromium.org Vulkan: Support geometry/tessellation primitive topologies
2020-12-04 sugoi@google.com Suppress memory leaks detected by LSAN
2020-12-04 paulthomson@google.com Capture: Disable GL_CHROMIUM_bind_uniform_location
2020-12-04 jmadill@chromium.org Program: Allow non-fragment program input variables.
2020-12-04 courtneygo@google.com Ignore redundant Texture state changes
2020-12-04 jmadill@chromium.org Translator: Collect gl_in as a varying.
2020-12-04 ianelliott@google.com Revert "Suppress memory leaks detected by LSAN"
2020-12-04 angle-autoroll@skia-public.iam.gserviceaccount.com Roll VK-GL-CTS from 524e5bcfba33 to 41331850eb21 (39 revisions)
2020-12-04 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from d76e39a75a7a to 78187c025ba6 (806 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 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
Test: Test: no errors building
Change-Id: I04cabac5b4e3e26b500f91f6a6aed325187b2819
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341336
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-12-07 04:58:29 +00:00
skia-autoroll
aa443a8cce Roll SwiftShader from bae138de13ac to 7c84426d2abe (8 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/bae138de13ac..7c84426d2abe

2020-12-05 capn@google.com Remove stlport C++11 extensions
2020-12-04 ynovikov@chromium.org Add CQ configuration.
2020-12-04 amaiorano@google.com Add unit test for ENABLE_RR_EMIT_ASM_FILE
2020-12-04 amaiorano@google.com Kokoro: isolate flag enabling for incremental builds
2020-12-04 amaiorano@google.com Kokoro: upgrade Linux build from gcc 7 to 9
2020-12-04 capn@google.com Fix stringification of macro value
2020-12-04 capn@google.com Allow configuring Reactor's anonymous mmap name
2020-12-04 capn@google.com Remove named anonymous mmap for GL/VK allocations

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: I026aa7a4994318d41ebed0de523182ca7d44f664
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341316
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-12-07 04:46:08 +00:00
skia-recreate-skps
d67df01dcf Update SKP version
Automatic commit by the RecreateSKPs bot.

TBR=rmistry@google.com
NO_MERGE_BUILDS

Change-Id: I2686dd9c3a1e9adaf4f64a88a356ff48f3d9dfb4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341276
Reviewed-by: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
Commit-Queue: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
2020-12-06 21:29:51 +00:00
Mike Reed
edb22ec498 work on better SkPath::dump
ForceClose is a pain, and already removed from some
(hopefully all at some point) of our iterators

Follow-on plan: use raw iter, and output code compatible with
SkPath::Make()

Change-Id: Icda4ad2e605eb2fb9842dd35b5e0d4a0939e62eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341237
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-06 19:47:31 +00:00
Michael Ludwig
f326e4faef Remove SkCanvas::LayerIter used in SkCanvasStateUtils
The LayerIter existed to iterate over the top-most device and any
unclipped layers connected to it. With unclipped layers gone,
SkCanvasStateUtils can just access the top-most device using other
APIs.

Bug: skia:10986
Change-Id: I260ec37fcc8e39d1ec2972a3297521d714649cb5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339991
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-12-05 17:21:53 +00:00
Michael Ludwig
e0dee01043 Remove support for deprecated kDontClipToLayer_SaveLayerFlag
This removes the conditional behavior based on #defines, and the private
flag definitions. It removes GMs and updates tests that tested the
feature. Follow-up CLs will go through and simplify the internals of
SkCanvas to take advantage of this support removal.

Bug: skia:10986
Change-Id: Id42c9e7d134dd06507fabf6577e7872942ef9077
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339988
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-12-05 00:00:13 +00:00
Michael Ludwig
3021795041 Improve CanvasState cross-library tests
Several things are accomplished as part of this:
1. The canvas_state_lib build target is brought back so that we can
   actually test the canvas state sharing across library boundaries.
2. The canvas state helper functions are updated to work with DLLs
   (confirmed tests pass on Windows in cross library mode)
3. The tests now always run, and the cross-state define only changes
   what version of the helper functions are used
4. Updated the dlopen code in the test to use the SkOSLibrary ports
   instead of calling dlopen/dlclose directly.
5. Fix bugs in SkCanvasStateUtils that were uncovered as part of
   always running these tests.
6. Switches the define away from SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
   to SK_TEST_CANVAS_STATE_CROSS_LIBRARY, since these tests are not
   strictly speaking testing the unclipped layer feature.

Change-Id: Id4ae41e4bc3fb8227367deac899878ecf9d7b98e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341003
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-12-04 22:03:25 +00:00
Nathaniel Nifong
ae95077db6 fix another m44 bug in debugger
Change-Id: Id80344a71b54c80609ec24947014592d6b30eb63
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341001
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
2020-12-04 21:41:55 +00:00
John Stiles
f2bd501ce3 Use references instead of pointers for Metal out params.
Pointers require decorating the variable with a * to read back the
value, which the code generator did not properly handle. There was a
special case to add the * but it only supported assignment into the
variable, not reading back. References require no special decoration.

This change fixes compile errors in Functions.sksl with the "bar"
function. (This test marks `x` as an inout but never actually mutates
it.) It also allows us to remove a special-case workaround for `frexp`,
an intrinsic function which uses a reference for its out-parameter.

Additionally, this CL adds a non-inlining copy of "OutParams.sksl" to
the Metal test directory, as most of our tests which use out-parameters
end up inlining all the code, which hides these sorts of bugs.

Change-Id: I31c4db04f6b512b4cd4fe65b3347b82bdbf039cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341000
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-12-04 20:22:55 +00:00
John Stiles
bc3c41b874 Enforce that layout(binding=...) is set on interface blocks in Metal.
Previously, we would emit an invalid [[buffer(-1)]] annotation on the
block, causing the Metal compilation to fail.

Change-Id: I68b2439c05db3163686e84c5dcc9a5c43870ff67
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340761
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-04 19:30:35 +00:00
Mike Reed
db873dd600 add util for checker image
Change-Id: I6fcf6263a6a261016cb5971872c2f2b5a9943d8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341004
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-04 18:02:24 +00:00
Mike Reed
ca3755d020 Reland "Remove some flutter flags"
This reverts commit 7672470dff.

Reason for revert: think I fixed the .mm call-sites

Original change's description:
> Revert "Remove some flutter flags"
>
> This reverts commit a58c14025a.
>
> Reason for revert: missed .mm call sites
>
> ../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm:163:17: error: no member named 'MakeScale' in 'SkMatrix'
>       SkMatrix::MakeScale([UIScreen mainScreen].scale, [UIScreen mainScreen].scale);
>       ~~~~~~~~~~^
>
>
> Original change's description:
> > Remove some flutter flags
> >
> > Change-Id: I45466d1134511d26a90a4874a0db709c6048dd8b
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340760
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
>
> TBR=reed@google.com
>
> Change-Id: Ia9c21d1119c39d788a8c5272be1b0964527a5826
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340996
> Reviewed-by: Mike Reed <reed@google.com>

TBR=reed@google.com

# Not skipping CQ checks because this is a reland.

Change-Id: I7995f2ef46c7da470449dc4b5a96ef2f5023ef32
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341002
Reviewed-by: Mike Reed <reed@google.com>
2020-12-04 17:07:59 +00:00
John Stiles
fdb8dbe69c Code cleanup: fix case of member functions.
These were added by a certain new team member who hadn't internalized
all the Skia style rules yet.

Change-Id: If8c53045428c61efb7a09c573885b17cb2ab360e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340999
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-04 16:56:11 +00:00
John Stiles
2630ea3312 Disallow identifier names that overlap existing types.
It's not legal to use identifiers like "int" or "sampler" to name your
variables (or enums, or structs, etc.). SkSL will now report this as an
error instead of relying on the driver to catch this.

(Note that in some contexts, it might be legal by the spec to reuse a
name that you introduced yourself, depending on the scope. In practice,
this confuses Apple GLSL, so we shouldn't support it anyway.)

This caught several existing places in our code where we used the name
"sampler." These were never exposed to the driver (they were intrinsics
that we would replace during compilation) so they were harmless before.

Change-Id: Ia6dcfca8c500d02e1eb5f9427bed8727e114dfc2
Bug: skia:11036
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340758
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-04 16:52:01 +00:00
Mike Klein
8ab65bf694 don't parse svgs we won't run
Change-Id: Ia3b11e5f785fb452a66067c0c063bc2354790978
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340976
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-12-04 15:54:51 +00:00
Mike Reed
7672470dff Revert "Remove some flutter flags"
This reverts commit a58c14025a.

Reason for revert: missed .mm call sites

../../flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViewsTest.mm:163:17: error: no member named 'MakeScale' in 'SkMatrix'
      SkMatrix::MakeScale([UIScreen mainScreen].scale, [UIScreen mainScreen].scale);
      ~~~~~~~~~~^


Original change's description:
> Remove some flutter flags
>
> Change-Id: I45466d1134511d26a90a4874a0db709c6048dd8b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340760
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: Ia9c21d1119c39d788a8c5272be1b0964527a5826
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340996
Reviewed-by: Mike Reed <reed@google.com>
2020-12-04 15:46:35 +00:00
Jim Van Verth
fa8d6915cb Remove Metal Perf bots running on MacOS 10.13.
We're not supporting Metal on MacOS 10.13 any more so we shouldn't be
running these.

Change-Id: I218f6cd1be4c5cdcc1e350e7edc55c1b74312838
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340757
Reviewed-by: Ravi Mistry <rmistry@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-12-04 14:49:31 +00:00
John Stiles
bb43b7e85e Simplify various logic around multi-dimensional arrays.
SkSL::Type now asserts if you try to create a multi-dimensional array;
various looping/recursing constructs that no longer need to loop or
recurse were updated.

Change-Id: I191b4a032ddc6e7759cebc8b41c536cfaaf1b626
Bug: skia:11026
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340759
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-04 14:28:51 +00:00
Mike Reed
a58c14025a Remove some flutter flags
Change-Id: I45466d1134511d26a90a4874a0db709c6048dd8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340760
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-04 13:56:31 +00:00
skia-autoroll
d8090fdc86 Roll ANGLE from 8670d6183a84 to 2ded93db0a0d (4 revisions)
8670d6183a..2ded93db0a

2020-12-04 sugoi@google.com Suppress memory leaks detected by LSAN
2020-12-04 ianelliott@google.com Revert "Vulkan: Use specialization constant for halfRenderAreaWidth"
2020-12-03 syoussefi@chromium.org Vulkan: Fix precision issue in blit math
2020-12-03 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from bfb211914759 to bae138de13ac (8 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 westont@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: westont@google.com
Change-Id: I44c9e8d066a2bc6cfb3dace471e460f296e3f754
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340754
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-12-04 05:36:51 +00:00
John Stiles
c0c5106bd4 Add Type::isArray and Type::isStruct helper methods.
These methods improve readability for simple, commonly-performed type
checks.

We already had a (very rarely-used) helper function `isArrayed` which
was only applicable to texture and sampler types. To avoid potential
confusion, this has been renamed to `isArrayedTexture`.

Change-Id: Ibec9d872ff3b415964b842c96ddc1b5b271ac883
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340720
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-03 22:58:52 +00:00
Mike Klein
b19518dcc7 add missing unit test for 128-bit ops
Change-Id: I233398bf34411231d44613d89aed28935fe30a28
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340796
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-12-03 22:25:10 +00:00
Julia Lavrova
b42686ad01 Painting styled text blocks in RTL
Bug: skia:11017
Change-Id: I13bd210a0d38614bab4a5a98c4507150043224cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340317
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-12-03 21:51:40 +00:00
Mike Klein
abcc1ecdfd plumb register aliasing hints through on arm64
There's no reason not to do this, though there are so many registers on
arm64 that I doubt we'll see any speed difference here at all.

I let dst() take a second hint, which makes most of these super easy;
double hints don't really come up on x86 because we've got all that
any() register-or-memory-address complexity to deal with instead there.

The most subtle bit is that it's safe to alias the index and destination
registers of the gather ops... we pull an index out of a lane, load the
value, and shove it back into that same lane, all totally safe.

Change-Id: I0f28ead95922e99e712ccb2cf824bf2610f556a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340721
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-12-03 21:30:43 +00:00
Jim Van Verth
95fb5786c5 Deprecate Metal support on iOS 9.
Also fixes a warning when building for OSes older than MacOS 11/iOS 14.

Change-Id: I81fb5849df41c63f6d10696f6c056451719df906
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340756
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-12-03 21:11:28 +00:00
John Stiles
e766cb8c1d Use addArrayDimension instead of manually creating array type.
Just noticed one more spot in the code where an array type was being
hand-assembled.

Change-Id: I3c9d931caee3dc8e03b3eb016af5fa0a36064d57
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340660
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-03 21:07:14 +00:00
John Stiles
a217950930 Simplify addArrayDimensions by removing multi-dimensional array support.
There's no need to pass in an array of multiple dimensions when only one
dimension is supported by the language.

Change-Id: Id170e96e1c0e8f83a79a85e4a737792677044150
Bug: skia:11026
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340659
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-12-03 21:06:23 +00:00
Chris Dalton
f2fb80f504 Add unaffectedByDstValue() to GrProcessorSet::Analysis
This will allow us to decide whether we need a stencil test when
drawing strokes.

Bug: skia:10419
Change-Id: Ie6aa0e4c4af6302c3ec28f9515cfae0e5c41a4ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340517
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-12-03 20:24:41 +00:00
John Stiles
d39aec940d Remove multi-dimensional array support from the parser.
Previously, our AST structures would include a "sizeCount" for arrays,
which indicated the number of AST nodes associated with array
dimensions. Since GLSL only supports a single array dimension, this
field has been replaced with "isArray," a boolean indicating whether we
have a single AST node for array size. This allowed many array-size
based looping constructs to be replaced with simpler non-looping
equivalents.

This change flushed out a few places where the parser was not actually
enforcing its promised maximum array-dimensionality.

Also found some duplicated code in variable-declaration parsing,
related to parsing array-sizes and initializer expressions. This has
been de-duplicated by using a lambda. (This change was likely why this
CL was not net-negative for LOC, but it's simpler and cleaner.)

Change-Id: I7abed732d3a296edf02c0ec9813fceb5aae4a9a0
Bug: skia:11026
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340656
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-03 20:24:38 +00:00
Mike Klein
573dcb7682 factor out an active_lanes = scalar ? 1 : K
I keep mistyping logic like

    for (int i = 0; i < (scalar ? 1 : K); i++)

as

    for (int i = 0; i < scalar ? 1 : K; i++)

which looks innocuous but is actually an infinite loop.
So replace all that with

    const int active_lanes = scalar ? 1 : K;
    ...
    for (int i = 0; i < active_lanes; i++)

Change-Id: Icabcc6c976a21578f4ec4084fd062c8867e99d1a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340719
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-12-03 19:56:17 +00:00
Mike Klein
a7470df09c add load128/store128
This finishes up the existing SkVM ops on arm64.
I wish I had a unit test for this, but there's no diffs drawing RGBA F32.

Change-Id: I53725769fa2e7a1701f7360905205356e1ea18cb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340718
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-12-03 19:53:07 +00:00
Florin Malita
38921cafe1 Reland "[skottie] Add image sampling and transform options"
This reverts commit b81842aa28.

Reason for revert: reland with fixes

Original change's description:
> Revert "[skottie] Add image sampling and transform options"
>
> This reverts commit 2f24405250.
>
> Reason for revert: broke Win/shared 
>
> Original change's description:
> > [skottie] Add image sampling and transform options
> >
> > Expand the SkImageAsset API to support controlling sampling options and
> > pass an additional transform.
> >
> > Bug: skia:10944, skia:10942
> > Change-Id: I7bad0b2ab58ed40fe4b425de0eb6970a4c7d7117
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340097
> > Commit-Queue: Florin Malita <fmalita@chromium.org>
> > Commit-Queue: Florin Malita <fmalita@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
>
> TBR=fmalita@chromium.org,fmalita@google.com,reed@google.com,aparchur@google.com
>
> Change-Id: I59d4161356ffdc20588f1bd3beb33c54e44807a2
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10944
> Bug: skia:10942
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340619
> Reviewed-by: Florin Malita <fmalita@google.com>
> Commit-Queue: Florin Malita <fmalita@google.com>

TBR=fmalita@chromium.org,fmalita@google.com,reed@google.com,aparchur@google.com

# Not skipping CQ checks because this is a reland.

Bug: skia:10944
Bug: skia:10942
Change-Id: I91892f4db6366ceb07d1a49a7bc54da17cea5399
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340657
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-12-03 19:21:57 +00:00
Mike Reed
5f9ba6953f fix debugger bindings
Change-Id: Ie70a79ca907ffb4b30247d3d8564b7183a6e04f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340658
Reviewed-by: Nathaniel Nifong <nifong@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-03 19:18:07 +00:00
Mike Klein
ec255636f2 add to_fp16/from_fp16
Nothing too tricky here.

Change-Id: I48e51c301e53efc63fc92c378fe45a0e5a2df7e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340520
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-12-03 18:40:47 +00:00
Mike Klein
c7bca52b99 add load64
Much like store64, load64 really wants to use ld2.4s but that needs a
way to allocate adjacent registers.  So, just like store64, do it
manually, this time with uzp (unzip).

Change-Id: Ie10cc8d2df57390d1c6709bd7485bb5158375078
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340519
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-12-03 18:32:57 +00:00
Mike Reed
1a4140e598 deprecate getTotalMatrix
Change-Id: Iec7d67f4ec3fdf4d5280f3de3d6146a69a60c646
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339995
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-03 17:37:35 +00:00
Tyler Denniston
041f6656dc [svg] Remove kInherit from several SVG types
We can now remove kInherit from all of the SVG types, but this CL does
just a few to get us started / prove the concept.

SkSVGPaint, SkSVGClip and SkSVGLineCap now do not contain kInherit as an
enum value. Also, SkSVGLineCap (and eventually others) can be a bare
enum class now.

Change-Id: I7de001459bcb1f5586d66b975f92fecedb125dde
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335827
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2020-12-03 17:36:54 +00:00
Florin Malita
b81842aa28 Revert "[skottie] Add image sampling and transform options"
This reverts commit 2f24405250.

Reason for revert: broke Win/shared 

Original change's description:
> [skottie] Add image sampling and transform options
>
> Expand the SkImageAsset API to support controlling sampling options and
> pass an additional transform.
>
> Bug: skia:10944, skia:10942
> Change-Id: I7bad0b2ab58ed40fe4b425de0eb6970a4c7d7117
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340097
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Florin Malita <fmalita@google.com>
> Reviewed-by: Mike Reed <reed@google.com>

TBR=fmalita@chromium.org,fmalita@google.com,reed@google.com,aparchur@google.com

Change-Id: I59d4161356ffdc20588f1bd3beb33c54e44807a2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10944
Bug: skia:10942
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340619
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-12-03 17:11:00 +00:00
John Stiles
d39aec0e40 Simplify InterfaceBlock by removing multi-dimensional array support.
Maintaining an array of Expression-based sizes is not necessary as GLSL
only supports a single dimension, and doesn't allow any expression other
than a constant integer or nothing (meaning "unsized").

Change-Id: Id58404c5c8d48786e02585d2a6391b2f3e5393e8
Bug: skia:11026
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340456
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-03 16:37:49 +00:00
Chris Dalton
2833ec6111 Plumb mixed samples through GrXPFactory::GetAnalysisProperties
Bug: skia:10419
Change-Id: I43898b0131231e2a4d1d6153e60530ba372b1c19
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340516
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-12-03 16:33:21 +00:00
John Stiles
62a564686f Simplify VarDeclaration by removing multi-dimensional array support.
Maintaining an array of Expression-based sizes is not necessary as GLSL
only supports a single dimension, and doesn't allow any expression other
than a constant integer or nothing (meaning "unsized").

Change-Id: I01b5f88b94234a27e694aa2fc087f9d5f01b99c5
Bug: skia:11026
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340341
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-03 16:32:44 +00:00
John Stiles
9ea48e3965 Disallow multi-dimensional arrays in SkSL.
GLSL only allows one-dimensional arrays. This CL lowers SkSL's array
dimensionality limit from eight to one, and fixes all the tests that
this breaks. The rest of the code still technically supports
arbitrarily-deep array dimensionality; there are many opportunities for
code cleanup and simplification in followup CLs.

Change-Id: I0fc31e4626649ec69d40c5f5597b3924de298df0
Bug: skia:11026
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340339
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-03 16:28:19 +00:00
John Stiles
076e9a2f34 Disallow returning array types in SkSL.
This is illegal in older versions of GLSL and in Metal. We now fail at
SkSL compilation time and properly report the error.

Change-Id: I6ddaeabff5386a1ed6ca3eb8703a6035476ec77a
Bug: skia:11021
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339298
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-03 16:27:39 +00:00
John Stiles
3dba3ee465 Fix various codegen issues for Metal array types.
This CL fixes cases where array dimensions could be placed on the type
instead of the variable (`float[2] x` instead of `float x[2]`). It also
reports errors in cases where arrays aren't syntactically valid in
Metal, rather than emitting unusable Metal code. (Some of these cases
are actually invalid GLSL as well! But those fixes are coming in
followup CLs.)

Change-Id: I22279127c8a9aa2f22bf5ea3d225e563c2e254f2
Bug: skia:10926, skia:10760, skia:10761
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340137
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-03 16:20:39 +00:00
Florin Malita
2f24405250 [skottie] Add image sampling and transform options
Expand the SkImageAsset API to support controlling sampling options and
pass an additional transform.

Bug: skia:10944, skia:10942
Change-Id: I7bad0b2ab58ed40fe4b425de0eb6970a4c7d7117
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340097
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-12-03 16:17:24 +00:00
Jim Van Verth
f557aef55f Use MTLCommandBuffer status to determine if completed.
Flutter is seeing an issue with adding completedHandlers to a command
buffer when running on iOS 11. This works around that by changing our
completion check to use the built-in status member rather than setting
up and checking a semaphore.

Bug: b/173700659
Change-Id: Ie9ffdfc85ad48f4613224d410284a85660dd3622
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340336
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-12-03 16:12:39 +00:00
Mike Klein
f5097db452 add store64
Ideally we'd use st2.4s here but that needs its inputs in adjacent
registers, and I don't have a mechanism for that (yet).  So instead
interlace manually using zip1/zip2.

Tested by SkVM_64bit.

Change-Id: I7b05fcd1f4398012755fc4f0d4e39743d0c69a94
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340518
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-12-03 16:12:19 +00:00