Commit Graph

2552 Commits

Author SHA1 Message Date
Chris Dalton
981e4a756c Avoid recursion for (most) stroke tessellation patches
Adds quick accepts to the switch statement in
GrStrokeHardwareTessellator::prepare() that allow us to write out most
tessellation patches immediately. This avoids making function calls
into recursive methods as well as avoiding some of their checks that
aren't necessary the first time around.

Also adds a microbench that mimics the MotionMark "paths" benchmark
and measures our CPU-side prepare() time.

This shaves up to 30% off the microbenchmarks.

Bug: chromium:1172543
Change-Id: Idc93bebb79db9898a4ec241b1f6c8b9eb9ba7da3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372602
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-02-22 21:37:26 +00:00
Chris Dalton
ed82686819 Delete GrSTArenaList
The intent of this class was to abstract the internal linked list used
by GrStrokeTessellateOp, but it seems to just make things more
complicated. We have a need now to iterate the list with more freedom
than is offered by GrSTArenaList, so it seems best to just use a plain
C-style linked list instead.

Bug: chromium:1172543
Change-Id: Ia76be83c523bd3c285200099a529ccd3818490b6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/372656
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-02-22 20:56:27 +00:00
Chris Dalton
82094cdb9d Chain indirect stroke ops that have mismatched colors
The indirect tessellator can't combine overlapping, mismatched colors
because the log2 binning draws things out of order. But we can still
chain them together and generate a single long list of indirect draws.

Bug: chromium:1172543
Bug: skia:10419
Change-Id: Id7fc7488411a2a189e24cd7dd692e5c78497f498
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/370197
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-02-19 09:25:25 +00:00
Chris Dalton
1017a3558f Add a dynamic color attrib to hw tessellated stroking
Only adds color to the hardware tessellator. The indirect tessellator
reorders draws with is log2 binning, so we can't have different
colors.

Bug: chromium:1172543
Bug: skia:10419
Change-Id: I2a3700cd4572e8222002bfb028af05c6ec447708
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/369976
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-02-19 00:19:05 +00:00
Chris Dalton
42582fc97b Add dynamic stroke attribs to tessellated stroking
Allows us to batch together strokes that have different SkStrokeRecs.

Bug: chromium:1172543
Bug: skia:10419
Change-Id: I11dc01e60bc17a6bb3c3b635f9edb2944a2f2edc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/369579
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-02-18 19:35:25 +00:00
John Stiles
dbd4e6f0c0 Move ProgramKind and ProgramSettings types out of SkSL::Program.
This change will allow these types to be forward-declared; C++ doesn't
allow forward declaration of types declared inside a struct. Moving
these types out of Programs resulted in a large diff.

The Settings::Value helper class has been moved inside of the
IRGenerator. In practice, it was actually just an implementation detail
of how IRGenerator looks up caps-values by name. It seems very unlikely
that this will be necessary elsewhere going forward.

Change-Id: I6119417fae608f1c492a27de746d2b550ef8ca20
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/370836
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-02-16 19:30:48 +00:00
Brian Osman
4f065e286d Revert "Performance experiment: Disable SkSL optimization in nanobench/skpbench"
This reverts commit 5ad759065d.

Reason for revert: Experiment concluded - got the data we need.

Original change's description:
> Performance experiment: Disable SkSL optimization in nanobench/skpbench
>
> Change-Id: I974571e7e0e9d0170f92b970d425d9ce530e312e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/369716
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

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

Change-Id: I68bc07e8a604abb77fe9c1f1dac794ab7b90b9e9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/370156
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-02-13 01:06:13 +00:00
John Stiles
1f19ce2272 Reland "Remove deprecated form of SkRuntimeEffect::Make."
This reverts commit e89b50ae05.

Reason for revert: landed Android fix at http://ag/13544365 (master) and
http://ag/13554983 (sc-dev)

Original change's description:
> Android roll broke with a compilation error:
> frameworks/base/libs/hwui/jni/Shader.cpp:243:37: error: no matching function for call to 'get'
>     sk_sp<SkRuntimeEffect> effect = std::get<0>(result)
>
> Revert "Remove deprecated form of SkRuntimeEffect::Make."
>
> This reverts commit 1cda194366.
>
> Reason for revert: <INSERT REASONING HERE>
>
> Original change's description:
> > Remove deprecated form of SkRuntimeEffect::Make.
> >
> > Chromium has migrated to the new API at https://crrev.com/c/2675855.
> >
> > Change-Id: Id4af77db2c462348e8031d28f56e543ad619c19c
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367060
> > 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>
>
> TBR=mtklein@google.com,brianosman@google.com,johnstiles@google.com
>
> Change-Id: Ie18f865f3b7f5b0263db1e52b19cf6faa0500fdd
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368616
> Reviewed-by: Stan Iliev <stani@google.com>
> Commit-Queue: Stan Iliev <stani@google.com>

