Flutter Engine
The Flutter Engine
|
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. More... | |
bool | is_valid () |
Returns true iff the underlying object was successfully allocated. More... | |
void | store_vertices (const SkPoint points[]) |
Copies the indicated list of points as vertices. More... | |
void | store_vertices (const float coordinates[]) |
Copies the indicated list of float pairs as vertices. More... | |
void | store_texture_coordinates (const SkPoint points[]) |
Copies the indicated list of points as texture coordinates. More... | |
void | store_texture_coordinates (const float coordinates[]) |
Copies the indicated list of float pairs as texture coordinates. More... | |
void | store_colors (const DlColor colors[]) |
Copies the indicated list of colors as vertex colors. More... | |
void | store_colors (const uint32_t colors[]) |
Copies the indicated list of unsigned ints as vertex colors in the 32-bit RGBA format. More... | |
void | store_indices (const uint16_t indices[]) |
Copies the indicated list of 16-bit indices as vertex indices. More... | |
std::shared_ptr< DlVertices > | build () |
Finalizes and the constructed DlVertices object. More... | |
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 75 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 202 of file dl_vertices.cc.
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 279 of file dl_vertices.cc.
|
inline |
Returns true iff the underlying object was successfully allocated.
Definition at line 115 of file dl_vertices.h.
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 261 of file dl_vertices.cc.
|
inline |
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 150 of file dl_vertices.h.
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 270 of file dl_vertices.cc.
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 252 of file dl_vertices.cc.
void flutter::DlVertices::Builder::store_texture_coordinates | ( | const SkPoint | 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 243 of file dl_vertices.cc.
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 234 of file dl_vertices.cc.
void flutter::DlVertices::Builder::store_vertices | ( | const SkPoint | points[] | ) |
Copies the indicated list of points as vertices.
fails if vertices have already been supplied.
Definition at line 225 of file dl_vertices.cc.
Definition at line 98 of file dl_vertices.h.
|
staticconstexpr |
Definition at line 97 of file dl_vertices.h.
|
staticconstexpr |
Definition at line 96 of file dl_vertices.h.