Commit Graph

2735 Commits

Author SHA1 Message Date
Brian Osman
985403a274 Update SkSL benchmarks to use currently generated shaders
Things have evolved since these were last updated. In particular, we no
longer emit binding and set decorations for each individual uniform.
Backends that rely on that (SPIRV, Metal), generate SkSL that has all
the uniforms grouped in a buffer. GLSL emits the uniforms with no layout
qualifiers. SPIRV supported this already (and automatically applied the
default binding/set to the implicitly created uniform buffer). Metal
*almost* supported this - it handled the uniform buffer correctly, but
didn't apply the default binding to any un-decorated samplers.

Bug: skia:12670
Change-Id: I7b193b89f86441344cf7ad5b7ed5e07451a1cc6d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/475157
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-11-23 18:01:08 +00:00
Chris Dalton
fc0941003e Move tessellation-specific functions out of GrPathUtils
Bug: skia:12524
Change-Id: I2664c8ea707a40724bcf916e907fe28d1fa276d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474357
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-11-20 02:47:40 +00:00
Chris Dalton
5cf4ed47f4 Move Ganesh-specific bits of StrokeTessellator into an #ifdef
Bug: skia:12524
Change-Id: I31ddee40fed6e57caafe7a51fdd90459bd29cd6a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474356
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-11-20 02:35:39 +00:00
Brian Salomon
90ef83af20 Remove drawPatch/Vertices helpers that don't take SkBlendMode
Bug: skia:12662
Change-Id: Ic18220668a4f87e7340a53b3f191887a7a016a04
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473141
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-11-18 21:57:32 +00:00
Herb Derby
dd7540fccb make drawMatrix use more explicit
Make the code more consistent with:
* drawMatrix - CTM from canvas
* drawOrigin - x, y from drawTextBlob
* positionMatrix drawMatrix adjusted by drawOrigin

Change-Id: Ia22baa2d229f041b77dc6cde063e25f185b8b64a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473237
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-11-18 20:57:32 +00:00
Chris Dalton
9aca7f7dd0 Yank GrStrokeTessellationShader out of StrokeTessellators
Bug: skia:12524
Change-Id: I208f257bca46c8fcb15cf58baea4c3e058310327
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/471216
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-11-15 17:07:38 +00:00
Chris Dalton
b339d59fdb Fold GrStrokeTessellationShader::ShaderFlags into PatchAttribs
Bug: skia:12524
Change-Id: I74ead0583a7b14822201e47bd40791c86a4caa91
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/470514
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-11-15 16:48:45 +00:00
Chris Dalton
09ece934af Move breadcrumb and inner-fan triangles out of PathCurveTessellator
The callsites output these triangles now. This removes the final
direct Ganesh dependency from the tessellator code.

Bug: skia:12524
Change-Id: Id0d16839ed35a2bd9a812b8747ca8669fac5bed8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/470196
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-11-12 15:26:51 +00:00
Chris Dalton
f0f447c2f0 Yank GrPathTessellationShader out of PatchTessellators
The tessellators are now agnostic of the shader class, which makes
them mostly usable by Graphite now. Also moves the code for writing
the middle-out vertex and index buffers into the PatchTessellators,
which makes sense since they also write the instance buffers.

Bug: skia:12524
Change-Id: I6c415645e389e056c0db1d93663b1b295d6b4535
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469631
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-11-11 22:28:40 +00:00
Chris Dalton
08a971126e Reland "Implement batching for convex tessellated paths"
This is a reland of 9613060bdf

Original change's description:
> Implement batching for convex tessellated paths
>
> Moves the view matrix transformation onto the CPU (when local coords
> are not used), and plumbs a color attrib through the tessellation
> patches.
>
> Bug: skia:12524
> Change-Id: Ic4740048b4fc85cb18e7235a7754d57762db3daf
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/468997
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

