Commit Graph

53024 Commits

Author SHA1 Message Date
Brian Osman
f619079545 Fix field access and indexing of complex expressions
Evaluating either kind of expression now works like all other
expressions - evaluate the inner part, then work with the resulting
values. Added unit tests for both of these that previously failed.

With this change, writeVariableExpression is only used for
VariableReference expressions, so adjust that, too.

Bug: skia:11178
Change-Id: Ia595be473b55f4bb03ec25897f9929835177257c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358529
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-01-25 20:52:19 +00:00
Joe Gregorio
555b7a4d77 [particles] Fix up URLs for the particles migration.
Bug: skia:11108
Change-Id: Id41d061adbaab325634a2497fc96e4fc89bde6ea
Docs-Preview: https://skia.org/?cl=356762
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356762
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-01-25 20:44:32 +00:00
Weston Tracey
fff4099358 Reland "[infra] Use Mac10.15.7 and xcode12.3 for all builds."
This is a reland of f5aed172c6

Original change's description:
> [infra] Use Mac10.15.7 and xcode12.3 for all builds.
>
> Bug: skia:11129
> Change-Id: I314d51988e4cafc9dfea60bc70a57f46faa8666a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345396
> Reviewed-by: Eric Boren <borenet@google.com>

Bug: skia:11129
Change-Id: I00bca0407ff7522bafca3f4e4e0aa92c239043fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353036
Reviewed-by: Eric Boren <borenet@google.com>
2021-01-25 19:42:02 +00:00
Adlai Holler
c96e5707d8 Prohibit moving and copying SkArenaAllocs
Change-Id: I9bcb9f2c98deb69c75ccd29ae294fbc74d4bb283
Cq-Include-Trybots: luci.skia.skia.primary:Build-Debian10-EMCC-wasm-Release-WasmGMTests
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358520
Commit-Queue: Adlai Holler <adlai@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2021-01-25 19:22:17 +00:00
Mike Reed
9911630fc2 Hide misc non-sampling draw methods
Related chrome CL:
https://chromium-review.googlesource.com/c/chromium/src/+/2646604

Bug: skia:7650
Change-Id: I1069a6151cb70bb6d2c743cf2513f47284c9df7b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358221
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2021-01-25 17:54:56 +00:00
John Stiles
232dd2b61b Reland "Run unit tests to verify SkSL folding behavior."
This is a reland of 4ecab92584

This reland folds in subsequent code cleanups and disables a test that
failed on Android + Vulkan.

Original change's description:
> Run unit tests to verify SkSL folding behavior.
>
> The unit test loads SkSL source files from `resources/sksl`, compiles
> the code, and uses SkRuntimeEffect to render a pixel using the effect.
> If solid green is rendered, the test passes.
>
> Change-Id: I2ccb427a907975ae84aee19d8e68d774b2cb638c
> Bug: skia:11009
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355983
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

Bug: skia:11009
Change-Id: I09196c8ca3041e8957324a0cbb7f7d6963c6e4e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358523
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-01-25 17:49:36 +00:00
Brian Salomon
46f6323ca8 GrSurfaceContext read/writePixels fail on GrColorType::kUnknown
There are SkColorTypes (e.g. kBGR_101010x) that don't have Gr equivs.
When a SkPixmap is converted to GrPixmap we will have a kUnknown color
type.

Bug: chromium:1164705
Change-Id: Iefa2c8363582433a531c5501aa251c571b5a6eab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358521
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-01-25 17:14:06 +00:00
Tyler Denniston
7aea2ae902 [svg] Fix non-xy length scale factor
We were miscalculating percentage lengths that do not correspond to the
x or y axis. Spec:

https://www.w3.org/TR/SVG11/coords.html#Units_viewport_percentage

Change-Id: I5c02e101f3bf7f1f93be3e8718290f490638f9b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357279
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-01-25 17:12:46 +00:00
Adlai Holler
69c57e42c7 Revert "Merge adjacent GrOpsTasks with same target together"
This reverts commit 3b5b7d1178.

Reason for revert: Arenas cant be moved

