Commit Graph

51247 Commits

Author SHA1 Message Date
Brian Osman
8b43dadea2 In SPIRVCodeGenerator, use the Program's ModifiersPool
We were passing in the IR generator's which had already been reset, so
technically belonged to the *next* Program to be compiled.

Change-Id: Ib68c283591f02d1642bb7c2d9658f5caa76b0f15
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324700
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2020-10-09 18:45:43 +00:00
Chris Dalton
141d35cdec Simplify the inflection/rotation finding math for stroke tessellation
Bug: skia:10419
Change-Id: I7754a1f19eea8630db3ede29e1ee7c79a53091bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322041
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-10-09 18:44:14 +00:00
Michael Ludwig
7563a48787 Revert "SkDevice::drawSpecial accepts arbitrary matrix v2"
This reverts commit 7c4aca04cc.

Reason for revert: cc unit tests need to be rebased

Original change's description:
> SkDevice::drawSpecial accepts arbitrary matrix v2
>
> This opens up the door to render image filter results with an arbitrary
> matrix, so we can skip the matrix filter DAG hack. It should also let
> me simplify the handling of backdrop image filters and correctly apply
> perspective to image filters.
>
> This is essentially the same as
> https://skia-review.googlesource.com/c/skia/+/317862
> but not parented to the CL that experimented with SkImagePaint.
>
> Some of the function declaration re-org that was done in its prior CL
> has been directly integrated into this CL.
>
> Bug: skia:9545
> Change-Id: Iad882bd306f3a4064fe60cfc0526226287ea7e29
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323597
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,robertphillips@google.com,reed@google.com,michaelludwig@google.com

Change-Id: I6a248fe9e02d71fa340ed3227e77fff097b7b08e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9545
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324704
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-10-09 17:58:45 +00:00
Brian Salomon
60003f776a Use BackendSurfaceFactory in Vk protected unit tests.
Automatically handles cleanup of backend objects.

Removes use case of MakeFromBackendTextureAsRenderTarget.

Bug: skia:9832
Change-Id: I27c2b4cae713bd605a662d38b797fd25c1add98e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324119
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-10-09 17:54:03 +00:00
Kevin Lubick
ffc20c2764 [canvaskit] Clean up some APIs related to Path factories
These were uncovered during the recent documentation fiesta.

This also adds a test for the previously untested
CanvasKit.Path.MakeFromOp API.

Bug: skia:10717
Change-Id: Icd3d31ec0f8d61bd399e76abdbf7b5c6395c4d85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324626
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-10-09 17:42:47 +00:00
John Stiles
efe767da91 Improve performance of SymbolTable lookups.
This CL introduces two significant changes:
- unordered_map is replaced by SkTHashMap.
- The StringFragment key is replaced by a SymbolKey class, which caches
  the hash of the string.

The second change is responsible for the lion's share of the measured
performance improvement. SymbolTable::operator[] was previously re-
hashing the string every time it recursed into the parent symbol table.

Nanobench shows a fairly consistent ~8% speed improvement in both
sksl_medium and sksl_large: http://screen/3KTc27gt85HS4wK

Change-Id: Ia1010dcd40d7f7ecdce1aa5bb10c6cf6f6f11a80
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324628
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-10-09 17:39:34 +00:00
John Stiles
118706a806 Improve codegen for gradients.
Replacing `sk_OutColor = x` with `return x` in single-exit FP functions
results in fewer scratch variables in the final post-inliner output.

Change-Id: I81c081a78d0fb7dfad5230e3044027901673236c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324377
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-10-09 17:39:33 +00:00
Greg Daniel
f52bca1069 Suppress another version of the vulkan validation error.
Need the indexed version of the draw as well

