CPU-side dashing for GPU strokes & encoding-time filtering of zero-length segments #412
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When GPU-side stroking is enabled, a stroke with a dash style now gets converted to a series of regular strokes which then get encoded separately and in sequence.
Zero-length segments lead to numerical errors and lead to extra complexity and wasted work (in the form of thread
allocation) for GPU flattening. We now detect and drop them at encoding time.
Currently, a path segment is considered zero-length if all of its control points (in local coordinates) are within EPSILON (1e-12) of each other. This may not be the desired behavior under transform.
Also since the length here isn't in terms of the actual arc length, this won't detect all curves that are within an EPSILON sized bounding box (which may have a larger distance between their control points).
For stroking purposes, the distance between the control points is what matters most as that's what's used to compute a curve's tangent.
This PR is based on #410
#303