Bug: skia:12524
Change-Id: I77cd079d8921b224925bd2f7364c564822886d61
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/470436
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-11-11 20:01:40 +00:00
Robert Phillips
954e81a170 Revert "Implement batching for convex tessellated paths"
This reverts commit 9613060bdf.

Reason for revert: assertion failure on ANGLE

Original change's description:
> Implement batching for convex tessellated paths
>
> Moves the view matrix transformation onto the CPU (when local coords
> are not used), and plumbs a color attrib through the tessellation
> patches.
>
> Bug: skia:12524
> Change-Id: Ic4740048b4fc85cb18e7235a7754d57762db3daf
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/468997
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

TBR=egdaniel@google.com,robertphillips@google.com,csmartdalton@google.com,michaelludwig@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: Ie086376656777bb167075a9822d8c702cc7e41ec
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:12524
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/470296
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-11-11 13:30:09 +00:00
Chris Dalton
9613060bdf Implement batching for convex tessellated paths
Moves the view matrix transformation onto the CPU (when local coords
are not used), and plumbs a color attrib through the tessellation
patches.

Bug: skia:12524
Change-Id: Ic4740048b4fc85cb18e7235a7754d57762db3daf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/468997
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-11-11 00:34:00 +00:00
Herb Derby
54c496ba2c use SkStrikeSpec in remote and main strike cache
* Remove the SkDescriptor from SkScalerCache where it is never really
  used.
* Have SkStrike hold the descriptor
* Add a method to the SkStrikeSpec to create SkScalerContexts

Flow all the parameter changes through the code.

Change-Id: I11f2eec590b509eef0396b9288a6297fbe967dff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/468457
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-11-08 15:19:52 +00:00
Chris Dalton
f207db2dce Rename PathXform to AffineMatrix
Also removes the path-specific functions now that it only maps points.

Bug: skia:12524
Change-Id: I63c0707b8b7814c93f472c33f108319774192cbd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/468038
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-11-05 18:36:41 +00:00
Chris Dalton
233f4d8a21 Convert MiddleOutPolygonTriangulator to an iterator
Rather than having this class write directly to a GPU buffer, which
also included an ugly hack to support extra instance data that was not
points, it is now just an iterator style object. This allows the
caller to iterate over all the triangles and do whatever it wants with
them. This is both faster and more versatile.

Bug: skia:12524
Change-Id: I43cdd721bc50607cc34ebf415390b4d493f4d697
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/466917
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-11-03 21:36:44 +00:00
Kevin Lubick
3a9a7991c4 Move sk_memset* from SkUtils to SkOpts
This is a (hopefully) more careful reland of parts of
https://skia-review.googlesource.com/c/skia/+/464876

Change-Id: I32dd6777a70d983d8a66a4bf9557cab6e3d7ebc2
Bug: skia:12584
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/467124
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-11-03 17:03:21 +00:00
Chris Dalton
784b7b7ab5 Remove recursion from PathWedgeTessellator chopping
Rather that recursively running Wang's formula and chopping, we run
Wang's once, divide by the maximum number of tessellation segments,
then chop in a flat loop. The next step will be to share this code
with other tessellators.

Bug: skia:12524
Change-Id: I6c5156f56885aee9f90b3be611fbef229740612d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/465362
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-11-01 19:15:24 +00:00
Kevin Lubick
afa657d6ab Move GR_MAKE_BITFIELD_OPS and GrAlignTo to non-GPU files
This is a more cautious attempt of https://skia-review.googlesource.com/c/skia/+/464876

GrAlignTo renamed to SkAlignTo and moved to SkTypes.h
(with the rest of our align helpers).

GR_MAKE_BITFIELD_OPS and GR_DECL_BITFIELD_OPS_FRIENDS
renamed to SK_* and moved to private/SkMacros.h

This avoids our public includes using a src header file
and messing with SkUtils.h, which apparently was used
by Android. That should be cleaned up in a separate effort.

