5#ifndef FLUTTER_DISPLAY_LIST_DL_VERTICES_H_
6#define FLUTTER_DISPLAY_LIST_DL_VERTICES_H_
10#include "flutter/display_list/dl_color.h"
164 std::shared_ptr<DlVertices>
build();
167 std::shared_ptr<DlVertices> vertices_;
168 bool needs_vertices_ =
true;
169 bool needs_texture_coords_;
188 const uint16_t
indices[] =
nullptr);
206 return static_cast<const SkPoint*
>(pod(vertices_offset_));
212 return static_cast<const SkPoint*
>(pod(texture_coordinates_offset_));
218 return static_cast<const DlColor*
>(pod(colors_offset_));
228 return static_cast<const uint16_t*
>(pod(indices_offset_));
265 size_t vertices_offset_;
266 size_t texture_coordinates_offset_;
267 size_t colors_offset_;
270 size_t indices_offset_;
274 const void* pod(
int offset)
const {
278 const void*
base =
static_cast<const void*
>(
this);
279 return static_cast<const char*
>(
base) +
offset;
static const int points[]
A utility class to build up a |DlVertices| object one set of data at a time.
void store_texture_coordinates(const SkPoint points[])
Copies the indicated list of points as texture coordinates.
void store_vertices(const SkPoint points[])
Copies the indicated list of points as vertices.
Builder(DlVertexMode mode, int vertex_count, Flags flags, int index_count)
Constructs a Builder and prepares room for the required and optional data.
void store_indices(const uint16_t indices[])
Copies the indicated list of 16-bit indices as vertex indices.
static constexpr Flags kNone
std::shared_ptr< DlVertices > build()
Finalizes and the constructed DlVertices object.
bool is_valid()
Returns true iff the underlying object was successfully allocated.
static constexpr Flags kHasColors
void store_colors(const DlColor colors[])
Copies the indicated list of colors as vertex colors.
static constexpr Flags kHasTextureCoordinates
void store_colors(const uint32_t colors[])
Copies the indicated list of unsigned ints as vertex colors in the 32-bit RGBA format.
Holds all of the data (both required and optional) for a DisplayList drawVertices call.
SkRect bounds() const
Returns the bounds of the vertices.
static std::shared_ptr< DlVertices > Make(DlVertexMode mode, int vertex_count, const SkPoint vertices[], const SkPoint texture_coordinates[], const DlColor colors[], int index_count=0, const uint16_t indices[]=nullptr)
Constructs a DlVector with compact inline storage for all of its required and optional lists of data.
const DlColor * colors() const
DlVertexMode mode() const
bool operator==(DlVertices const &other) const
bool operator!=(DlVertices const &other) const
const SkPoint * vertices() const
Returns a pointer to the vertex information. Should be non-null.
size_t size() const
Returns the size of the object including all of the inlined data.
const uint16_t * indices() const
const SkPoint * texture_coordinates() const
FlutterSemanticsFlag flags
DlVertexMode
Defines the way in which the vertices of a DlVertices object are separated into triangles into which ...
@ kTriangles
The vertices are taken 3 at a time to form a triangle.
flags to indicate/promise which of the optional texture coordinates or colors will be supplied during...
Flags operator|(const Flags &rhs) const
unsigned has_texture_coordinates
Flags & operator|=(const Flags &rhs)