Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 16cc78b

Browse files
committed
++
1 parent 3fb1fc4 commit 16cc78b

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

display_list/dl_vertices.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,15 @@ void DlVertices::Builder::store_colors(const DlColor colors[]) {
267267
needs_colors_ = false;
268268
}
269269

270+
void DlVertices::Builder::store_colors(const uint32_t colors[]) {
271+
std::vector<DlColor> dlcolors;
272+
dlcolors.reserve(vertices_->vertex_count_);
273+
for (int i = 0; i < vertices_->vertex_count_; ++i) {
274+
dlcolors.emplace_back(DlColor(colors[i]));
275+
}
276+
store_colors(dlcolors.data());
277+
}
278+
270279
void DlVertices::Builder::store_indices(const uint16_t indices[]) {
271280
FML_CHECK(is_valid());
272281
FML_CHECK(needs_indices_);

display_list/dl_vertices.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,7 @@ class DlVertices {
147147
///
148148
/// fails if colors have already been supplied or if they were not
149149
/// promised by the flags.has_colors.
150-
void store_colors(const uint32_t colors[]) {
151-
store_colors(reinterpret_cast<const DlColor*>(colors));
152-
}
150+
void store_colors(const uint32_t colors[]);
153151

154152
/// @brief Copies the indicated list of 16-bit indices as vertex indices.
155153
///

0 commit comments

Comments
 (0)