Change-Id: I86d5e1fb6a7834034534266a6c340bc7757f9abb
Bug: skia:12584
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/466176
Reviewed-by: Brian Osman <brianosman@google.com>
2021-11-01 17:26:59 +00:00
Chris Dalton
6bb17ab48d Reland "Lift recursive curve culling out of tessellators"
This is a reland of 75e1f4c028

Original change's description:
> Lift recursive curve culling out of tessellators
>
> We need recursive chopping/culling logic in order to draw
> astronomically large paths. But rather than do that at the same time
> the tessellators chop curves, this CL moves that logic into an
> SkPath -> SkPath transformation that runs ahead of time (and only if
> the path is extremely large to begin with). This will enable us to
> remove recursion from the tessellators and quickly determine ahead of
> time the size of buffers they need.
>
> Bug: skia:12524
> Change-Id: Ib2800fb23054f1548501811203173e58273fbc83
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463936
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

Bug: skia:12524
Change-Id: Idf54f0c2bddaaddc9fc17bee99c910f3961682a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/465361
Reviewed-by: Greg Daniel <egdaniel@google.com>
Auto-Submit: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-10-29 21:59:30 +00:00
Greg Daniel
b3ecd560a2 Revert "Move GR_MAKE_BITFIELD_OPS and GrAlignTo to non-GPU files"
This reverts commit 65a726bb49.

Reason for revert: You cannot include a src file in an include file. This ends up using c++17 features in our includes. Breaks rolls.

Original change's description:
> Move GR_MAKE_BITFIELD_OPS and GrAlignTo to non-GPU files
>
> These have been renamed SK_MAKE_BITFIELD_OPS and SkAlignTo
> because nothing seemed particularly GPU/Ganesh specific to them.
>
> I moved the latter to SkTypes.h because we have other align
> code there and former to src/SkUtils.h because I didn't know
> where else it should go.
>
> The primary motivation was removing the GrTypesPriv.h
> include from src/core/SkBlockAllocator.h. I had attempted
> some amount of #if SK_SUPPORT_GPU, but that's not as clean
> here because both our CPU and GPU backends use the
> SkBlockAllocator (as far as I could tell).
>
> This also moves sk_memset* from SkUtils.h to SkOpts.h, because
> SkOpts.h requires bringing in RasterPipeline, which seemed
> like overkill.
>
> Change-Id: I5163ef5064ad3840a15b7e873930d60e2620bf9d
> Bug: skia:12584
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/464876
> Reviewed-by: Brian Osman <brianosman@google.com>

Bug: skia:12584
Change-Id: I1b772bbbc6f150d737bb53fa4e5f45d1581929fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/465376
Auto-Submit: Greg Daniel <egdaniel@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-10-29 12:50:09 +00:00
Kevin Lubick
65a726bb49 Move GR_MAKE_BITFIELD_OPS and GrAlignTo to non-GPU files
These have been renamed SK_MAKE_BITFIELD_OPS and SkAlignTo
because nothing seemed particularly GPU/Ganesh specific to them.

I moved the latter to SkTypes.h because we have other align
code there and former to src/SkUtils.h because I didn't know
where else it should go.

The primary motivation was removing the GrTypesPriv.h
include from src/core/SkBlockAllocator.h. I had attempted
some amount of #if SK_SUPPORT_GPU, but that's not as clean
here because both our CPU and GPU backends use the
SkBlockAllocator (as far as I could tell).

This also moves sk_memset* from SkUtils.h to SkOpts.h, because
SkOpts.h requires bringing in RasterPipeline, which seemed
like overkill.

Change-Id: I5163ef5064ad3840a15b7e873930d60e2620bf9d
Bug: skia:12584
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/464876
Reviewed-by: Brian Osman <brianosman@google.com>
2021-10-28 18:18:47 +00:00
Chris Dalton
13fd52e587 Reland "Create a common Tessellation.h header"
This is a reland of 8a2a020ef4

