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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
... 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>