A utility class to build up a |DlVertices| object one set of data at a time. More...
#include <dl_vertices.h>
Classes | |
| union | Flags |
| flags to indicate/promise which of the optional texture coordinates or colors will be supplied during the build phase. More... | |
Public Member Functions | |
| Builder (DlVertexMode mode, int vertex_count, Flags flags, int index_count) | |
| Constructs a Builder and prepares room for the required and optional data. | |
| bool | is_valid () const |
| Returns true iff the underlying object was successfully allocated. | |
| void | store_vertices (const DlPoint vertices[]) |
| Copies the indicated list of points as vertices. | |
| void | store_vertices (const float coordinates[]) |
| Copies the indicated list of float pairs as vertices. | |
| void | store_texture_coordinates (const DlPoint points[]) |
| Copies the indicated list of points as texture coordinates. | |
| void | store_texture_coordinates (const float coordinates[]) |
| Copies the indicated list of float pairs as texture coordinates. | |
| void | store_colors (const DlColor colors[]) |
| Copies the indicated list of colors as vertex colors. | |
| void | store_colors (const uint32_t colors[]) |
| Copies the indicated list of unsigned ints as vertex colors in the 32-bit RGBA format. | |
| void | store_indices (const uint16_t indices[]) |
| Copies the indicated list of 16-bit indices as vertex indices. | |
| void | store_bounds (DlRect bounds) |
| Overwrite the internal bounds with a precomputed bounding rect. | |
| std::shared_ptr< DlVertices > | build () |
| Finalizes and the constructed DlVertices object. | |
Static Public Attributes | |
| static constexpr Flags | kNone = {{false, false}} |
| static constexpr Flags | kHasTextureCoordinates = {{true, false}} |
| static constexpr Flags | kHasColors = {{false, true}} |
A utility class to build up a |DlVertices| object one set of data at a time.
Definition at line 73 of file dl_vertices.h.
| flutter::DlVertices::Builder::Builder | ( | DlVertexMode | mode, |
| int | vertex_count, | ||
| Flags | flags, | ||
| int | index_count | ||
| ) |
Constructs a Builder and prepares room for the required and optional data.
Vertices are always required. Optional texture coordinates and optional colors are reserved depending on the |Flags|. Optional indices will be reserved if the index_count is positive (>0).
The caller must provide all data that is promised by the supplied |flags| and |index_count| parameters before calling the |build()| method.
Definition at line 207 of file dl_vertices.cc.
References flutter::bytes_needed(), flutter::DlVerticesDeleter(), flutter::DlVertices::index_count(), flutter::DlVertices::mode(), and flutter::DlVertices::vertex_count().
| std::shared_ptr< DlVertices > flutter::DlVertices::Builder::build | ( | ) |
Finalizes and the constructed DlVertices object.
fails if any of the optional data promised in the constructor is missing.
Definition at line 301 of file dl_vertices.cc.
References flutter::compute_bounds(), and FML_DCHECK.
Referenced by flutter::Vertices::init(), flutter::DlVertices::Make(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), impeller::testing::TEST_P(), and impeller::testing::TEST_P().
|
inline |
Returns true iff the underlying object was successfully allocated.
Definition at line 113 of file dl_vertices.h.
Referenced by flutter::Vertices::init(), flutter::testing::TEST(), and flutter::testing::TEST().
| void flutter::DlVertices::Builder::store_bounds | ( | DlRect | bounds | ) |
Overwrite the internal bounds with a precomputed bounding rect.
Definition at line 296 of file dl_vertices.cc.
Referenced by flutter::DlVertices::Make().
| void flutter::DlVertices::Builder::store_colors | ( | const DlColor | colors[] | ) |
Copies the indicated list of colors as vertex colors.
fails if colors have already been supplied or if they were not promised by the flags.has_colors.
Definition at line 266 of file dl_vertices.cc.
References flutter::DlVertices::colors(), and FML_DCHECK.
Referenced by flutter::Vertices::init(), flutter::DlVertices::Make(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), and flutter::testing::TEST().
| void flutter::DlVertices::Builder::store_colors | ( | const uint32_t | colors[] | ) |
Copies the indicated list of unsigned ints as vertex colors in the 32-bit RGBA format.
fails if colors have already been supplied or if they were not promised by the flags.has_colors.
Definition at line 275 of file dl_vertices.cc.
References flutter::DlVertices::colors(), FML_DCHECK, and i.
| void flutter::DlVertices::Builder::store_indices | ( | const uint16_t | indices[] | ) |
Copies the indicated list of 16-bit indices as vertex indices.
fails if indices have already been supplied or if they were not promised by (index_count > 0).
Definition at line 287 of file dl_vertices.cc.
References FML_DCHECK, and flutter::DlVertices::indices().
Referenced by flutter::Vertices::init(), flutter::DlVertices::Make(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), impeller::testing::TEST_P(), and impeller::testing::TEST_P().
| void flutter::DlVertices::Builder::store_texture_coordinates | ( | const DlPoint | points[] | ) |
Copies the indicated list of points as texture coordinates.
fails if texture coordinates have already been supplied or if they were not promised by the flags.has_texture_coordinates.
Definition at line 248 of file dl_vertices.cc.
References FML_DCHECK.
Referenced by flutter::Vertices::init(), flutter::DlVertices::Make(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), impeller::testing::TEST_P(), and impeller::testing::TEST_P().
| void flutter::DlVertices::Builder::store_texture_coordinates | ( | const float | coordinates[] | ) |
Copies the indicated list of float pairs as texture coordinates.
fails if texture coordinates have already been supplied or if they were not promised by the flags.has_texture_coordinates.
Definition at line 257 of file dl_vertices.cc.
References FML_DCHECK, and flutter::store_points().
| void flutter::DlVertices::Builder::store_vertices | ( | const DlPoint | vertices[] | ) |
Copies the indicated list of points as vertices.
fails if vertices have already been supplied.
Definition at line 230 of file dl_vertices.cc.
References FML_DCHECK.
Referenced by flutter::Vertices::init(), flutter::DlVertices::Make(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), impeller::testing::TEST_P(), and impeller::testing::TEST_P().
| void flutter::DlVertices::Builder::store_vertices | ( | const float | coordinates[] | ) |
Copies the indicated list of float pairs as vertices.
fails if vertices have already been supplied.
Definition at line 239 of file dl_vertices.cc.
References FML_DCHECK, and flutter::store_points().
|
staticconstexpr |
Definition at line 96 of file dl_vertices.h.
Referenced by flutter::DlVertices::Make(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), and flutter::testing::TEST().
|
staticconstexpr |
Definition at line 95 of file dl_vertices.h.
Referenced by flutter::DlVertices::Make(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), impeller::testing::TEST_P(), and impeller::testing::TEST_P().
|
staticconstexpr |
Definition at line 94 of file dl_vertices.h.
Referenced by flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), and flutter::testing::TEST().