Change-Id: I0b11687be1bb6126d963eb6ce99879525df2603f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324697
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-10-09 17:27:33 +00:00
Ethan Nicholas
7a95b20733 moved SkSL FieldAccess data into IRNode
Change-Id: Ib2fd8c246799a1bde566395080fe6617754644f9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324635
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-10-09 16:58:33 +00:00
Adlai Holler
a7a404473c Migrate abandonment & reset methods to GrDirectContext
This is pretty much just cutting & pasting the code naïvely,
but it's the safe way to go so that we don't impact the
order of events during this housekeeping.

Change-Id: I8d9f2ffb560b34fd1a8d9603174ff1f17803e447
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324619
Commit-Queue: Adlai Holler <adlai@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-10-09 16:16:43 +00:00
Ethan Nicholas
453f67ff0a SkSL enum changes
Changed a couple of SkSL enums to enum classes and rearranged things to
make their storage within IRNode type safe.

Change-Id: I6509d027d79161c1a09473e90943aae061583f20
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324624
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-10-09 15:54:13 +00:00
Greg Daniel
e70a30d46f Suppress vulkan validation layers bug.
This is a bug in the layers related to input attachments.

Change-Id: I1e44c45ce44bea79e7078836150237a6c63cbb36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324625
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
2020-10-09 15:37:54 +00:00
Ethan Nicholas
444ccc6e59 more SkSL IRNode refactoring
Prefix, Postfix, and ExternalFunctionCall nodes this time around.

Change-Id: I56bc06d73274f01b67f043a6ebd23dd4c80d16e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324621
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-10-09 15:22:33 +00:00
Greg Daniel
70dd6a9c1e Make sure the normal GrProgramDesc handles input attachment key.
Currently the entire GrVkPipeline does handle correctly keying if the
pipeline is using an input attachment since it is part of the render
pass key. However, using an input attachment does change the shader
and this was not getting reflected in the GrProgramDesc which is what is
used for caching spirv in the persistent cache. Thus we were having
errors switching msaa on and off since without msaa we use input
attachment but with msaa we used a copy. They were finding eachothers
spirv in the persistent cache.

Change-Id: I3200d6f640761ec1b1cd32e563b7c8be8e6a8481
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324477
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-10-09 15:13:53 +00:00
Michael Ludwig
7c4aca04cc SkDevice::drawSpecial accepts arbitrary matrix v2
This opens up the door to render image filter results with an arbitrary
matrix, so we can skip the matrix filter DAG hack. It should also let
me simplify the handling of backdrop image filters and correctly apply
perspective to image filters.

This is essentially the same as
https://skia-review.googlesource.com/c/skia/+/317862
but not parented to the CL that experimented with SkImagePaint.

Some of the function declaration re-org that was done in its prior CL
has been directly integrated into this CL.

Bug: skia:9545
Change-Id: Iad882bd306f3a4064fe60cfc0526226287ea7e29
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323597
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-10-09 14:56:43 +00:00
Brian Osman
3d87e9f660 Reorganize how SkSL includes are parsed and stored
This binds together the IntrinsicMap and SymbolTable for each include to
a single entity, with helper functions that create and return them. Used
a little bit of macro trickery to move all of the standalone/runtime
logic into loadIncludeFile, which drastically reduces boilerplate.

Change-Id: Ic70c0d67967cc614daeab5c50412ab69dcdf2fea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324124
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-10-09 14:49:43 +00:00
John Stiles
6f3015a562 Reland "Add sk_Caps.builtinDeterminantSupport and use it in cross()."
This is a reland of 6bbf026b54

Original change's description:
> Add sk_Caps.builtinDeterminantSupport and use it in cross().
>
> This CL partially relands http://review.skia.org/321790.
>
> Change-Id: I26a1aefda8a01167783e6e7fa15a51aa35ee5d82
> Bug: skia:10819, skia:10810
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323784
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

Bug: skia:10819
Bug: skia:10810
Change-Id: I7731f93db07bc917707cbbe1daca2e5ce0f763d7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324620
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-10-09 14:45:23 +00:00
Adlai Holler
9555f2934d Reland "Merge GrContext::init into GrDirectContext ..."
This reverts commit e9b9c3bd7f.