TBR=mtklein@google.com,brianosman@google.com,stani@google.com,johnstiles@google.com

Change-Id: I9d679013cb275dc80aaaa977b7f1f4da31f36d1e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/369037
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-02-12 20:57:50 +00:00
Brian Osman
5ad759065d Performance experiment: Disable SkSL optimization in nanobench/skpbench
Change-Id: I974571e7e0e9d0170f92b970d425d9ce530e312e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/369716
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-02-12 16:02:25 +00:00
Stan Iliev
e89b50ae05 Android roll broke with a compilation error:
frameworks/base/libs/hwui/jni/Shader.cpp:243:37: error: no matching function for call to 'get'
    sk_sp<SkRuntimeEffect> effect = std::get<0>(result)

Revert "Remove deprecated form of SkRuntimeEffect::Make."

This reverts commit 1cda194366.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Remove deprecated form of SkRuntimeEffect::Make.
>
> Chromium has migrated to the new API at https://crrev.com/c/2675855.
>
> Change-Id: Id4af77db2c462348e8031d28f56e543ad619c19c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367060
> 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>

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

Change-Id: Ie18f865f3b7f5b0263db1e52b19cf6faa0500fdd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368616
Reviewed-by: Stan Iliev <stani@google.com>
Commit-Queue: Stan Iliev <stani@google.com>
2021-02-10 00:05:10 +00:00
John Stiles
1cda194366 Remove deprecated form of SkRuntimeEffect::Make.
Chromium has migrated to the new API at https://crrev.com/c/2675855.

Change-Id: Id4af77db2c462348e8031d28f56e543ad619c19c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367060
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-02-09 21:27:34 +00:00
Herb Derby
55f795e696 introduce a subrun linked list
Create a simple linked list to sequence the subruns preparing
the way for a more focused allocator for managing subruns
at the end of the GrTextBlob.

Change-Id: I595e2ce2810d161332a23405e4615724d2953471
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/366957
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-02-05 20:48:34 +00:00
Tyler Denniston
04f471aa49 Add GrWangsFormula implementation for conics
Also add a unit test that the vectorized version equals the reference
implementation.

Bug: skia:10419
Change-Id: I4d165fd45532e9ec468565d0637fb769b51f5fcd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345122
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2021-02-04 20:07:28 +00:00
Chris Dalton
2224100b25 Create an abstract GrStrokeTessellator class
Now there is only one op to tessellate a stroke, and it creates its
own GrStrokeIndirectTessellator or GrStrokeHardwareTessellator
internally. This will allow us to dynamically switch into hardware
tessellation when we need to batch strokes that have different
parameters or colors.

Bug: chromium:1172543
Bug: skia:10419
Change-Id: I3cddb855fdbb9ab018785584497c843e3e31b75e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/366056
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-02-04 19:57:28 +00:00
Mike Reed
1de89c48c3 Don't use filter-quality
Bug: skia:11235
Change-Id: I184402f1c9d0f707ccfce761e3c5dbc3084e6c14
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362837
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-30 16:09:23 +00:00
Chris Dalton
e1314a391f Fix a ref on a temporary in benchmark_wangs_formula_cubic_log2
Change-Id: Ib68e8f918b7083d0b7934ffeb580fbf9b2a19032
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/362478
Auto-Submit: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-01-29 22:07:28 +00:00
Chris Dalton
ebb37e7db0 Rewrite GrPathTessellateOp as GrPathInnerTriangulateOp
Simplifies the op to always triangulate the inner fan. We ensure this
will always work by using breadcrumb triangles. Also removes the
fail-on-non-simple mode from GrInnerFanTriangulator since it isn't
being used anymore.

Bug: skia:10419
Change-Id: Idb849712bf2bc4e5ef785bc3f9b8db03119d230e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/359565
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2021-01-28 18:34:39 +00:00
Mike Reed
039f1367ae filter-quality is deprecated, pass sampling to drawImage
Bug: skia:7650
Change-Id: Ifd92705bd042db74a6c2527858239b0b8e5a4def
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360981
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-28 03:22:51 +00:00
Chris Dalton
330cfa44ac Make GrTriangulator immutable
Marks its methods const and lifts the breadcrumb list out into
function arguments. This is one more step toward the final vision
where GrTriangulator just has an allocator and control knobs, and
everything else is functional.

