This sample has been broken for a bit because it is no longer allowed to
directly 'new' up an Op. Instead Ops should be created in pools.
Bug: skia:8251
Change-Id: Ic0716c4dce088350a8ef7b34c2f2f6518ca5d159
Reviewed-on: https://skia-review.googlesource.com/147114
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
What is left of the SkView system is used only by samples or viewer.
As a result, move it out of the Skia source tree and re-organize so it
is a bit easier to understand and use more shared code.
Move samplecode/ClockFaceView.cpp to samplecode/SampleTextEffects.cpp,
sice that's what's actually in it.
Move SkAnimTimer.h to tools/timer, since it's actually shared between gm
and samples.
Change-Id: I55dafd94c64e4f930ddbd19168e0f812af86c455
Reviewed-on: https://skia-review.googlesource.com/146161
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This reverts commit fdf05f4ff4.
Reason for revert: Android fixed after removing multitexture support from TextureOp.
Original change's description:
> Revert "Move GrGeometryProcessor's textures out of classes and into"
>
> This reverts commit af87483873.
>
> Revert "GrGeometryProcessor derives from GrNonAtomicRef not GrProgramElement."
>
> This reverts commit 607be37e3d.
>
> Revert "Store GrMeshDrawOps' meshes in GrOpFlushState's arena."
>
> This reverts commit b948572c78.
>
> Revert "Remove multitexturing support from GrTextureOp."
>
> This reverts commit 986f64c601.
>
> Revert "Make result of GrOp::combineIfPossible be an enum."
>
> This reverts commit 641ac7daa8.
>
> Bug: b/112244393
> Change-Id: I579491a3f2f2f2093f1e2a6141fa1e4cc7b760a4
> Reviewed-on: https://skia-review.googlesource.com/145646
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com
Change-Id: I1d41c2ecf7862e31fb025a7a00bb07bae9d83a47
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/112244393
Reviewed-on: https://skia-review.googlesource.com/145780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit af87483873.
Revert "GrGeometryProcessor derives from GrNonAtomicRef not GrProgramElement."
This reverts commit 607be37e3d.
Revert "Store GrMeshDrawOps' meshes in GrOpFlushState's arena."
This reverts commit b948572c78.
Revert "Remove multitexturing support from GrTextureOp."
This reverts commit 986f64c601.
Revert "Make result of GrOp::combineIfPossible be an enum."
This reverts commit 641ac7daa8.
Bug: b/112244393
Change-Id: I579491a3f2f2f2093f1e2a6141fa1e4cc7b760a4
Reviewed-on: https://skia-review.googlesource.com/145646
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This is to prepare for a third value that requests that ops be linked
together so that the first op may do the work for multiple linked ops
without actually merging the GrOp objects.
Change-Id: Ib6e012a89be5edd054aee69d8475bea612331852
Reviewed-on: https://skia-review.googlesource.com/145522
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
The most common use-case for F16 is to draw things that are explicitly
outside of [0,1]. We can't prevent out-of-range values in general, users
could just draw out-of-range content in src mode. We've decided that
it's best to avoid surprising behavior, and trust the user in these
situations.
This effectively reverts https://skia-review.googlesource.com/c/skia/+/48183
Bug: skia:
Change-Id: I71c2dd925c567e2862d96ab70c752f19245a69c4
Reviewed-on: https://skia-review.googlesource.com/140500
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit a219419c9d.
Reason for revert: breaking things
Original change's description:
> Some scissor state cleanup.
>
> Separate flushing the enablement of scissor from the rect in GrGLGpu.
>
> Move GrPipeline::ScissorState to a global enum and use more broadly.
> Rename to GrScissorTest to avoid name conflict with existing
> GrScissorState.
>
> Change-Id: Ib32160b3300bc12de2d2e1761d152fd1bba8b683
> Reviewed-on: https://skia-review.googlesource.com/137395
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com
Change-Id: If71a5c5efc86d4239b40675bad2a6cb1f77460f8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/138900
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Separate flushing the enablement of scissor from the rect in GrGLGpu.
Move GrPipeline::ScissorState to a global enum and use more broadly.
Rename to GrScissorTest to avoid name conflict with existing
GrScissorState.
Change-Id: Ib32160b3300bc12de2d2e1761d152fd1bba8b683
Reviewed-on: https://skia-review.googlesource.com/137395
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Remove scissor rect from GrPipeline.
Draws can specify "fixed dynamic state" which doesn't use the dynamism at
all or can specify dynamic state arrays with an entry per GrMesh.
When we state other than scissor rects this will allow the caller to
use a mix of truly dynamic and fixed dynamic state. So a caller that
only has dynamic scissor rects doesn't need to store its remaining
unvarying state in an array.
Change-Id: I8fcc07eb600c72a26cc712b185755c2116021a8a
Reviewed-on: https://skia-review.googlesource.com/137223
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Make GrGLProgram and GrCkPipelineState cons. public and remove builder friendship.
Neither GrGLProgram nor GrVkPipelineState need to know their Desc so remove it.
Move the VK desc subclass defn. to GrVkPipelineStateBuilder since it needs it while
GrVkPipelineState does not.
Some IWYU improvements.
Move declaration of the built-in uniform struct to GrGLSLUniformHandler.h from GrGLSLProgramBuilder.h.
Change-Id: Ib46817408a83a79a0f718ba2bc19411410d9065a
Reviewed-on: https://skia-review.googlesource.com/133060
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Removes fCurrAnchorPoint, and various other cleanups. fCurrAnchorPoint
was originally added because points were expected to be written directly
to mapped GPU buffers, which is not going to happen anymore.
Bug: skia:
Change-Id: Icaf8d09dae218f58c19a2f368f3cd281e285e2dd
Reviewed-on: https://skia-review.googlesource.com/119984
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Handles weighted triangles from the tessellator instead with a
"kWeightedTriangles" PrimitiveType.
Bug: skia:
Change-Id: I8a6f7b4205e1b3d6f340a30f3e90079ec44b8b6d
Reviewed-on: https://skia-review.googlesource.com/119202
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Renames GrCCCoverageProcessor::RenderPass to PrimitiveType and handles
corners as subpasses instead. Various touchups to coverage processors
now that the overhaul is complete. This change should be strictly a
refactor.
Bug: skia:
Change-Id: I52852463330d5ec71fae7e19fadccd9ede8b2c16
Reviewed-on: https://skia-review.googlesource.com/116169
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
The 3x3 inverse grew unstable on small curves with large coordinates,
not to mention being inefficient. This fixes many bad pixels on the
chalkboard.
Also begins scaling curve gradients by the AA bloat, in order to match
triangle edges more closely and visualize curve AA in the ccpr sample.
Bug: skia:
Change-Id: I0f7da2e7599d4d5c458b3dd307185679dc78bb50
Reviewed-on: https://skia-review.googlesource.com/115527
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Modifies triangle corner shaders to just approximate their coverage with
linear values that ramp to zero at bloat vertices outside the triangle.
For the vertex backend, since corners now have the same fragment shader
as the rest of the triangle, we fold them in with the other steps and
draw triangles in a single pass.
The geometry backend still draws triangles in two passes, as there is
not an apparent performance advantage in combining them.
Updates SampleCCPRGeometry to better visualize this new geometry by
clearing to black and drawing with SkBlendMode::kPlus.
Bug: skia:
Change-Id: Idf8df8ff715dfab7ac91a07b914f65c08e46010b
Reviewed-on: https://skia-review.googlesource.com/113287
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This reverts commit df04ce2949.
Reason for revert: Going to revisit AAA quality
Original change's description:
> ccpr: Draw curves in a single pass
>
> Throws out the complicated MSAA curve corner shaders, and instead just
> ramps coverage to zero at bloat vertices that fall outside the curve.
>
> Updates SampleCCPRGeometry to better visualize this new geometry by
> clearing to black and drawing with SkBlendMode::kPlus.
>
> Bug: skia:
> Change-Id: Ibe86cbc741d8b015127b10dd43e3b52e7cb35732
> Reviewed-on: https://skia-review.googlesource.com/112626
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com
Change-Id: I014baa60b248d870717f5ee8794e0bed66da86e6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/113181
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This reverts commit 622650a194.
Reason for revert: Going to try to improve AAA quality on curve corners
Original change's description:
> ccpr: Simplify triangle corners
>
> Modifies triangle corner shaders to just approximate their coverage with
> linear values that ramp to zero at bloat vertices outside the triangle.
>
> For the vertex backend, since corners now have the same fragment shader
> as the rest of the triangle, we fold them in with the other steps and
> draw triangles in a single pass.
>
> The geometry backend still draws triangles in two passes, as there is
> not an apparent performance advantage in combining them.
>
> Bug: skia:
> Change-Id: Ib4a89d793a3c706f734d0271875c8a3e5c87c49b
> Reviewed-on: https://skia-review.googlesource.com/112632
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com
Change-Id: I45e7b9d7d7f8452b28bd54ca1e90a1f046cb2462
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/113180
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Modifies triangle corner shaders to just approximate their coverage with
linear values that ramp to zero at bloat vertices outside the triangle.
For the vertex backend, since corners now have the same fragment shader
as the rest of the triangle, we fold them in with the other steps and
draw triangles in a single pass.
The geometry backend still draws triangles in two passes, as there is
not an apparent performance advantage in combining them.
Bug: skia:
Change-Id: Ib4a89d793a3c706f734d0271875c8a3e5c87c49b
Reviewed-on: https://skia-review.googlesource.com/112632
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Throws out the complicated MSAA curve corner shaders, and instead just
ramps coverage to zero at bloat vertices that fall outside the curve.
Updates SampleCCPRGeometry to better visualize this new geometry by
clearing to black and drawing with SkBlendMode::kPlus.
Bug: skia:
Change-Id: Ibe86cbc741d8b015127b10dd43e3b52e7cb35732
Reviewed-on: https://skia-review.googlesource.com/112626
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Updates the geometry shader backend to match the vertex backend and draw
triangle rasters together with their their edges in a single draw call.
This gives a performance boost as well as cleaning up some API
awkwardness.
This is one step toward the final goal of drawing ccpr primitives in a single
pass.
Bug: skia:
Change-Id: I2723692d02b9e39ca5dc5d9e022b528a051988ab
Reviewed-on: https://skia-review.googlesource.com/112104
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This increases CPU work, but reduces overdraw on the GPU as compared to
Redbook fanning.
TBR=bsalomon@google.com
Change-Id: I396b887075d4422531908c2361ee1e26f076d5c3
Reviewed-on: https://skia-review.googlesource.com/107141
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This reverts commit 4138c972ef.
Reason for revert: broke android flutter build
Original change's description:
> ccpr: Tessellate fans for very large and/or simple paths
>
> This increases CPU work, but reduces overdraw on the GPU as compared to
> Redbook fanning.
>
> Bug: skia:
> Change-Id: I47239c964261e0014a94266a71223eab0597bfb8
> Reviewed-on: https://skia-review.googlesource.com/105203
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com
Change-Id: I98b5c10b97c3fa603de5122d9bb47ca07659242c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/106620
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
This increases CPU work, but reduces overdraw on the GPU as compared to
Redbook fanning.
Bug: skia:
Change-Id: I47239c964261e0014a94266a71223eab0597bfb8
Reviewed-on: https://skia-review.googlesource.com/105203
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Also runs clang-format on the files that don't have special shader
builder styling.
Bug: skia:
Change-Id: I4a67569a7c8472acfb9200644c913844a92e3b2d
Reviewed-on: https://skia-review.googlesource.com/92083
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
It isn't necessary for the vertex shader to know all the points
because everything happens in the geometry shader. It's simpler to use
regular vertex arrays instead.
Bug: skia:
Change-Id: I7bf83180476fbe0ab01492611cd72e72b3f7d4f2
Reviewed-on: https://skia-review.googlesource.com/82881
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Points cost 8 bytes and indices cost 4. If a point is accessed twice,
it's a wash whether we duplicate it or index. This change eliminates
texel buffers by duplicating points across instance arrays. This
reduces our dependence on extensions as well as getting rid of our
indirect memory access pattern in vertex shaders.
As a result of this change, memory usage by GPU buffers will only be a
fraction larger at worst, and slightly better at best.
Bug: skia:
Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SKNX_NO_SIMD
Change-Id: I3c7f03772edd4f850d5fdd7b55552647335c1b52
Reviewed-on: https://skia-review.googlesource.com/79185
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Bug: skia:
Change-Id: I41480aa89dfcd8cb7e016e477cbabe354f35ce8a
Reviewed-on: https://skia-review.googlesource.com/75480
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Defers the transformation to normalized window coordinates until after
the geometry shader. Merges vertex and a geometry shader builders into
a single compilation unit with a common base class. Updates CCPR
geometry shaders accordingly.
Bug: skia:
Change-Id: If93c90e978b1fdc7120febd05cfb05810fd496b5
Reviewed-on: https://skia-review.googlesource.com/62980
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Decouples geometry generation and analytic coverage. This paves the
way for a vertex shader implementation.
TBR=egdaniel@google.com
Bug: skia:
Change-Id: I2a183401bfe70b9f14b9b1cf035de6020a2135fa
Reviewed-on: https://skia-review.googlesource.com/60103
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This reverts commit e501033bbd.
Reason for revert: Broke several bots
Original change's description:
> Refactor CCPR coverage shaders for a vertex impl
>
> Decouples geometry generation and analytic coverage. This paves the
> way for a vertex shader implementation.
>
> Bug: skia:
> Change-Id: I23b79d4397db22bd8fc063b8dfca58ab00037292
> Reviewed-on: https://skia-review.googlesource.com/59200
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,csmartdalton@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: skia:
Change-Id: I314bf03fa6cbeceb1c527d4d9464147b2e8464c6
Reviewed-on: https://skia-review.googlesource.com/59821
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
Decouples geometry generation and analytic coverage. This paves the
way for a vertex shader implementation.
Bug: skia:
Change-Id: I23b79d4397db22bd8fc063b8dfca58ab00037292
Reviewed-on: https://skia-review.googlesource.com/59200
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Removes the mode that generates edge and hull geometry simultaneously
from the geometry shader. Perf was hit and miss and it's not
compatible with vertex shaders. We can revisit if geometry shaders
still show promise on some platforms after a vertex shader impl is
finished.
Bug: skia:
Change-Id: I984231e9a5bb60fe31d3ba280c7390a74aa5bc27
Reviewed-on: https://skia-review.googlesource.com/51300
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Bug: skia:6173
Change-Id: I21042d484d9a7b3eee04aa3301d9793d00ad6908
Reviewed-on: https://skia-review.googlesource.com/48183
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Avoids the need for MSAA cubic borders by chopping up the cubic
geometry and crossing the inflections points and loop intersections
with lines and quadratic(s) instead. This allows us to render the
remaining cubic segments with simple hulls and analytic AA, giving
better image quality and performance.
Bug: skia:
Change-Id: If371229f575ee0286c325c230a116d602a9d38ce
Reviewed-on: https://skia-review.googlesource.com/41883
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Creates a GrCCPRGeometry class that chops contours up into simple
segments that ccpr can render, and rewrites the GPU buffer creation to
be able to handle arbitrary lengths of ccpr geometry.
Bug: skia:
Change-Id: Iaa173a02729e177b0ed7ef7fbb9195d349be689d
Reviewed-on: https://skia-review.googlesource.com/41963
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Enough ccpr-specific geometry code is in flight that it feels like it
should have its own file.
Bug: skia:
Change-Id: I99ef620a7dc35178cf774b3a4ec6159d46f401c7
Reviewed-on: https://skia-review.googlesource.com/39162
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>