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>
Previously we would completely disable hardware tessellation for a path
if there was any chance of a curve requiring more segments than
supported by the hardware. This CL updates the tessellators to simply
chop paths until they fit in patches, allowing us to finally draw any
path using hardware tessellation.
Bug: skia:10419
Change-Id: I5c9f78cda3e30b8810aff3cb908235965706f2d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410977
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
GrStrokeHardwareTessellator is the only user that needs to simply
check if a cusp exists at all. Making the check local speeds up the
microbench from 502us -> 392.
Bug: chromium:1172543
Change-Id: I52adf9ef0a66e1267435e6ce41f01ee1eda17d7a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/373744
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
The stroker will need to know the cusps in order to draw circles around
them.
Bug: skia:10419
Change-Id: I05b7e9f4a5ed06bd36450e73edfaf36c4b3f5a6c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337945
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Cubic tangents become unstable if we chop too close to 0 or 1. This
adds an epsilon to simply not chop them if it's too close.
Bug: skia:10419
Change-Id: I99e98c5d433e2cb59c767ee564e015d7ec4f7765
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336280
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This method finds the locations a cubic needs to be chopped at before
it can be passed to the stroke tessellation shader. It's an integral
part of CPU stroke preparation and therefore extremely perf sensitive.
Bug: skia:10419
Change-Id: Ib23c2583b8cfc78814ce52425f7af2c8b2f8b420
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330314
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>