Bug: skia:10419
Change-Id: I77341c045d481da49ebfee06de5dfc7a2a8a07be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360956
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-01-28 02:38:51 +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
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
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
Brian Osman
ce75036b3e SkSL: Remove ByteCode interpreter, generator, etc.
Change-Id: Ib150e6d6d3de34a85ce8051eea843ab3b2d7ab75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/356921
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2021-01-22 14:38:41 +00:00
Mike Reed
e02d7f844b More hiding of legacy drawImage calls
Also cleanup some of the duplicate code in SkRecords

Bug: skia:7650
Change-Id: I4d3167a892c126c19a54002beab25c9a6c96fa5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357000
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-22 13:53:42 +00:00
Chris Dalton
e465205938 Remove the offthread triangulation from GrPathTessellateOp
Rather than copying these triangles twice, we can run "pathToPolys"
during onPrePrepare and "polysToTriangles" during onPrepare.

Also adds a benchmark for normal and inner-fan triangulation.

Bug: skia:10419
Change-Id: Id301afde5de11d93ae026e75e42ac03a50867687
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355177
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-01-22 03:59:29 +00:00
Chris Dalton
d7177438a9 Extract some GrPathTessellatoOp logic into virtual helper classes
This reduces complexity and will also allow us to add new ops that
take advantage of this same core logic.

Bug: skia:10419
Change-Id: I4ec8717a6d9510dea967d11467eeea0b5b7c7f4c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354296
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-01-19 20:23:56 +00:00
Mike Reed
2ac6ce8e6e Simplify common case for recttorect
Change-Id: I70e295a677b8cac3d578e3cd57472c833af03877
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354336
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-15 18:37:46 +00:00
Mike Reed
5ec22387ff Simplify common case of linear filtering with no mips
Change-Id: I08b4a7bc088705b93a0aa680f6733d09c7ad23dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354221
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-15 16:47:16 +00:00
Chris Dalton
ad48280dd0 Avoid uninitialized values in strokeIndirect SIMD queues
Bug: skia:10419
Change-Id: Ia4bf6fce06e69163a50e80e56f82bfd0f8b00072
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347138
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-12-28 17:01:19 +00:00
Mike Reed
dc607e35e1 Use bitmap.asImage()
Change-Id: Ie16194937530d7cd75f84d9af66c31b77875ef83
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347043
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-23 17:41:47 +00:00
Mike Reed
839eef3e9a Work on hiding filter-quality
SkPaintPriv methods are just an internal stopgap

Change-Id: Ibe6e37c5871068d8cd67dc0948961444dfd2b62a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347041
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-23 17:05:17 +00:00
Brian Salomon
8f7d95382e Remove public getter for GrSurfaceDrawContext on SkSCanvas.
Made it private and accessible internally via SkCanvasPriv.

Update SkGpuDevice methods/variables after rename of GrDrawSurfaceContext.

Cq-Include-Trybots: luci.skia.skia.primary:Canary-G3,Canary-Flutter,Canary-Android
Change-Id: I3da64cee1de03c201243ee6c7ccd4b4c44cad8c9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346498
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-12-23 16:13:07 +00:00
Mike Reed
ac9f0c9e27 Bitmap.asImage()
... and lots and lots of IWYU

Change-Id: Ie5157dcdd2e6d29b95c71b39153278ab48ef4eb3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346778
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-23 15:54:57 +00:00
Brian Osman
9194675a3e SkSL: In the front-end, rename PipelineStage to RuntimeEffect
This maps to usage better, and makes some code simpler to understand.
Note that there is still a PipelineStage *back-end*, which is specific
to the runtime-effect FP. A kRuntimeEffect_Kind program can be used to
generate a PipelineStage (for the GPU backend), or an skvm program (for
the CPU backend).

Change-Id: Id3f535db93a239726c595225aafe9467f0d19817
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344969
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-12-21 21:23:17 +00:00
Mike Klein
0047afffb0 remove very oldest SkVM testing
None of these earliest testing tools are useful anymore
now that we can do useful work with SkVM and SkVMBlitter.

Change-Id: I8b25ef6ddd101c4ff8617c6742343dedb4764922
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345456
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-12-17 21:17:46 +00:00
Chris Dalton
15f51848df Reland "Disable HW tessellation shaders by default"
This is a reland of ad8b9fa2d7