Original change's description:
> Create a common Tessellation.h header
>
> This header and corresponding implementation will contain common
> definitions and subroutines for tessellation code.
>
> Bug: skia:12524
> Change-Id: Ib29b444177f284acb88a3d5644936674c48c0b89
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463437
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

Bug: skia:12524
Change-Id: I874fed63cdab50df841e8a5d25d8c822690b5af8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/464294
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-10-27 19:09:32 +00:00
Greg Daniel
29187b15fd Revert "Create a common Tessellation.h header"
This reverts commit 8a2a020ef4.

Reason for revert: breaking chrome roll. Needs change in chrome to land first

Original change's description:
> Create a common Tessellation.h header
>
> This header and corresponding implementation will contain common
> definitions and subroutines for tessellation code.
>
> Bug: skia:12524
> Change-Id: Ib29b444177f284acb88a3d5644936674c48c0b89
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463437
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

Bug: skia:12524
Change-Id: Ifd7e81eed8c337506d67ecd0fd2501eedf2e4408
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/464297
Auto-Submit: Greg Daniel <egdaniel@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-10-27 17:24:20 +00:00
Greg Daniel
5f132753ec Revert "Lift recursive curve culling out of tessellators"
This reverts commit 75e1f4c028.

Reason for revert: need to revert parent CL

Original change's description:
> Lift recursive curve culling out of tessellators
>
> We need recursive chopping/culling logic in order to draw
> astronomically large paths. But rather than do that at the same time
> the tessellators chop curves, this CL moves that logic into an
> SkPath -> SkPath transformation that runs ahead of time (and only if
> the path is extremely large to begin with). This will enable us to
> remove recursion from the tessellators and quickly determine ahead of
> time the size of buffers they need.
>
> Bug: skia:12524
> Change-Id: Ib2800fb23054f1548501811203173e58273fbc83
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463936
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

Bug: skia:12524
Change-Id: Ib075e8398767fd7b9f49e50ecee98ce47a2ad6b1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/464296
Auto-Submit: Greg Daniel <egdaniel@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2021-10-27 17:22:59 +00:00
Chris Dalton
75e1f4c028 Lift recursive curve culling out of tessellators
We need recursive chopping/culling logic in order to draw
astronomically large paths. But rather than do that at the same time
the tessellators chop curves, this CL moves that logic into an
SkPath -> SkPath transformation that runs ahead of time (and only if
the path is extremely large to begin with). This will enable us to
remove recursion from the tessellators and quickly determine ahead of
time the size of buffers they need.

Bug: skia:12524
Change-Id: Ib2800fb23054f1548501811203173e58273fbc83
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463936
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-10-27 16:39:36 +00:00
Chris Dalton
8a2a020ef4 Create a common Tessellation.h header
This header and corresponding implementation will contain common
definitions and subroutines for tessellation code.

Bug: skia:12524
Change-Id: Ib29b444177f284acb88a3d5644936674c48c0b89
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463437
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-10-27 16:21:06 +00:00
Chris Dalton
52aee23ded GrVertexWriter -> skgpu::VertexWriter
This class can now be shared with Graphite.

Bug: skia:12524
Change-Id: I7841410b3e8e111a12298efe0a1898a33295873a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/462556
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-10-25 17:25:02 +00:00
Brian Osman
e3ff9b1783 Remove GrContextOptions from GrShaderCaps constructor
Bug: skia:12559
Change-Id: I91e0b46702ca361737459d64d1cdb57f8dd2f64e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461697
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-10-20 22:51:42 +00:00
Chris Dalton
dd07eb01c8 Move VectorXform into the wangs_formula namespace
This class is only meant to be used with Wang's formulas, so it
belongs in their name namespace.