Original change's description:
> Merge adjacent GrOpsTasks with same target together
>
> This allows the ops tasks to make one render pass instead of multiple.
> The only case where this merging is needed is as a result of
> reordering (reduceOpsTaskSplitting).
>
> Bug: skia:10877
> Change-Id: Ia967ead6efc43f7d2c1da58f770d3987da690cda
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353656
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>

TBR=egdaniel@google.com,robertphillips@google.com,adlai@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:10877
Change-Id: I6d1813ee1c28bc43dffb0a5f26dba4a5c41c637f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358522
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2021-01-25 17:04:56 +00:00
Ethan Nicholas
fd6e27887f Removed useless manipulation of std::move'd value
This attempt to retain a std::move'd value was inadvertently left in
place in a previous CL. It's harmless, but should have been removed.

Change-Id: I485e0f14d921fe6c87a62520c7478a28e8ce28d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358517
Auto-Submit: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-01-25 17:04:17 +00:00
Florin Malita
c55c8c1e8e [svg] Generalize text shaping
In preparation for text bounding box support, fission the actual
rendering phase from the shaping/alignment phase:

  - rename onRenderText -> onShapeText
  - introduce a ShapedTextCallback abstraction for consuming the result
    of text processing
  - relocate the final rendering step to a ShapedTextCallback impl

Bug: skia:10840
Change-Id: Ia8cc0d9a5a5484972a34042fd782f9e4fada6b12
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358223
Commit-Queue: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2021-01-25 16:40:16 +00:00
Tyler Denniston
bd91660b6e [svg] Handle unspecified filter effect inputs
Per spec [1], unspecified inputs ('in', 'in2' attributes) have different
meaning depending on whether the referencing filter is the first in the
pipeline. This CL adds previous result tracking to the filter context
and handles unspecified values accordingly during input resolution.

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

Bug: skia:10841
Change-Id: I64618ad712979f6dd62adb4686085fe31618c3cb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357278
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-01-25 15:18:16 +00:00
Brian Salomon
0f9f800ea1 Add origin back to GrCopyRenderTask
Will be needed for repositionable DDLs.

Change-Id: I6dacf51bd36cfbe1c54a9350987f17a6d18cf3c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357776
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-01-25 15:00:16 +00:00
John Stiles
0693fb8e52 Replace a few casts in SPIR-V with as<T>.
Change-Id: I2ec61848c2d9fc11bd0330dccce2efe1aeb0d4ff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357779
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-25 14:58:26 +00:00
Florin Malita
302ea2e03c [svg] Cleanup text content model rules
Per spec (and empirically) <text> elements are not nestable (neither
directly or indirectly):
https://www.w3.org/TR/SVG11/intro.html#TermTextContentChildElement

Update the implementation to

 - only bridge onRender -> onRenderText in the root SkSVGText
   implementation
 - disallow <text> elements as text container descendants

Change-Id: I07b3abaf943b820e01c88f78bddf7ce5970ee508
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358220
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2021-01-25 14:49:16 +00:00
skia-autoroll
fe8a4faa4b Roll Chromium from 465f56090c50 to 09570e87f5f8 (699 revisions)
465f56090c..09570e87f5

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 nifong@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: nifong@google.com
Change-Id: I395760bd270acc0ada4cff1b19787e8a1cd6bdc8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358403
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-25 05:07:25 +00:00
skia-autoroll
83372eb8ee Roll ANGLE from ff5f715e5c4a to 3c3b82abcf0a (9 revisions)
ff5f715e5c..3c3b82abcf

