Skip to content

Commit 9462b6c

Browse files
sfreilichcopybara-github
authored andcommitted
Update comments to indicate that continuous strokes can have multiple outlines
PiperOrigin-RevId: 713744181
1 parent 26b4724 commit 9462b6c

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

ink/geometry/partitioned_mesh.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,10 @@ class PartitionedMesh {
188188
absl::Span<const Mesh> Meshes() const;
189189

190190
// Returns the number of outlines (which may be zero) in render group
191-
// `group_index`.
191+
// `group_index`. Groups with discontinuous geometry will always have multiple
192+
// outlines, but even a group with continuous geometry may be drawn with
193+
// multiple overlapping outlines when this improves rendering quality or
194+
// performance.
192195
//
193196
// This method CHECK-fails if `group_index` >= `RenderGroupCount()`.
194197
uint32_t OutlineCount(uint32_t group_index) const;

ink/strokes/in_progress_stroke.h

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -204,18 +204,21 @@ class InProgressStroke {
204204
// specified coat of paint.
205205
const Envelope& GetMeshBounds(uint32_t coat_index) const;
206206

207-
// Returns one or more spans of vertex indices, one for each of the stroke
208-
// outlines for the specified coat of paint.
207+
// Returns zero or more non-empty spans of vertex indices, one for each of the
208+
// stroke outlines for the specified coat of paint. There will be at least one
209+
// outline for each brush tip if the stroke is non-empty. Stroke coats with
210+
// discontinuous geometry will always have multiple outlines, but even a coat
211+
// with continuous geometry may be drawn with multiple overlapping outlines
212+
// when this improves rendering quality or performance.
209213
//
210214
// Every returned index value can be used to get an outline position from the
211215
// `MutableMesh` returned by `GetMesh()`.
212216
//
213-
// For each non-empty span of indices, the first and last elements reference
214-
// vertices at the end of the stroke. The indices traverse the mesh such that
215-
// the outline has a negative winding number when viewed from the positive
216-
// z-axis. I.e. the outline positions would be appear in clockwise order if
217-
// the y-axis points up, and in counter-clockwise order if the y-axis points
218-
// down.
217+
// The first and last elements in each span reference the vertices at the end
218+
// of the stroke outline. The indices traverse the mesh such that the outline
219+
// has a negative winding number when viewed from the positive z-axis. That
220+
// is, the outline positions are in clockwise order if the y-axis points up,
221+
// counter-clockwise order if the y-axis points down.
219222
absl::Span<const absl::Span<const uint32_t>> GetIndexOutlines(
220223
uint32_t coat_index) const;
221224

0 commit comments

Comments
 (0)