Bug: skia:12524
Change-Id: Ib1667781b947a7f052af103b7bf9084d09a690de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461567
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-10-20 18:17:48 +00:00
Chris Dalton
49c766732d Delete the skgpu::tess namespace
Tessellation code can just exist in the skgpu namespace.

Bug: skia:12524
Change-Id: I44d473c5f82d608bb6cd3bb9df239c4f4028da4f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/461557
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-10-20 18:16:48 +00:00
Chris Dalton
2fceb21cb7 [graphite] Add an IntersectionTree class
Implements a BSP tree with NEON/SSE optimizations that tracks
non-overlapping regions. This object can be used batch sets of paths
into non-overlapping draws. Performance on AppleM1 with our existing
benchmarks looks very promising:

    desk_motionmarkarcs.skp     1227 paths -> 69 draws    450us
    desk_motionmarksuits.skp    1417 paths -> 26 draws    201us
    desk_chalkboard.skp         1940 paths -> 11 draws     84us
    desk_ynevsvg.skp             859 paths -> 10 draws     31us
    desk_micrographygirl.skp     318 paths -> 29 draws     11us

Bug: skia:12466
Change-Id: I847a93ed726dea10cb403cb76e578bd81eb920d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/460298
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2021-10-19 19:45:01 +00:00
Ethan Nicholas
ab0a13d9d9 Removed the final remnants of IRGenerator
This completes the long process of moving all of IRGenerator's code and
data into better homes and finally kills the class altogether. There is
a lot of #include churn here due to poor header hygiene in the past;
IRGenerator.h included a ton of stuff and almost everything included
IRGenerator, allowing us to inadvertently be sloppy with our includes.

Change-Id: I70d854e57dec7bd9a311b72f9f72d978d354da98
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459936
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-10-19 13:17:01 +00:00
Chris Dalton
d0c7f63645 Move Wang's formula back into src/gpu/tessellate
We are making src/gpu/tessellate independent of v1, and more represent
math and types that just know how to tessellate, so this seems like the
right place again for this file.

Bug: skia:12524
Change-Id: I773de3c0f93a57ce7ee16b44480667013f32ebd5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459136
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-10-14 17:34:29 +00:00
Kevin Lubick
8f4e560871 Use CommonFlags namespace for other flags/functions
This consolidates tools/flags/CommonFlagsFontMgr.h into
tools/flags/CommonFlags.h and adds all those common
flags into the CommonFlags namespace.

I also cleaned up a few unused includes in DM.cpp

Change-Id: I1d1bf6598dfb87619b6abbb9faa1e24631f76fb4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459476
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2021-10-14 14:34:21 +00:00
Kevin Lubick
f541ddf785 Move ToolUtils::make_big_path() to bench/
The ToolUtils file is getting a bit bloated, IMO. I noticed this when
working on Bazel includes.

Including non-header files is a small nuisance in Bazel, so it
is probably better to just make it its own compilation unit.

Change-Id: I06ca3808a37ebef6478f5afa3f14086429899590
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459197
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-10-14 12:57:29 +00:00
Chris Dalton
0de8a96a72 Create an skgpu::tess namespace
This is just a bunch of renaming, and for now the tessellate/shaders
directory remains untouched. The next steps will be to clean up and
remove all Ganesh v1 dependencies from tessellation.

Bug: skia:12524
Change-Id: I8cc166c0c78f9fb160de807131fa53fcc0765818
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/458876
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-10-13 16:54:28 +00:00
Brian Salomon
9fa47cc1c6 Make class members that are static constexpr also be inline.
This is in prep for compiling with -std=c++14 and -Wno-c++17-extensions
when building with clang. Chrome has encountered problems with
third_party headers that are included both in Skia and other Chrome
sources that produce different code based on whether preprocessor macros
indicate a C++14 or C++17 compilation.

In C++17 they are already inline implicitly. When compiling with C++14
we can get linker errors unless they're explicitly inlined or defined
outside the class. With -Wno-c++17-extensions we can explicitly inline
them in the C++14 build because the warning that would be generated
about using a C++17 language extension is suppressed.

