Rename "breadcrumb" triangles to "grout" triangles Diffs= cd6a563e1 Rename "breadcrumb" triangles to "grout" triangles (#5542) Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
diff --git a/.rive_head b/.rive_head index 0e0b6ca..f3fc963 100644 --- a/.rive_head +++ b/.rive_head
@@ -1 +1 @@ -5a18c89bdc51d7a1823aad4b3e0f2a383331afea +cd6a563e179cacbe5f243de12f04c04a8be83555
diff --git a/include/rive/pls/pls.hpp b/include/rive/pls/pls.hpp index 83ce78d..aa350b7 100644 --- a/include/rive/pls/pls.hpp +++ b/include/rive/pls/pls.hpp
@@ -96,9 +96,9 @@ constexpr static uint32_t kFirstVertexOfContour = 1u << 31; // Tells shaders that a cubic should actually be drawn as the single, non-AA triangle: [p0, p1, p3]. -// This is used to squeeze in more rare triangles, like "breadcrumb" triangles from -// self-intersections on interior triangulation, where it wouldn't be worth it to put them in their -// own dedicated draw call. +// This is used to squeeze in more rare triangles, like "grout" triangles from self intersections on +// interior triangulation, where it wouldn't be worth it to put them in their own dedicated draw +// call. constexpr static uint32_t kRetrofittedTriangle = 1u << 30; // Tells the tessellation shader to re-run Wang's formula on the given curve, figure out how many
diff --git a/renderer/gr_inner_fan_triangulator.hpp b/renderer/gr_inner_fan_triangulator.hpp index 93a3c1c..4f22605 100644 --- a/renderer/gr_inner_fan_triangulator.hpp +++ b/renderer/gr_inner_fan_triangulator.hpp
@@ -15,12 +15,12 @@ namespace rive { // Triangulates the inner polygon(s) of a path (i.e., the triangle fan for a Redbook rendering -// method). When combined with the outer curves and breadcrumb triangles, these produce a complete -// path. If a breadcrumbCollector is not provided, pathToPolys fails upon self intersection. +// method). When combined with the outer curves and grout triangles, these produce a complete path. +// If a groutCollector is not provided, pathToPolys fails upon self intersection. class GrInnerFanTriangulator : private GrTriangulator { public: - using GrTriangulator::BreadcrumbTriangleList; + using GrTriangulator::GroutTriangleList; GrInnerFanTriangulator(const RawPath& path, const AABB& pathBounds, @@ -29,7 +29,7 @@ GrTriangulator(pathBounds, fillRule, alloc) { fPreserveCollinearVertices = true; - fCollectBreadcrumbTriangles = true; + fCollectGroutTriangles = true; bool isLinear; auto [polys, success] = GrTriangulator::pathToPolys(path, 0, AABB{}, &isLinear); if (success) @@ -56,7 +56,7 @@ return GrTriangulator::polysToTriangles(m_polys, m_maxVertexCount, m_pathID, bufferRing); } - const BreadcrumbTriangleList& breadcrumbList() const { return fBreadcrumbList; } + const GroutTriangleList& groutList() const { return fGroutList; } private: uint16_t m_pathID = 0; @@ -67,12 +67,12 @@ #else -// Stub out GrInnerFanTriangulator::BreadcrumbTriangleList for function declarations. +// Stub out GrInnerFanTriangulator::GroutTriangleList for function declarations. namespace GrInnerFanTriangulator { -struct BreadcrumbTriangleList +struct GroutTriangleList { - BreadcrumbTriangleList() = delete; + GroutTriangleList() = delete; }; }; // namespace GrInnerFanTriangulator
diff --git a/renderer/gr_triangulator.cpp b/renderer/gr_triangulator.cpp index 0afcf63..576a38b 100644 --- a/renderer/gr_triangulator.cpp +++ b/renderer/gr_triangulator.cpp
@@ -1022,13 +1022,13 @@ const Comparator& c) const { remove_edge_below(edge); - if (fCollectBreadcrumbTriangles) + if (fCollectGroutTriangles) { - fBreadcrumbList.append(fAlloc, - edge->fTop->fPoint, - edge->fBottom->fPoint, - v->fPoint, - edge->fWinding); + fGroutList.append(fAlloc, + edge->fTop->fPoint, + edge->fBottom->fPoint, + v->fPoint, + edge->fWinding); } edge->fTop = v; edge->recompute(); @@ -1044,13 +1044,13 @@ const Comparator& c) const { remove_edge_above(edge); - if (fCollectBreadcrumbTriangles) + if (fCollectGroutTriangles) { - fBreadcrumbList.append(fAlloc, - edge->fTop->fPoint, - edge->fBottom->fPoint, - v->fPoint, - edge->fWinding); + fGroutList.append(fAlloc, + edge->fTop->fPoint, + edge->fBottom->fPoint, + v->fPoint, + edge->fWinding); } edge->fBottom = v; edge->recompute();
diff --git a/renderer/gr_triangulator.hpp b/renderer/gr_triangulator.hpp index b137216..b38e7b7 100644 --- a/renderer/gr_triangulator.hpp +++ b/renderer/gr_triangulator.hpp
@@ -254,30 +254,30 @@ bool fEmitCoverage = false; #endif bool fPreserveCollinearVertices = false; - bool fCollectBreadcrumbTriangles = false; + bool fCollectGroutTriangles = false; - // The breadcrumb triangles serve as a glue that erases T-junctions between a path's outer - // curves and its inner polygon triangulation. Drawing a path's outer curves, breadcrumb + // The grout triangles serve as a glue that erases T-junctions between a path's outer + // curves and its inner polygon triangulation. Drawing a path's outer curves, grout // triangles, and inner polygon triangulation all together into the stencil buffer has the same // identical rasterized effect as stenciling a classic Redbook fan. // - // The breadcrumb triangles track all the edge splits that led from the original inner polygon - // edges to the final triangulation. Every time an edge splits, we emit a razor-thin breadcrumb + // The grout triangles track all the edge splits that led from the original inner polygon + // edges to the final triangulation. Every time an edge splits, we emit a razor-thin grout // triangle consisting of the edge's original endpoints and the split point. (We also add - // supplemental breadcrumb triangles to areas where abs(winding) > 1.) + // supplemental grout triangles to areas where abs(winding) > 1.) // // a // / // / // / - // x <- Edge splits at x. New breadcrumb triangle is: [a, b, x]. + // x <- Edge splits at x. New grout triangle is: [a, b, x]. // / // / // b // - // The opposite-direction shared edges between the triangulation and breadcrumb triangles should + // The opposite-direction shared edges between the triangulation and grout triangles should // all cancel out, leaving just the set of edges from the original polygon. - class BreadcrumbTriangleList + class GroutTriangleList { public: struct Node @@ -309,7 +309,7 @@ fCount += winding; } - void concat(BreadcrumbTriangleList&& list) + void concat(GroutTriangleList&& list) { assert(fTail && !(*fTail)); if (list.fHead) @@ -329,7 +329,7 @@ int fCount = 0; }; - mutable BreadcrumbTriangleList fBreadcrumbList; + mutable GroutTriangleList fGroutList; }; /**
diff --git a/renderer/pls_renderer.cpp b/renderer/pls_renderer.cpp index cdb39d5..2c2b073 100644 --- a/renderer/pls_renderer.cpp +++ b/renderer/pls_renderer.cpp
@@ -569,16 +569,16 @@ path->pathBounds, path->fillRule, context->trivialPerFlushAllocator()); - // We also draw each "breadcrumb" triangle using an outerCubic patch. - patchCount += path->triangulator->breadcrumbList().count(); + // We also draw each "grout" triangle using an outerCubic patch. + patchCount += path->triangulator->groutList().count(); path->tessVertexCount = patchCount * kOuterCurvePatchSegmentSpan; m_contourCount += contourCount; m_patchCount += patchCount; } else { - // Submit breadcrumb triangles, emulated by outerCubic patches. - for (auto* node = path->triangulator->breadcrumbList().head(); node; node = node->fNext) + // Submit grout triangles, emulated by outerCubic patches. + for (auto* node = path->triangulator->groutList().head(); node; node = node->fNext) { Vec2D triangleAsCubic[4] = {node->fPts[0], node->fPts[1], {0, 0}, node->fPts[2]}; context->pushCubic(triangleAsCubic,
diff --git a/renderer/shaders/tessellate.glsl b/renderer/shaders/tessellate.glsl index 4279f53..33a5447 100644 --- a/renderer/shaders/tessellate.glsl +++ b/renderer/shaders/tessellate.glsl
@@ -248,9 +248,9 @@ else if ((contourIDWithFlags & RETROFITTED_TRIANGLE_FLAG) != 0u) { // This cubic should actually be drawn as the single, non-AA triangle: [p0, p1, p3]. - // This is used to squeeze in more rare triangles, like "breadcrumb" triangles from - // self-intersections on interior triangulation, where it wouldn't be worth it to put them - // in their own dedicated draw call. + // This is used to squeeze in more rare triangles, like "grout" triangles from self + // intersections on interior triangulation, where it wouldn't be worth it to put them in + // their own dedicated draw call. tessCoord = p1; } else