Reason for revert: Fixed MSVC

Original change's description:
> Revert "Merge GrContext::init into GrDirectContext ..."
>
> This reverts commit 48d8724097.
>
> Reason for revert: Breaking MSVC bots
>
> Original change's description:
> > Merge GrContext::init into GrDirectContext ...
> >
> > And minor cleanups associated with the initialization of these classes.
> >
> > Change-Id: Ida0372d0b1a0b8bf5b309814de5418e47ea34fdb
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324122
> > Commit-Queue: Adlai Holler <adlai@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Auto-Submit: Adlai Holler <adlai@google.com>
>
> TBR=robertphillips@google.com,adlai@google.com
>
> Change-Id: I00b2ddaeaef53e3fe05a338c88158cf235f325c4
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324132
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>

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


Change-Id: I88bac7cd3aab070460671e82cbd924fbb42a2740
Cq-Include-Trybots: luci.skia.skia.primary:Build-Win-MSVC-x86_64-Release-Shared,Build-Win-Clang-x86_64-Release-Shared
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324616
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-10-09 14:42:43 +00:00
John Stiles
eaaa71b705 Add test for sk_Caps.mustGuardDivisionEvenAfterExplicitZeroCheck.
Change-Id: Ib1374e1dce1a654a83813dbe341774bd91729796
Bug: skia:10694, skia:10819
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324356
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-10-09 13:48:13 +00:00
John Stiles
8f84cee9ab Add test for sk_Caps.inBlendModesFailRandomlyForAllZeroVec.
This CL also alphabetizes the various factories in ShaderCapsFactory.

Change-Id: I0378ceb821678173e72690d5563d2a9a92d90201
Bug: skia:10694, skia:10819
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324257
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-10-09 13:44:43 +00:00
John Stiles
658ae8fc6a Reland "Put top level FPs into their own functions"
This reverts commit a8486d10e0.

Reason for revert: several performance issues have been fixed

Original change's description:
> Revert "Revert "Revert "Put top level FPs into their own functions"""
>
> Flutter saw a substantial perf regression:
> https://github.com/flutter/flutter/issues/62447
>
> This reverts commit 7a96c2a6bb.
>
> Change-Id: Ib7d73f2df429508d85f9681eb2f0afd84917772e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307782
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

Change-Id: Ie42ff7d5aff0a95f4533a31d60eac25c83b6defa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324376
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-10-09 13:20:03 +00:00
Ethan Nicholas
2a4952dcce refactored more SkSL IRNodes
Change-Id: Iab04e4915715bad56b795993022b24a137339daf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324125
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-10-09 13:17:33 +00:00
Greg Daniel
c0d6915389 Reland "Rename GrStencilAttachment class to generic GrAttachment"
This is a reland of 6113d50ec4

Original change's description:
> Rename GrStencilAttachment class to generic GrAttachment
>
> Additional this adds a UsageFlags member to the new GrAttachment
> class.
>
> Bug: skia:10727
> Change-Id: Ifc0bfffd959f5fbc46bfcdf269e1b2a933929753
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323107
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

Bug: skia:10727
Change-Id: Ie0ff0885e01c9f0666fb0cfaa765e463dcc6d0a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324277
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-10-09 11:59:23 +00:00
skia-autoroll
aa8c461786 Roll Chromium from af82ff2606e9 to 4a368eae5a6f (468 revisions)
af82ff2606..4a368eae5a

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 jvanverth@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: jvanverth@google.com
Change-Id: Ib54ae51abc5f617e070f89003fc1567e1718aa92
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324338
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-10-09 04:56:13 +00:00
skia-autoroll
df9bf325e4 Roll SwiftShader from 5f4e70b81046 to 952149303d06 (1 revision)
https://swiftshader.googlesource.com/SwiftShader.git/+log/5f4e70b81046..952149303d06