We cannot do this in public headers because we support compiling with
C++14 without suppressing the C++17 language extension warnings.

Bug: chromium:1257145
Change-Id: Iaf5f4c62a398f98dd4ca9b7dfb86f2d5cab21d66
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457498
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-10-11 16:22:59 +00:00
Ethan Nicholas
791c0d36a6 Remove ASTNode and SkSLParser
Now that DSLParser is used for everything we can get rid of this
unused code.

Change-Id: I7b586a7d7a51ac9df7d2c52baa1f525233f489b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443076
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-09-28 13:36:49 +00:00
Herb Derby
12732e4ad8 Reland "remove drawing from ShaderMaskBench ctor"
This is a reland of 4c5f3ba155

Added: store the function pointer directly instead of a ref to it.

Original change's description:
> remove drawing from ShaderMaskBench ctor
>
> The drawing in the ctor makes debugging and measuring the
> RasterPipeline difficult. Move to onDelayedSetup().
>
> Change-Id: I74ca28d5d86d70d23e67188f1363b002ba85c6ef
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452358
> Commit-Queue: Herb Derby <herb@google.com>
> Auto-Submit: Herb Derby <herb@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>

Change-Id: I38c5c97bf03c8122abeb8aa228b922cfd9e6ec76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452231
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-24 17:14:10 +00:00
Brian Osman
a25328177a Revert "remove drawing from ShaderMaskBench ctor"
This reverts commit 4c5f3ba155.

Reason for revert: Speculative - appears to be breaking various perf bots

Original change's description:
> remove drawing from ShaderMaskBench ctor
>
> The drawing in the ctor makes debugging and measuring the
> RasterPipeline difficult. Move to onDelayedSetup().
>
> Change-Id: I74ca28d5d86d70d23e67188f1363b002ba85c6ef
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452358
> Commit-Queue: Herb Derby <herb@google.com>
> Auto-Submit: Herb Derby <herb@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>

Change-Id: Iae41dc5809de6b239670d00fb31dea73005f9124
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452230
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-09-24 15:45:13 +00:00
Herb Derby
4c5f3ba155 remove drawing from ShaderMaskBench ctor
The drawing in the ctor makes debugging and measuring the
RasterPipeline difficult. Move to onDelayedSetup().

Change-Id: I74ca28d5d86d70d23e67188f1363b002ba85c6ef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452358
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-24 14:59:09 +00:00
Herb Derby
106e7ff887 remove drawing from ctor
Remove drawing from the bench's constructor. This allows easier
debugging and measurement of RasterPipeline.

Change-Id: Iec974eef171917e849130fc68361e80ec1642100
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452357
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-09-23 19:29:39 +00:00
Avery Musbach
92ae58f338 Reland "bench: Add PhoneHub assets to skottie-vs-png decode bench"
This is a reland of 0541a983ef

This time with Generic_Error.png instead of Generic Error.png, because
the space caused problems.

Original change's description:
> bench: Add PhoneHub assets to skottie-vs-png decode bench
>
> The skottie-vs-png decode bench is intended to facilitate comparison
> between Lottie and PNG, but such a comparison cannot really be made when
> the Lottie files are unrelated to the PNG files (Lottie files chosen to
> represent a range of vector graphic complexity, versus PNG files chosen
> to represent a range of image dimensions). This CL adds PhoneHub assets
> in PNG and Lottie, including various Lottie files created using
> different optimization strategies (see added code comments for details).
>
> Change-Id: I1a4357ab0af22b9db7b7ce83fd07d48c77db7680
> Bug: chromium:1128684
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442476
> Reviewed-by: Avery Musbach <amusbach@google.com>
> Reviewed-by: Florin Malita <fmalita@google.com>
> Commit-Queue: Florin Malita <fmalita@google.com>

