A utility that generates triangles of the specified fill type given a polyline. This happens on the CPU. More...
#include <tessellator.h>
Public Types | |
| enum | Result { Result::kSuccess, Result::kInputError, Result::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 | |
| Tessellator () | |
| ~Tessellator () | |
| Tessellator::Result | Tessellate (FillType fill_type, const Path::Polyline &polyline, const BuilderCallback &callback) const |
| Generates filled triangles from the polyline. A callback is invoked once for the entire tessellation. More... | |
A utility that generates triangles of the specified fill type given a polyline. This happens on the CPU.
Definition at line 35 of file tessellator.h.
| using impeller::Tessellator::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 54 of file tessellator.h.
|
strong |
| Enumerator | |
|---|---|
| kSuccess | |
| kInputError | |
| kTessellationError | |
Definition at line 37 of file tessellator.h.
| impeller::Tessellator::Tessellator | ( | ) |
Definition at line 34 of file tessellator.cc.
References impeller::DestroyTessellator(), and impeller::kAlloc.
|
default |
| Tessellator::Result impeller::Tessellator::Tessellate | ( | FillType | fill_type, |
| const Path::Polyline & | polyline, | ||
| const BuilderCallback & | callback | ||
| ) | const |
Generates filled triangles from the polyline. A callback is invoked once for the entire tessellation.
| [in] | fill_type | The fill rule to use when filling. |
| [in] | polyline | The polyline |
| [in] | callback | The callback, return false to indicate failure. |
Feed contour information to the tessellator.
Let's tessellate.
Definition at line 61 of file tessellator.cc.
References impeller::Path::Polyline::contours, impeller::Path::Polyline::GetContourPointBounds(), kInputError, kSuccess, kTessellationError, impeller::Path::Polyline::points, and impeller::ToTessWindingRule().
Referenced by impeller::BM_Polyline(), impeller::Tessellate(), impeller::testing::TEST(), and impeller::testing::TEST_P().