2020-10-08 bclayton@google.com SpirvShaderDebugger: Have Function inherit LexicalBlock

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 jvanverth@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: jvanverth@google.com
Change-Id: Ic2ab37a61b7c330982bd1a38a2ccc40cfb193a68
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324339
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-10-09 04:55:13 +00:00
skia-autoroll
0f82612ca5 Roll Dawn from 6b4a4a85dfd7 to 793a07e36636 (12 revisions)
https://dawn.googlesource.com/dawn.git/+log/6b4a4a85dfd7..793a07e36636

2020-10-08 senorblanco@chromium.org Fix MSVC build of SerialStorage.h.
2020-10-08 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 6d6aed546061 to 4311dd05c883 (1 revision)
2020-10-08 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from f600d3aa9f26 to 6d6aed546061 (1 revision)
2020-10-08 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from c169506c9e6e to f600d3aa9f26 (1 revision)
2020-10-08 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from eb5d3e147d39 to c169506c9e6e (2 revisions)
2020-10-08 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 71d69e5ed3f4 to eb5d3e147d39 (1 revision)
2020-10-08 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 5118c0726106 to 71d69e5ed3f4 (1 revision)
2020-10-08 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 1a63c49b4e86 to 5118c0726106 (1 revision)
2020-10-08 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 007dc42cbb43 to 1a63c49b4e86 (1 revision)
2020-10-08 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from fc5c5ab60b22 to 007dc42cbb43 (1 revision)
2020-10-08 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 66377ce9be54 to fc5c5ab60b22 (1 revision)
2020-10-08 dawn-autoroll@skia-public.iam.gserviceaccount.com Roll Tint from 28ae1471bf2c to 66377ce9be54 (1 revision)

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 kainino@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: kainino@google.com
Change-Id: Ibc9050f325dc649d6d14dbf77891fec1b0478d09
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324396
Reviewed-by: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: skia-autoroll <skia-autoroll@skia-public.iam.gserviceaccount.com>
2020-10-09 04:44:03 +00:00
Jim Van Verth
2ae1dd93d8 Revert "Add sk_Caps.builtinDeterminantSupport and use it in cross()."
This reverts commit 6bbf026b54.

Reason for revert: Breaking Metal bot.

Original change's description:
> Add sk_Caps.builtinDeterminantSupport and use it in cross().
>
> This CL partially relands http://review.skia.org/321790.
>
> Change-Id: I26a1aefda8a01167783e6e7fa15a51aa35ee5d82
> Bug: skia:10819, skia:10810
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323784
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

TBR=csmartdalton@google.com,johnstiles@google.com

Change-Id: I4a6c1a63dc38682dd965f78f0c1da98f35b6dbad
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10819
Bug: skia:10810
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324264
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-10-09 00:12:34 +00:00
Brian Osman
1179fcf5ed Remove custom iterators from SkSL::Program
Instead, just expose the vector directly (as elements()).

Change-Id: I9f6a3ae38cd8e6f1b0a1087a42d61452fe883924
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324130
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-10-09 00:07:22 +00:00
Jim Van Verth
99b1a8b2f8 Revert "Rename GrStencilAttachment class to generic GrAttachment"
This reverts commit 6113d50ec4.

Reason for revert: Breaking MSAN bot

Original change's description:
> Rename GrStencilAttachment class to generic GrAttachment
>
> Additional this adds a UsageFlags member to the new GrAttachment
> class.
>
> Bug: skia:10727
> Change-Id: Ifc0bfffd959f5fbc46bfcdf269e1b2a933929753
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323107
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I2ee2a1fcabd75bc24d3b7c3f76d971a3adb370a3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10727
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324276
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-10-08 23:52:34 +00:00
John Stiles
6bbf026b54 Add sk_Caps.builtinDeterminantSupport and use it in cross().
This CL partially relands http://review.skia.org/321790.