Bug: chromium:1128684
Change-Id: I1a5e21f67f52b03fa1c06192ef7190f41b04e3dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452300
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
Commit-Queue: Avery Musbach <amusbach@chromium.org>
2021-09-23 17:40:09 +00:00
Brian Osman
bd8bbcd016 Revert "bench: Add PhoneHub assets to skottie-vs-png decode bench"
This reverts commit 0541a983ef.

Reason for revert: Android roll failing

Original change's description:
> bench: Add PhoneHub assets to skottie-vs-png decode bench
>
> The skottie-vs-png decode bench is intended to facilitate comparison
> between Lottie and PNG, but such a comparison cannot really be made when
> the Lottie files are unrelated to the PNG files (Lottie files chosen to
> represent a range of vector graphic complexity, versus PNG files chosen
> to represent a range of image dimensions). This CL adds PhoneHub assets
> in PNG and Lottie, including various Lottie files created using
> different optimization strategies (see added code comments for details).
>
> Change-Id: I1a4357ab0af22b9db7b7ce83fd07d48c77db7680
> Bug: chromium:1128684
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442476
> Reviewed-by: Avery Musbach <amusbach@google.com>
> Reviewed-by: Florin Malita <fmalita@google.com>
> Commit-Queue: Florin Malita <fmalita@google.com>

Bug: chromium:1128684
Change-Id: Ib6364a482cfff5ca63e74eeb24c2688e49bc4b72
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/452096
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-09-23 12:36:08 +00:00
Avery Musbach
0541a983ef bench: Add PhoneHub assets to skottie-vs-png decode bench
The skottie-vs-png decode bench is intended to facilitate comparison
between Lottie and PNG, but such a comparison cannot really be made when
the Lottie files are unrelated to the PNG files (Lottie files chosen to
represent a range of vector graphic complexity, versus PNG files chosen
to represent a range of image dimensions). This CL adds PhoneHub assets
in PNG and Lottie, including various Lottie files created using
different optimization strategies (see added code comments for details).

Change-Id: I1a4357ab0af22b9db7b7ce83fd07d48c77db7680
Bug: chromium:1128684
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442476
Reviewed-by: Avery Musbach <amusbach@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2021-09-22 17:23:33 +00:00
Michael Ludwig
8c9c185a92 Simplify SkAAClip to use SkClipOp, not SkRegion::Op
Bug: skia:10205
Change-Id: I19039f72db1052db27f5819fafdc5ba8eb8af909
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445618
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-09-20 20:12:38 +00:00
John Stiles
de2b609fdd Move symbol-table push/pop methods out of IRGenerator.
This will allow us to use AutoSymbolTable in more places (and helps cut
down IRGenerator, as we transition away from it).

Change-Id: Ie88c149e0f7eee080a8a4c8cbbc34c8a2a5401d1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449756
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-09-17 16:31:39 +00:00
Greg Daniel
95ea283cd2 Remove neglected fillOptions function from nanobench.
Change-Id: I8d0704a73c80db6729811dc4ec343c409e6a2fb3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/448838
Auto-Submit: Greg Daniel <egdaniel@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-09-14 19:49:03 +00:00
Brian Osman
7ad42c0b16 Fix nanobench perf bug with large --ms values
When profiling with a large `--ms` value, the sample count could become
very large. We would still tell the Stats object that we wanted the plot
string (even though we weren't going to print it). Sadly, creation of
that string is O(n^2), thanks to SkString's allocation behavior.

Change-Id: I20ed61a49ab2827f3561673f086e7c5c298eaf86
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445645
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-09-03 21:49:45 +00:00
Robert Phillips
fbf021492e Move more Ops to skgpu::v1 namespace
GrFillRRectOp
GrFillRectOp

Bug: skia:11837
Change-Id: Icdecc2ccd9def659b0d9402910b2072e02577a66
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444817
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-09-02 13:25:29 +00:00