Original change's description:
> Disable HW tessellation shaders by default
>
> The GLSL backdoor for tessellation shaders is only experimental at
> this point. In order to enable the tessellation path renderer, we need
> to turn off HW tessellation and let it use the indirect draw modes.
>
> Bug: skia:10419
> Change-Id: Ic979978a331c7ad016907cf42b2562b35caab8ab
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344336
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com
Bug: skia:10419
Change-Id: I0bdf34da134a3a34a5c78b35cc0eb86d6e989bb4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344796
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-12-16 05:08:25 +00:00
Mike Klein
f124108e23 how to use SkArenaAlloc with no friends
No more

    friend class ::SkArenaAlloc; // for access to ctor

Change-Id: I76fa3319498a965623e6865b75d1fb507ab845a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344236
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2020-12-15 01:23:18 +00:00
Mike Reed
057fcbec5d Use sampling for bitmap shaders
Change-Id: Ifa656ffc83a1adb5670cff1e2ce77f2edb1d6b03
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343776
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-12 20:10:41 +00:00
Mike Reed
82abeceef9 Bitmap should use sampling options
Change-Id: I611969d4707009411f20b74debad7655ac364eb8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343596
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-12-12 15:36:21 +00:00
Brian Salomon
eebe735dea GrRenderTargetContext->GrSurfaceDrawContext
Just the class/files. variable names and additional comments to follow.

Change-Id: Ic03d07fd5009eaf3d706c2536486a117328963fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342617
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2020-12-10 18:51:19 +00:00
Chris Dalton
c2a1746b42 Implement stroke tessellation with indirect draws
Adds a vertex shader that maps a variable-length triangle strip to a
stroke and its preceding join. Adds a new op that generates stroke
instances from a path, bins them by log2 triangle strip length (using
SIMD for the calculations), and renders them with indirect draws.

Bug: skia:10419
Change-Id: I6d52df02cffe97d14827c6d66136957f1859f53b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339716
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-12-10 00:25:17 +00:00
Mike Reed
99c944647f Add flag to hide non-sampling imageshader factories
Bug: skia:11056
Change-Id: Ic79876106c003f6061cbb50ad2f4a4bf4f446231
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341681
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-08 20:33:23 +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
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
Herb Derby
40894189c8 hoist the common matrix code for filling vertices
Change-Id: Ic10a5b8d7c41b17de097385a0264e5379acc9687
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340136
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-12-02 17:36:06 +00:00
Herb Derby
46d1e9f5f2 remove use of initial matrix
This was just wrong. It should be determine perspective
using the matrix that we are drawing with, and not the initial
matrix.

Change-Id: I8410ced714d2c766305656bdbd797f9dea59b71e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339796
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2020-12-01 20:11:24 +00:00
Brian Salomon
70fe17e12f Remove GrRenderTargetContextPriv and GrSurfaceContextPriv
I think this is vestigial from some time in the past where RTC was
public.

Also just expose the methods that add ops rather than have so many
friends + testingOnly versions.

Change-Id: I60d9fdff23b2d67039a7b37815da7ff9e73d8999
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339158
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-11-30 20:13:25 +00:00
Herb Derby
d90024d498 split subrun API into Blob and Op interfaces
Instead of using sub classing to generate the atlas API, give
the atlas portion its own interface. Then the atlas subrun
variants can subclass both interfaces.

Change-Id: I8a0ca3d19bd362877224fa64f6c49a5f50d0ceb5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336958
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-11-21 02:24:07 +00:00
Mike Reed
a03f8bf837 other ways to organize samplingoptions?
do not land

Change-Id: I5fa7b2a0d1eb7e893d9b333f850a2f515d7ce065
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336956
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-11-21 02:00:26 +00:00
Robert Phillips
2c21a11923 Remove uses of SkCanvas::flush
afaict the perf surprises associated with:

https://skia-review.googlesource.com/c/skia/+/334417 (Remove SkBaseDevice::flush)

were bc Ganesh resolves MSAA buffers for SkCanvas::flush but doesn't do so for GrDirectContext::flush.

Where possible this CL switches SkCanvas::flush to SkSurface::flush (which will also resolve MSAA buffers) so that when https://skia-review.googlesource.com/c/skia/+/334417 relands there should not be any performance surprises.

Change-Id: I705ad6219f0f625a88cf3f9e8b2418a3182d298c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335866
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Adlai Holler <adlai@google.com>
2020-11-20 21:42:38 +00:00