Change-Id: I26a1aefda8a01167783e6e7fa15a51aa35ee5d82
Bug: skia:10819, skia:10810
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323784
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-10-08 22:51:15 +00:00
Michael Ludwig
7d0f853158 Add SkImageFilters::Shader in place of Paint factory
SkImageFilters::Paint did not use every slot of the SkPaint, with only
its color, alpha, color filter, and shader having a meaningful effect on
the image filter result. It was always blended into a transparent dst,
so blend mode wasn't very relevant, and it was always filled to whatever
required geometry, so stroke style, path effect, and mask filters were
ignored or not well specified.

Color, alpha, and color filter can all be combined into an SkShader, so
a more constrained SkImageFilters::Shader provides the same useful
capabilities without as many surprises.

SkImageFilters::Paint still exists, but is deprecated to be removed
once I've confirmed clients aren't depending on it.

Bug: skia:9310
Change-Id: I11a82bda1a5d440726cf4e2b5bfaae4929568679
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323680
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2020-10-08 22:51:13 +00:00
Michael Ludwig
30378382aa Clip perspective bounds by device clip in SkPDFDevice
Bug: skia:9906
Change-Id: Ib0369e0637be2a064f4d17e0f5ae41e99883c41e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324129
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
2020-10-08 21:10:02 +00:00
Jim Van Verth
e9b9c3bd7f Revert "Merge GrContext::init into GrDirectContext ..."
This reverts commit 48d8724097.

Reason for revert: Breaking MSVC bots

Original change's description:
> Merge GrContext::init into GrDirectContext ...
>
> And minor cleanups associated with the initialization of these classes.
>
> Change-Id: Ida0372d0b1a0b8bf5b309814de5418e47ea34fdb
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324122
> Commit-Queue: Adlai Holler <adlai@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Auto-Submit: Adlai Holler <adlai@google.com>

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

Change-Id: I00b2ddaeaef53e3fe05a338c88158cf235f325c4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324132
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-10-08 21:00:36 +00:00
Jim Van Verth
4b3d1f3900 Add push constant support to GrCaps.
Change-Id: I2ef63443a68f3ebc31c7f9ad1e614b320be3e673
Bug: skia:5039
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324121
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-10-08 20:58:32 +00:00
Adlai Holler
48d8724097 Merge GrContext::init into GrDirectContext ...
And minor cleanups associated with the initialization of these classes.

Change-Id: Ida0372d0b1a0b8bf5b309814de5418e47ea34fdb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324122
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
2020-10-08 20:39:22 +00:00
Brian Salomon
f9b0042423 Expose ManagedBackendTexture from BackendTextureImageFactory.
Add helper to create self-managed BackendTexture-backed SkSurface for
tests using MBET.

GrGpu::createTestingOnlyBackendRenderTarget supports protected.

Make SkSurfaceCharacterization tests use self-managed SkSurface
factories and a use case of MakeFromBackendTextureAsRenderTarget is
removed.

Use self-managed BackendTexture-backed SkSurface factory in DM sinks and
in fm.

Bug: skia:9832

Change-Id: I0c1dc49697f8b3c942864e18b9112a3552f431ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323559
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-10-08 20:35:32 +00:00
Kevin Lubick
a96e080962 [canvaskit] Attempt to turn off rtti
This removes a little bit of hackery in paragraph bindings
that was needed to work around rtti and virtual methods
and embind.

Bug: skia:10794
Change-Id: I5ed15e805105bed866b9d6ebc0de1f70823d35ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324057
Auto-Submit: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-10-08 20:21:39 +00:00
John Stiles
0743dc187a Use SkSTArray to track CFG exits instead of std<set>.
This improves SkSL compile times by about 1-2%.
Nanobench: http://screen/BL5kKgwzEzTNqSu

