Commit Graph

2681 Commits

Author SHA1 Message Date
Chris Dalton
2a26c50a62 Store the correct number of samples in GrProgramInfo
Bug: skia:11396
Change-Id: I9480b89635bd7a6bdff8ab4876c8eeafdbc27c8b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442096
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-08-26 17:24:47 +00:00
Robert Phillips
62bd633b1c Move tessellation ops to skgpu::v1 namespace
Mechanical.

Bug: skia:11837
Change-Id: Ic302ee314ad73ce034c8daac38416a8249a125a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/442276
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-26 15:17:52 +00:00
Brian Osman
9f1e06aef9 Reland "Add sRGB 8888 colortype"
This is a reland of 0f7c10ef56

Original change's description:
> Add sRGB 8888 colortype
>
> A color type that linearizes just after loading, and re-encodes to sRGB
> just before storing, mimicking the GPU formats that work the same way.
>
> Notes:
>   - No mipmap support
>   - No SkPngEncoder support (HashAndEncode's .pngs are ok, though?)
>   - Needs better testing
>
> This is a re-creation of reviews.skia.org/392990
>
> Change-Id: I4739c2280211e7176aae98ba0a8476a7fe5efa72
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438219
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

Change-Id: I5b6bb28c4c1faa6c97fcad7552d12c331535714d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441402
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-24 12:56:32 +00:00
Brian Osman
405eb7b72f Revert "Add sRGB 8888 colortype"
This reverts commit 0f7c10ef56.

Reason for revert: Unhappy rollers

Original change's description:
> Add sRGB 8888 colortype
>
> A color type that linearizes just after loading, and re-encodes to sRGB
> just before storing, mimicking the GPU formats that work the same way.
>
> Notes:
>   - No mipmap support
>   - No SkPngEncoder support (HashAndEncode's .pngs are ok, though?)
>   - Needs better testing
>
> This is a re-creation of reviews.skia.org/392990
>
> Change-Id: I4739c2280211e7176aae98ba0a8476a7fe5efa72
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438219
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reed@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: Ie199535b9b65ec7c7fef3c773452ea06bdbd2d9c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441376
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-23 17:38:05 +00:00
Brian Osman
0f7c10ef56 Add sRGB 8888 colortype
A color type that linearizes just after loading, and re-encodes to sRGB
just before storing, mimicking the GPU formats that work the same way.

Notes:
  - No mipmap support
  - No SkPngEncoder support (HashAndEncode's .pngs are ok, though?)
  - Needs better testing

This is a re-creation of reviews.skia.org/392990

Change-Id: I4739c2280211e7176aae98ba0a8476a7fe5efa72
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438219
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-08-23 15:14:41 +00:00
John Stiles
abae275ef7 Fix shadowed-variable warning in PathIter bench code.
This one slips past older versions of LLVM for some reason.

Change-Id: I86792b7fc9f66be6e40ed9f480f8750169b36bbc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440522
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-08-19 13:21:20 +00:00
Brian Osman
fcb5023819 Remove old color space configs from tools
This centralizes the new color-space parsing into SkCommandLineConfig,
and then wires that up in DM, nanobench, and skpbench. It also removes
all of the old config names that encoded both color type and space.

Change-Id: I9a63a97f1d153e7636a1fb974cc4071f5ada3184
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438377
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-18 14:34:44 +00:00
Robert Phillips
41ebbd71b1 Move triangulators and tessellators into gpu/geometry
This is the other half of making everything in gpu/ops be v1-only.

Bug: skia:11837
Change-Id: I5d77a499ef02eba69208d5bd634650433d02f6fb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440216
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-08-17 19:25:25 +00:00
Ethan Nicholas
4a5e22a8c8 Further unified error handling between SkSL and DSL
This eliminates the SkSL ErrorReporter class and funnels everything
through the DSL ErrorHandler. Since the DSL error handler can be
changed, this required a number of updates to ensure that things work
properly in the face of custom error handlers. There is probably more
work to be done in that area, but this at least passes all existing
tests.

Change-Id: Iaee27b79fc4ed426c484ccab257c09d28619ead5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438116
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-08-13 22:26:10 +00:00
John Stiles
73339ada9d Fix cases of variable shadowing in /bench/.
If we manage to fix all the existing cases of variable shadowing, we
could enable -Wshadow.

Change-Id: I91187f35a33293914958fba1c0b3b6adf5364e19
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438318
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2021-08-13 17:51:39 +00:00
Brian Osman
979b5ae39c Switch nanobench (and perf bots) over to new via-style color spaces
Change-Id: Ie04fae60971cdfeff7655ee73473296b16bf1593
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438822
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-12 17:10:10 +00:00
Brian Salomon
4895946078 Move ProgramImpl definitions into Processor subclass headers.
Move ProgramImpl function definitions into Processor subclass cpp files.

Delete separate h/cpp files.

Modify GrGLSLVaryingHandler::addPassThroughAttribute to break #include
cycle. It now takes a ShaderVar rather than a GP::Attribute, making
it slightly more flexible as the input can be any variable defined
in the vertex shader.

Bug: skia:11358
Change-Id: I94ee8cd44d29e194216592ecae5fd28de785c975
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438596
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-08-11 19:45:56 +00:00
Brian Salomon
bab2d11891 Improve consistency of GP::ProgramImpl subclasses
Named "Impl" and nested in GP or makeProgramImpl definition.

Remove unused INHERITED typedefs.

Remove GenKey pattern.

Bug: skia:11358
Change-Id: Icb4d5a0844184f51d92135de6cee6f6e77f57a5e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438478
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-08-11 16:52:09 +00:00
Brian Salomon
f95940bc23 Rename GrGLSLGeometryProcessor to GrGeometryProcessor::ProgramImpl
return from GrGP by unique_ptr, rename factory function to
makeProgramImpl()

Bug: skia:11358

Change-Id: I61dd36f770d2fc0b54de0e0e7b78ac4d3fbd119a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437741
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-08-10 14:36:40 +00:00
Brian Salomon
13b287386a Remove GLSL from name of functions that builds GrProcessor keys.
Bug: skia:11358
Change-Id: Ie70e45b18c12126c8e86700ad1040bc319be385a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436998
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-08-09 14:01:13 +00:00
Brian Salomon
54fd96b5fa Fix Wunused-but-set-variable warnings
Change-Id: I0e093fd35b11e9a765ef9c09f3b6346086ff66bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435983
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-08-05 21:49:18 +00:00
Michael Ludwig
2f6e2f8410 Use SkClipOp::kFoo instead of kFoo_SkClipOp from SkClipOpPriv
The SkClipOpPriv.h header will be going away soon, but a number of
places still use its kIntersect_SkClipOp definitions instead of the
equivalent SkClipOp::kIntersect. Besides updating these references,
a number of unnecessary includes to SkClipOpPriv.h are removed and
some test cases exercising expanding clip ops are deleted since they
will be unnecessary shortly.

Bug: skia:10208
Change-Id: I2bbdd6bb39869134c6a80ef2b4482e6cabdeb0b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436157
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2021-08-03 18:08:21 +00:00
Robert Phillips
4dca83162b Rename GrSurfaceDrawContext to skgpu::v1::SurfaceDrawContext
This CL is mostly mechanical. It:

replaces "src/gpu/GrSurfaceDrawContext.h" #includes with
         "src/gpu/v1/SurfaceDrawContext_v1.h" and reorders

replaces "class GrSurfaceDrawContext;" with
         "namespace skgpu { namespace v1 { class SurfaceDrawContext; }}"

replaces "GrSurfaceDrawContext*" with "auto" where possible
replaces "rtc" with "sdc"
replaces "surfaceDrawContext" with "sdc"
replaces GrSurfaceDrawContext with skgpu::v1::SurfaceDrawContext
reflows parameters as needed

This CL does not try to:

make skgpu::v1::SurfaceDrawContext V1-only
minimize the skgpu and/or skgpu::v1 prefixes

Those two tasks will be accomplished in follow up CLs. This CL is just trying to get the bulk of the mechanical changes comprehensibly landed.

Bug: skia:11837
Change-Id: I6fe59080249d585df8f5d27c6b67569cdc35842f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433156
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-07-28 20:12:10 +00:00
Chris Dalton
17eaf62160 Update GrPathTessellator::prepare() to take a list of paths
This allows us to batch multiple paths together in a single
tessellation. The first user will be the atlas, but the convex
renderer is also a good candidate.

Bug: skia:12258
Change-Id: I4d415d32bbf423cfd9b7ddf2543c21371936da90
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433776
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-07-28 16:56:51 +00:00
Brian Osman
310178c7b7 Microbench for canvas save/restore calls
Change-Id: I0dbf1af17c3a7ec70437e0479cd8b6b6269d155c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433476
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-07-27 21:08:11 +00:00
Chris Dalton
6966981ae0 Add a 'pathMatrix' to GrPathTessellator::prepare
The pathMatrix is applied on the CPU while the geometry is being
written out. It is a tool for batching, and is applied in addition to
the shader's on-GPU matrix. This CL also updates GrPathStencilCoverOp
do do all its path transformations with pathMatrix on the CPU side.
The next step will be for atlases to use the pathMatrix instead of
creating uber paths.

Bug: skia:12258
Change-Id: Ib924dfb06a2c0eed8f9045adc6ae9eefad510082
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433236
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-07-27 20:31:57 +00:00
Chris Dalton
40c906f58e Don't store a GrVertexWriter pointer in GrMiddleOutPolygonTriangulator
GrVertexWriter is itself a pointer, so this is a double reference.
It's ~20% faster on the micro benchmark to store this as a literal
GrVertexWriter. The motivation for this CL is that we need to optimize
the CPU-side processing for tessellation in order to place the
tessellation atlas above the cached triangulating path renderer in the
chain.

Bug: skia:12258
Change-Id: Ie10036d2fe618e848cdf67b9c23038fb9edf4c3b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433077
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-07-26 21:43:38 +00:00
Robert Phillips
400f52e691 Retract GrSurfaceDrawContext.h a bit
This CL just pulls GrSurfaceDrawContext.h out of headers and .cpp files where possible.

TBR=brianosman@google.com
Bug: skia:11837
Change-Id: Ib96f3619e3a50091516f81ae48f956fe83c05aff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431384
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2021-07-26 18:28:04 +00:00
Mike Reed
40bc6576d4 If we have no textures, suppress the shader
This lets us measure just the colors code-path, since the drawing code
will still respect the shader with no tex-coords, but that isn't really
and interesting case for timing.

Change-Id: If6b7d1465d625a3c311639aa8fdf731f46ade0ff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/432157
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-07-23 23:59:08 +00:00
Mike Reed
6417cfc71e Add _bilerp variant to vertices bench
... only affects when textures are also present

Change-Id: I82847c68380b6274583a48a96aef87ec1b353ada
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/432156
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-07-23 19:00:19 +00:00
Mike Reed
d068e4154c Pass separate texs so we don't cheat in drawVerts
Cheat == take a faster path that is not normally used by real clients.
This way the bench is more representative.

Change-Id: I37644ae5d05a00f217773dddba290eac9a2a846f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/431939
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2021-07-23 17:27:46 +00:00
Mike Reed
0e2fb66a50 Add flag to force high-precision RP
Change-Id: I9388458ae186f7b2a8b8534859147b9a1035276f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/432016
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-07-23 16:22:23 +00:00
Ethan Nicholas
dd2fdea9c2 Initial land of DSLParser
The DSLParser is an alternative to the existing SkSLParser which goes
directly to IR code using the SkSL DSL. It is substantially faster and
simpler than the existing parser->IRGenerator pipeline, but not yet
feature complete nor fully tested.

Change-Id: Iee45e9b527a3b88faa2ea74fc512051c8a38c5d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/400622
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-07-20 20:28:54 +00:00
Robert Phillips
e40495da3d Untangle GrSurfaceDrawContext.h, GrTextureOp.h and GrFillRectOp.h
The dependencies between these headers made modifying the SDC and Ops separately somewhat difficult.

Bug: skia:11837
Change-Id: I0c3ca118ce206bf8db5b6753be1ef46531ae1f58
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430041
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2021-07-20 17:09:21 +00:00
Chris Dalton
50516f3db8 Add a robust "isinf" workaround for tessellation
When isinf is not supported, we simply add another instanced attrib that
tells the shader exactly what type of curve it's dealing with.

Bug: chromium:1220246
Change-Id: I3496de674ce8c7df205e3c40559ae89dc29488e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/429676
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-07-19 16:03:39 +00:00
Chris Dalton
3febc61414 Revert "Add an isinf() polyfill for tessellation shaders"
This reverts commit 6904303a66.

Reason for revert: I don't trust it

Original change's description:
> Add an isinf() polyfill for tessellation shaders
>
> Tessellation uses infinity to flag conics, and also as a conic weight
> that converts them into triangles. The es2 shading language doesn't
> support infinity. This CL adds a "portable infinity" mode, where we
> pretend inputs >= 2^126 are infinity. The rationale for doing this is
> that those numbers are so large, they will overflow if we try to do any
> bezier math with then anyway.
>
> Bug: chromium:1220246
> Change-Id: I3ad29ebb6fbbad5d23cfdba7a2717605009f8180
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423697
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

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

Bug: chromium:1220246
Change-Id: I1e8f555b766118a49987fd4c5ea150b59b07c1e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/427920
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-07-14 20:50:53 +00:00
Chris Dalton
6aaf00fa7e Add a "usesMSAASurface" arg to GrMeshDrawOp::onCreateProgramInfo
onCreateProgramInfo needs to know if DMSAA will be rendering to a
separate MSAA target in order to properly set up its pipeline and
shaders. This CL mostly just plumbs this unformation through, but also
cleans up FillRRectOp now that this information is available.

Bug: skia:12201
Change-Id: I7300d2725da72484a12bd0c9d3ad298ae81bff90
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/427577
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-07-13 20:22:31 +00:00
Tyler Denniston
f8b7c1ac5f Pass CTM to path effects (experimental)
Add an overload to SkPathEffect that can be used when the CTM is known
at the callsite. GPU callsites are not handled here, that will be
tackled in a separate CL.

Path effects must implement the filterPath virtual that accepts the CTM,
although they are not obligated to use it. If a path effect does
use the CTM, the output geometry must be in the original coordinate
space, not device space.

Bug: skia:11957
Change-Id: I01615985599fe2736de954bb10dac881b0554ae7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420239
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2021-07-13 18:42:55 +00:00
Florin Malita
54fd2c59bf Re-enable large png decode bench
TBR=reed
Change-Id: Id7d535412c20bc8dcdc47613dec40d07cd3abee1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/426000
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2021-07-08 19:39:49 +00:00
Mike Reed
cd947ac177 Extend blendmodes bench to time sprites
Change-Id: I3801e869d8a2e177dae108a494a221d502c3caaf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/425182
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-07-07 16:21:23 +00:00
Florin Malita
a8d2bf7b29 Disable large png bench
(missing resource)

Change-Id: I9a436c07723a5029fccb38ecd1d0e7e76a3aca80
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/424099
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-07-01 20:55:59 +00:00
Florin Malita
d584ddd151 Add skottie-vs-png decode bench
Three flavors:

  - png data  -> bitmap
  - json data -> skottie::Animation -> SkPicture
  - json data -> skottie::Animation

    micros   	bench
     70.20  	decode_png_small	nonrendering
      4.32 ?	decode_skottiepic_small	nonrendering
      3.71 ?	decode_skottie_small	nonrendering

   4589.10  	decode_png_medium	nonrendering
    117.48 ?	decode_skottiepic_medium	nonrendering
     76.69 ?	decode_skottie_medium	nonrendering

  30895.97  	decode_png_large	nonrendering
   4911.16  	decode_skottiepic_large	nonrendering
   4640.39  	decode_skottie_large	nonrendering

Change-Id: Id93be15f453b70e8cb51ea38f33adc1ebc9ce562
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423819
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2021-07-01 20:18:03 +00:00
Chris Dalton
6904303a66 Add an isinf() polyfill for tessellation shaders
Tessellation uses infinity to flag conics, and also as a conic weight
that converts them into triangles. The es2 shading language doesn't
support infinity. This CL adds a "portable infinity" mode, where we
pretend inputs >= 2^126 are infinity. The rationale for doing this is
that those numbers are so large, they will overflow if we try to do any
bezier math with then anyway.

Bug: chromium:1220246
Change-Id: I3ad29ebb6fbbad5d23cfdba7a2717605009f8180
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423697
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-07-01 18:30:13 +00:00
Chris Dalton
bb995e60a3 Add an sk_VertexID workaround for tessellated stroking
Tessellation should now be completely free of its dependence on
sk_VertexID.

Bug: chromium:1220246
Change-Id: I4027099392b92e45aee7d8417945335352e3416e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423496
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-07-01 17:43:23 +00:00
Herb Derby
efe9df37e0 Revert "Don't keep "outResultsFile" open in nanobench"
This reverts commit 2e1381ec86.

Reason for revert: This causes corrupted JSON output from
                   nanobench

Bug: skia:12078

Original change's description:
> Don't keep "outResultsFile" open in nanobench
>
> There is a bug on Pixel and Pixel2 devices where the program
> eventually terminates with a non-zero exit code. Closing the
> outResultsFile between JSON flushes seems to fix it (for whatever
> reason).
>
> Bug: b/143074513
> Change-Id: I935e982e88758fda19292129c8031f8501cca615
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249821
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

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

Bug: b/143074513
Change-Id: Iad8e4423acbc520f49365859020776110087dacc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419842
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2021-06-19 22:12:48 +00:00
Robert Phillips
71143950f4 Switch GrMeshDrawOp::Target to be the stand alone GrMeshDrawTarget class
The Tessellator classes will survive in the NGA and they use
GrMeshDrawOp::Target - but GrMeshDrawOp will not survive.

This is a prelude to making all the remaining GrOp-derived classes OGA-only.

Bug: skia:11837
Change-Id: I62dc92e5f42d672342113f12dcedf3435fab993f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419198
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-06-17 19:57:43 +00:00
John Stiles
2d8b835cad Add SkBlender class; thread into SkVMBlitter.
Like SkColorFilter, SkShader, etc., this has a public-facing component
(SkBlender) and a private subclass (SkBlenderBase) which can be
obtained via a helper function (as_BB). At present there are no public-
facing methods, but the type needs to be exposed to be usable by the
outside world.

These classes exist for SkRuntimeEffect to subclass. The blender base
provides a `program` method with the parameters that blending will use.

Change-Id: I75c772fd4108a9c21fbda84201a8b23d3750a0df
Bug: skia:12080
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/416916
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-06-16 17:35:38 +00:00
John Stiles
af8047dbb8 Rename existing 'Blend' enums/names to 'BlendFilter'.
Change-Id: I17c624e9145d7152f65695ca3ce4592a11bb09a2
Bug: skia:12080
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/418637
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-06-15 22:51:40 +00:00
Ethan Nicholas
6823b50830 Revert "Revert "Switched SkSL parser APIs from char* + length to string_view""
This reverts commit 85ed605159.

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

Change-Id: I09a8a821ceb2b3d525cbca5e52af5cad96d1e2b5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/418617
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2021-06-15 16:45:17 +00:00
Jorge Betancourt
85ed605159 Revert "Switched SkSL parser APIs from char* + length to string_view"
This reverts commit 2705cbf9bd.

Reason for revert: blocking g3 autoroller

Original change's description:
> Switched SkSL parser APIs from char* + length to string_view
>
> Change-Id: I9f4378b622699d80bef449f9857117e9cc437956
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/418140
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>

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

Change-Id: I56fe1b306f2619227b8a2c10b3ab7de30de60bdf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/418536
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-06-15 12:29:09 +00:00
Ethan Nicholas
2705cbf9bd Switched SkSL parser APIs from char* + length to string_view
Change-Id: I9f4378b622699d80bef449f9857117e9cc437956
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/418140
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-06-14 20:59:52 +00:00
Michael Ludwig
9d1cc05100 Add scratch-only version of performDeferredCleanup
Change-Id: I5707d1da1b69ab1ffaa77d7a391a187ac3e8eba1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/417267
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2021-06-10 18:13:23 +00:00
Chris Dalton
198ac15a90 Reland "Fix tessellation checks for "usesVaryingCoords""
This is a reland of bd727d0620

TBR=jvanverth@google.com

Original change's description:
> Fix tessellation checks for "usesVaryingCoords"
>
> We can't use our hardware tessellation back door if any FPs in the
> program have varyings. Before this CL, we were forgetting to check the
> clip FP for strokes, and weren't checking any FPs yet for fills.
>
> Bug: skia:10419
> Change-Id: Ica631ab3cf0407fb359c02c6d53f88f5f301cddc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/417237
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

Bug: skia:10419
Change-Id: If8c1e18efc663641b2d565314110f66a6840f8bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/417317
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2021-06-09 23:56:29 +00:00
Chris Dalton
7391511f7b Fix compiler error in TessellateBench.cpp
Change-Id: I09cde57375a742355ff4498549fb8f57299f4610
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/417316
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2021-06-09 22:30:24 +00:00
Jim Van Verth
5d1599f69d Revert "Fix tessellation checks for "usesVaryingCoords""
This reverts commit bd727d0620.

Reason for revert: Breaking builds.

Original change's description:
> Fix tessellation checks for "usesVaryingCoords"
>
> We can't use our hardware tessellation back door if any FPs in the
> program have varyings. Before this CL, we were forgetting to check the
> clip FP for strokes, and weren't checking any FPs yet for fills.
>
> Bug: skia:10419
> Change-Id: Ica631ab3cf0407fb359c02c6d53f88f5f301cddc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/417237
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

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

Change-Id: I30d29f078d7b8cef146463feaaec0883ba5b9872
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10419
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/417265
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2021-06-09 22:09:03 +00:00