Allow brush tips to have multiple outlines (e.g. for particle effects) #69
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.
Allow brush tips to have multiple outlines (e.g. for particle effects)
In
StrokeShapeBuilder
, this involves losing the assumption that the number of outlines is exactly equal to the number of brush tips, since particle brushes have more than one outline per tip. Without that assumption, it can also discard empty outlines a bit earlier.In
BrushTipExtruder
this involves:Keeping a vector of outlines instead of a single outline (since the usual case is just one, this uses
absl::InlinedVector<StrokeOutline, 1>
).Keep track of the number of extrusion breaks in
Geometry
.Add accessors to
Geometry
to get the number of break-points and the index counts at the lastest break-point. Use those inRestore
to restore the saved state and inAppendNewIndices
to get the start points in the latest outline.Pull calls to
AppendNewIndices
andGeometry::UpdateMeshDerivatives
intoExtrudeBreakPoint
because the former computes the latest outline and the latter may update indices, so it needs to be called first.Similarly, move forward the "first mutated" indices in
Geometry::AddExtrusionBreak
, since those track the first mutated vertices that haven't been recorded in the outline. These are renamed tofirst_mutated_{left,right}_index_offset_in_current_partition_
, since these no longer track the same thing asfirst_mutated_left_index_
andfirst_mutated_right_index_
(which still considers a whole stroke update).In
InProgressStroke
,GetIndexOutlines
is renamed toGetCoatOutlines
for clarity, since that makes it clear what the index is referring to.