Change-Id: I85df42bdd33cfce13345f11d588283eeaf5643d0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324061
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-10-08 20:08:12 +00:00
Ethan Nicholas
e17b050196 add missing <atomic> include
TBR=brianosman@google.com, johnstiles@google.com

Change-Id: I03f771b39acbeba3d25da97d759ad2f9a8f6f5d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324123
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2020-10-08 19:43:12 +00:00
Greg Daniel
6113d50ec4 Rename GrStencilAttachment class to generic GrAttachment
Additional this adds a UsageFlags member to the new GrAttachment
class.

Bug: skia:10727
Change-Id: Ifc0bfffd959f5fbc46bfcdf269e1b2a933929753
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323107
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-10-08 19:40:32 +00:00
Julia Lavrova
69f3cab837 Changing the way we select a grapheme
Selecting only graphemes that are fully inside the
[start:end) range. Hopefully, it's a temporary
solution to simplify SkParagraph vs TxtLib comparison.

Change-Id: Iebc74fb4ae20c232bfae762a04e45f0979cf6236
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322438
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-10-08 19:02:12 +00:00
John Stiles
e1589a1e19 Add line breaks to make dehydrated files more merge-friendly.
Change-Id: Ica329608e5ee7f873a55dc27e6c14bb8734665a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324118
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2020-10-08 18:55:02 +00:00
Stephen White
e895cdc716 Dawn: implement mipmap generation.
Dawn does not support automatic mipmap generation, so use mip-to-mip
downsampling.

Change-Id: I71e1808d78f45eee68df7f124100f5b563f29da3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319736
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@google.com>
2020-10-08 18:50:02 +00:00
Adlai Holler
1fc76ce6ff Migrate more Android & SkSurface API off GrContext
Migration should be free because (1) the non-Android API is
only loosening up to GrRecordingContext and (2) the Android API
can only see GrContext through including GrDirectContext.h

Change-Id: I97aa75baba0b0969361db6eaef9f83ea94183700
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323557
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-10-08 18:32:32 +00:00
Kevin Lubick
adbd312a46 Fix debugger to work with new emsdk
Change-Id: I53fcf34e42604322f9e285de2bae4e37ccc60f6d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324120
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-10-08 18:08:06 +00:00
Michael Ludwig
a1d668d24c Adjust w0 clipping plane distance
Confirmed that this avoided the too-aggressive clipping on the web pages
linked in chromium:1136046 and chromium:1128636

Bug: skia:9906
Change-Id: Id34233b8d7fc76bd80b43d3112c5073b240e6109
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323980
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2020-10-08 17:54:32 +00:00
Robert Phillips
d464feb1fc Rename GrThreadSafeUniquelyKeyedProxyViewCache
Once triangulated paths are added this will no longer just be storing proxy views.

Bug: 1108408
Change-Id: I82fa47b0b85f738d9a25330c29bc2892c9bfeda4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323999
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-10-08 17:39:12 +00:00
Kevin Lubick
2c08814f36 [pathkit] update to build with emsdk 2.0.6
Change-Id: I8df13d592abcd7e2b396250293b57037d2b4b774
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324117
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2020-10-08 17:26:32 +00:00
Ethan Nicholas
01ec7e8ec7 moved SkSL Setting data into IRNode and fixed its dehydration/rehydration
Change-Id: Ide129334989890961a46681129672682cf826915
Bug: skia:10819
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323978
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-10-08 17:23:47 +00:00
Mike Klein
ba835bba45 tidy up SkTHash special methods
Like the destructors, most of these can just go unspoken.

SkTArray only knows its size in Debug builds, so it can't easily grow a
copy constructor.  Instead just keep the explicit copies and moves on
SkTHashTable, and mark the others as explicitly default.  I inverted the
pattern from assign-by-copy to copy-by-assign, but it's all basically
the same.

Change-Id: I0df552ef547ce9c7e232267c072a5f3b09197847
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/324056
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2020-10-08 17:20:22 +00:00