2021-01-22 cnorthrop@google.com Tests: Add Hearthstone trace
2021-01-22 syoussefi@chromium.org Vulkan: Unconditionally expose OES_shader_io_blocks
2021-01-22 geofflang@google.com Roll Khronos headers.
2021-01-22 ynovikov@chromium.org Suppress headers includes privacy checks on iOS
2021-01-22 jmadill@chromium.org Capture/Replay: Allow testing with multiple versions.
2021-01-22 jmadill@chromium.org Capture/Replay tests: Fixes for goma & depot tools.
2021-01-22 angle-autoroll@skia-public.iam.gserviceaccount.com Roll SwiftShader from 22be66d40712 to 9441aea16221 (10 revisions)
2021-01-22 angle-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from f646afdb8929 to a0047c0f6ec8 (1 revision)
2021-01-22 angle-autoroll@skia-public.iam.gserviceaccount.com Roll Chromium from 67fb6a8435bb to 318dff1807ef (435 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 nifong@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: nifong@google.com
Test: Test: angle_perftests --gtest_filter="*hearthstone*"
Change-Id: I1490f66fd892a9d3078f3b9ff8ce53649878857b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358417
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-25 04:57:55 +00:00
skia-autoroll
c0ddd9bfe9 Roll SwiftShader from 22f14a877953 to 413f7cb17c77 (3 revisions)
https://swiftshader.googlesource.com/SwiftShader.git/+log/22f14a877953..413f7cb17c77

2021-01-22 sugoi@google.com Flip samples to their correct position
2021-01-22 capn@google.com Target macOS 10.14 on ARM64 to enable C++17
2021-01-22 bclayton@google.com Merge changes I6c21b03d,Ic6136d02,I988c0288,I21d11818,I79fa8162, ...

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 nifong@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: nifong@google.com
Change-Id: I0c89a2b3c559fcf930205bd210f5495f08514b41
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358416
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-25 04:57:45 +00:00
skia-autoroll
f58b363fee Roll Dawn from db383498c5c6 to f1f8394de04e (9 revisions)
https://dawn.googlesource.com/dawn.git/+log/db383498c5c6..f1f8394de04e

2021-01-23 cwallez@chromium.org dawn_native: Skip more validation if it is disabled.
2021-01-22 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 6761160dc149 to 5c243f824c59 (1 revision)
2021-01-22 cwallez@chromium.org Do not track global texture usage in PassResourceUsage.
2021-01-22 cwallez@chromium.org Rename leftover references of output attachment to render attachment.
2021-01-22 cwallez@chromium.org Make ComboVertexStateDescriptor non-copyable non-movable.
2021-01-22 enga@chromium.org d3d12/vulkan: Skip descriptor update/creation if resource is destroyed
2021-01-22 cwallez@chromium.org dawn_native: Move beginRenderPass texture usage validation into the encoder
2021-01-22 cwallez@chromium.org Remove QueueWriteBufferTests.ManyWriteBuffer on Intel Vulkan
2021-01-22 cwallez@chromium.org dawn_native: Move pass validation of buffer usages into the encoder.

Also rolling transitive DEPS:
  https://dawn.googlesource.com/tint from 6761160dc149 to 5c243f824c59

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,kainino@google.com,enga@google.com on the revert to ensure that a human
is aware of the problem.

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

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

Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-x86_64-Debug-Dawn
Bug: None
Tbr: cwallez@google.com,kainino@google.com,enga@google.com
Change-Id: I312879d8ffd7f8fb66a50adff1f245ec6331ae6a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358402
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2021-01-25 04:49:15 +00:00
Mike Reed
607a382298 drawBitmap is deprecated, use drawImage
Change-Id: Ib66517fe26036704ccb8328ef92fa0f5240c79f4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358222
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-25 01:44:55 +00:00
Mike Reed
069e484cc3 drawBitmap is deprecated
- starting to remove duplicate/unneeded benches

Change-Id: I4cd2e73b4e5d6664a99cc4a51f82436970d12eb6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358219
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-24 17:39:15 +00:00
Mike Reed
568f0ae778 drawBitmap is deprecated
- update call-sites in gms
- start deleting obsolete/duplicated gms

Change-Id: I9ab5aa0a22d4603ccb43715c0583eb587bbe5c8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358217
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-24 14:48:44 +00:00
skia-recreate-skps
5bbf727573 Update SKP version
Automatic commit by the RecreateSKPs bot.

TBR=rmistry@google.com
NO_MERGE_BUILDS

Change-Id: I8ea7cc0693f670f07650e2f2865e968ef70a42c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358296
Reviewed-by: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
Commit-Queue: <skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com>
2021-01-24 09:38:44 +00:00
Mike Reed
fa582c8f81 drawBitmap is deprecated
Change-Id: I94908f210fc0638ba9f4bac4e5ba2b68ac3be4d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358236
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-24 04:36:04 +00:00
Mike Reed
d396cd50ff Pass sampling to drawimage
Change-Id: Ia1cd20bb4ea1afeb31a1e47da054c309bdaf15bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358216
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-24 03:07:23 +00:00
Mike Reed
8d29ab6309 Pass sampling to drawImage
Bug: skia:7650
Change-Id: I050841a401610b4a68b549602e27c0bac8e62067
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358196
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-24 00:04:33 +00:00
Mike Reed
07c5f52c94 Pass sampling to drawImage calls
Bug: skia:7650
Change-Id: Ie4a1c263bd54553a7cc31ee0ff1585f34a0369a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358176
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-23 18:23:33 +00:00
Brian Salomon
04aef10c64 Add SkRuntimeEffect::makeImage()
Allows creation of an image directly from a RTE. Caller provides the
effect input bindings, image info for the image, and optional local
matrix.

The info's alpha type and colorspace are tags for the output image. No
alpha type or color space conversions are applied to the output of RTE.

CPU does not yet support making kUnpremul images.

Bug: chromium:1151490

Change-Id: I69babc9dbbce4431d756cd7a3eef4753e727d6fe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357284
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-01-23 17:40:23 +00:00
Mike Reed
9702fc6f38 SpecialImage draw takes sampling, not filter-quality
Bug: skia:7650
Change-Id: Iebb3df29a55b049e34492cf072aad3d6c7df9c1d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358019
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-23 03:41:52 +00:00
Chris Dalton
8a42b09c16 Update GrInnerFanTriangulator to use an existing SkArenaAlloc
For the tessellation op this allows it to use either the record-time
or flush-time allocator instead of making its own.

Bug: skia:10419
Change-Id: Ida13283feffda1976bd8fd221d5be0013a5de990
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356516
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-01-23 00:54:22 +00:00
Chris Dalton
b67a336569 Disable inner fan triangulation for the tessellation atlas
Temporarily puts inner fan triangulation behind a flag so we can
disable it for the atlas. The next CL will do the same thing by
creating an op that doesn't triangulate, but making the functional
change in this CL allows us to triage the diffs ahead of time. It will
also ensure the next CL doesn't introduce any others diffs.

Bug: skia:10419
Change-Id: Ia498957c53e83fe40aa797cadace171902dbf548
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357137
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-01-23 00:28:22 +00:00
Greg Daniel
95c2994048 Revert "Run unit tests to verify SkSL folding behavior."
This reverts commit 4ecab92584.

Reason for revert: breaking all the vulkan bots

Original change's description:
> Run unit tests to verify SkSL folding behavior.
>
> The unit test loads SkSL source files from `resources/sksl`, compiles
> the code, and uses SkRuntimeEffect to render a pixel using the effect.
> If solid green is rendered, the test passes.
>
> Change-Id: I2ccb427a907975ae84aee19d8e68d774b2cb638c
> Bug: skia:11009
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355983
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

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

Change-Id: Ife32f6c33d9ba7a9580b66eb312cffb249c43cb2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11009
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357780
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-01-23 00:01:23 +00:00
Mike Klein
e50b322e82 Revert "Consolidate SkSL CPU and GPU test code."
This reverts commit eeeaae9a02.

Reason for revert: other reverts
Original change's description:
> Consolidate SkSL CPU and GPU test code.
>
> This doesn't change any behavior conceptually, just allows the test code
> to share more logic between CPU and GPU sides.
>
> Change-Id: I3564f0310fd45c6ead9cd1ee6975915fe33919ee
> Bug: skia:11009
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357596
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

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

Change-Id: I7c6f26d0f84b8c290093c3e6088553f1130fc67e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11009
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357996
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-01-23 00:00:44 +00:00
Mike Klein
6177b9b314 use ld2.4s/ld4.4s in load64/load128
We can load into two or four adjacent registers from alloc_tmp(N) and
then simply name the right one as our output, discarding the others.

This still has the major TODO of returning all two/four registers at
once, eliminating the immB selector and the redundant memory traffic.
Expect changes towards support for up to 4 Vals per Op next week.

Change-Id: I94846d15ac59d4018c1c9d136c17833e5091f8cf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357305
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-01-22 23:56:02 +00:00
John Stiles
97d18174d6 Allow Metal shaders to return half4 colors.
This allows us to write SkSL shaders which are valid both for use as
Runtime Effect, and for compilation with skslc targeting Metal.

Change-Id: I74e125d81865d4092e657a7d9948d2e72054bda5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357777
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-01-22 23:24:02 +00:00
Greg Daniel
1089c0c59c Make sure we are using cached cpu memory for vulkan readback buffers.
Bug: b/175913056 skia:11207
Change-Id: I7fff0e164844850a957ae9374bed13584fd18ae1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357337
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-01-22 23:13:32 +00:00
Mike Reed
34c56a5c3d Migrate to drawImage w/ sampling
Bug: skia:7650
Change-Id: Icb99ee9f7142fe1ca22f9fa66b1467486ce576a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357598
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-22 22:38:02 +00:00
Ethan Nicholas
d6b6f3ec84 Added basic SkSL DSL statements
(and Ternary for good measure)

Change-Id: I4afa121d54ab9ba8d0814693ce53da7cb73ef340
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353626
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-01-22 22:25:18 +00:00
Brian Osman
2a4c0fbdca Improve memory layout handling in SPIRV generator
Added asserts that verify we don't try to emit the same struct or array
with two different memory layout rules. Some code paths were failing to
inspect the associated variable, leading to incorrect errors about the
attached offsets of members.

Added a test case that triggered that error, and also triggers the new
asserts.

Then, fixed the underlying cause: writing out the struct definition as a
side effect of accessing a member in getLValue().

Bug: skia:11205
Change-Id: I6e5fb76ea918ec9ff10425f2d519ddbc54404b27
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357436
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-01-22 22:16:48 +00:00
Adlai Holler
3b5b7d1178 Merge adjacent GrOpsTasks with same target together
This allows the ops tasks to make one render pass instead of multiple.
The only case where this merging is needed is as a result of
reordering (reduceOpsTaskSplitting).

Bug: skia:10877
Change-Id: Ia967ead6efc43f7d2c1da58f770d3987da690cda
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/353656
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2021-01-22 22:04:29 +00:00
John Stiles
eeeaae9a02 Consolidate SkSL CPU and GPU test code.
This doesn't change any behavior conceptually, just allows the test code
to share more logic between CPU and GPU sides.

Change-Id: I3564f0310fd45c6ead9cd1ee6975915fe33919ee
Bug: skia:11009
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357596
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-01-22 21:49:49 +00:00
Ben Wagner
3193ff2716 Remove SK_SHAPER_HARFBUZZ_USE_BAD_SCALE
No longer used. Remove old numerically unstable scaling.

Change-Id: I3aa05369167377e0277eaca155536c2f1e8036b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356379
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-01-22 20:54:25 +00:00
John Stiles
4ecab92584 Run unit tests to verify SkSL folding behavior.
The unit test loads SkSL source files from `resources/sksl`, compiles
the code, and uses SkRuntimeEffect to render a pixel using the effect.
If solid green is rendered, the test passes.

Change-Id: I2ccb427a907975ae84aee19d8e68d774b2cb638c
Bug: skia:11009
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355983
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-01-22 20:34:28 +00:00
Michael Ludwig
f577427888 Fix lighting image filters
1. Removes clamping of spotlight's specular exponent, which is not the
   specified behavior of feSpotLight in SVG.
   (note: we never clamped a specular lighting effect's
    specular exponent/shininess parameter, although SVG 1.1 does clamp
    that; that is the client's responsibility).
2. Fixes a bug in the GPU implementation of scale factor for spot lights.
3. Saturate computed lighting color after multiplying with color scale,
   instead of just saturating the color scale (allows high intensity
   lights to saturate to white which is more reasonable approximation of
   an HDR effect stored in an LDR color).

Note: fixes 1 and 2 were originally addressed in https://bugs.chromium.org/p/chromium/issues/detail?id=472849
but the change was reverted for layout failure reasons and it was never
relanded after rebasing.

Note2: most of the layout test rebaselines necessary for chrome are
minor and related to fix 2. The exception is svg/dynamic-updates/SVGFESpecularLightingElement-dom-kernelUnitLength-attr.html
which is the result of fix 3. It took a little digging, but I believe
that fix 3 actually makes that generated SVG more correct (it's original
expected image was "wrong").

In that test, it has a specular constant of 4 (which is a multiplier)
and a shininess of 1 (which makes it practically a "diffuse" specular).
So basically we are multiplying the greenYellow color by 4 for most of
the image that has a normal pointing out of the screen. Firefox renders
a similarly yellow oversaturated appearance instead of clamping to the
base greenYellow.

Reading the feSpecularLighting spec, there is no saturation that is
specified where it had been performed before this change. Instead, all
that is mentioned is that the results of a given filter have to be pinned
to the color channel range (e.g. the last step).

Bug: skia:11007, skia:11057, skia:11153
Change-Id: I82e4a6f1742fecea59816fda75eb931c2a51d3e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355496
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-01-22 20:13:48 +00:00
Ben Wagner
2c73fc43a3 Roll freetype
40c5681ab9..60ba8fe9e7

FreeType has moved from git.sv.nongnu.org to gitlab.freedesktop.org.
Since the chromium.googlesource.com mirror has already been changed to
reflect this new url, use it as the new upstream.

Change-Id: Iac78b913d5a98f0fd8d082092f81ebdfda737972
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357281
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-01-22 20:09:59 +00:00
Mike Klein
d272110d71 update alloc_tmp() to allocate blocks of N regs
We now search for a block of N adjacent registers that minimizes the
number of spills, where unspillable registers are counted as if
infinitely expensive.

On arm64, store64 now uses alloc_tmp(2) and st2.4s, and similarly
store128 uses alloc_tmp(4) and st4.4s.

For the purposes of arm64 instructions we could allow the block to wrap
around the register file mod 32, but I figured that probably wasn't
necessary and might be confusing to follow.  If we're right on the edge
some day we could circle back.

I'm not sure yet if our register-pair use cases on x86-64 will ever care
that the registers are adjacent, but it doesn't hurt to start that way.

This should behave pretty much the same when N=1 except that we're not
doing any interesting tie-breaking when all registers are occupied.  I
left a TODO, but I bet we'll never feel the need to follow up on it.

Change-Id: Ibbdd42858a6daf61401c638435617bfb37d1899c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357300
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2021-01-22 19:54:08 +00:00
John Stiles
bfc9be0f77 Migrate SkSL test inputs to the resources/ directory.
This will allow us to load these inputs for unit testing in `dm`.

Change-Id: Id256ba7c30d3ec94b98048e47af44cf9efe580d5
Bug: skia:11009
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357282
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-01-22 18:57:29 +00:00
John Stiles
da57fc0854 Update skslc compiler script to allow for output path flexibility.
Previously, the script was hardcoded to use the input file's path, plus
"/golden/". In a followup CL, we are going to move the input files into
the resources/ directory but keep the output files in tests/, so we
needed additional flexibility here.

Change-Id: I8d5a78f6a8efd9a0e7f2a6d1ad8ad72a46cf70ce
Bug: skia:11009
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357280
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-22 18:14:03 +00:00
Kevin Lubick
6a272434c2 [docker] Fix build by pointing to correct path
Change-Id: I66ed32fc354a95e50ecaf68708f67592bda25b76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357296
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2021-01-22 17:34:56 +00:00
John Stiles
7938717797 Update folding tests to return pass/fail status.
A passing test returns solid green. Failing tests are written to
return solid red, but drawing any other color than green can be
interpreted as a test failure.

Additionally, tests which cannot compile as RuntimeEffects (due to
non-ES2-compatible features) have been split into an ES2-compatible part
and an ES3 part.

Change-Id: I3f53121d9de0ae4c4e7f1de3177d067811980b55
Bug: skia:11009
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356999
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-01-22 16:44:22 +00:00