An extended tessellator that offers arbitrary/concave tessellation via the libtess2 library. More...
#include <tessellator_libtess.h>
Public Types | |
enum class | Result { kSuccess , kInputError , kTessellationError } |
using | BuilderCallback = std::function< bool(const float *vertices, size_t vertices_count, const uint16_t *indices, size_t indices_count)> |
A callback that returns the results of the tessellation. More... | |
Public Member Functions | |
TessellatorLibtess () | |
~TessellatorLibtess () | |
TessellatorLibtess::Result | Tessellate (const PathSource &source, Scalar tolerance, const BuilderCallback &callback) |
Generates filled triangles from the path. A callback is invoked once for the entire tessellation. More... | |
An extended tessellator that offers arbitrary/concave tessellation via the libtess2 library.
This object is not thread safe, and its methods must not be called from multiple threads.
Definition at line 29 of file tessellator_libtess.h.
using impeller::TessellatorLibtess::BuilderCallback = std::function<bool(const float* vertices, size_t vertices_count, const uint16_t* indices, size_t indices_count)> |
A callback that returns the results of the tessellation.
The index buffer may not be populated, in which case [indices] will be nullptr and indices_count will be 0.
Definition at line 45 of file tessellator_libtess.h.
|
strong |
Enumerator | |
---|---|
kSuccess | |
kInputError | |
kTessellationError |
Definition at line 35 of file tessellator_libtess.h.
impeller::TessellatorLibtess::TessellatorLibtess | ( | ) |
Definition at line 35 of file tessellator_libtess.cc.
References impeller::DestroyTessellator(), and impeller::kAlloc.
|
default |
TessellatorLibtess::Result impeller::TessellatorLibtess::Tessellate | ( | const PathSource & | source, |
Scalar | tolerance, | ||
const BuilderCallback & | callback | ||
) |
Generates filled triangles from the path. A callback is invoked once for the entire tessellation.
[in] | source | The path source to tessellate. |
[in] | tolerance | The tolerance value for conversion of the path to a polyline. This value is often derived from the Matrix::GetMaxBasisLength of the CTM applied to the path for rendering. |
[in] | callback | The callback, return false to indicate failure. |
Feed contour information to the tessellator.
Let's tessellate.
Definition at line 85 of file tessellator_libtess.cc.
References data, impeller::PathSource::GetFillType(), kInputError, kSuccess, kTessellationError, impeller::PathTessellator::PathToFilledVertices(), points, impeller::ToTessWindingRule(), and x.
Referenced by impeller::Tessellate(), and impeller::testing::TEST().