Skip to content

Commit

Permalink
Correct the vertex count in 'TextureContents' (flutter#36891)
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdPaleLight authored Oct 20, 2022
1 parent 471ba0a commit a441164
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion impeller/entity/contents/texture_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ bool TextureContents::Render(const ContentContext& renderer,
[this, &vertex_builder, &coverage_rect, &texture_size](
const float* vertices, size_t vertices_size,
const uint16_t* indices, size_t indices_size) {
for (auto i = 0u; i < vertices_size; i++) {
for (auto i = 0u; i < vertices_size; i += 2) {
VS::PerVertexData data;
Point vtx = {vertices[i], vertices[i + 1]};
data.position = vtx;
Expand All @@ -133,6 +133,7 @@ bool TextureContents::Render(const ContentContext& renderer,
texture_size;
vertex_builder.AppendVertex(data);
}
FML_DCHECK(vertex_builder.GetVertexCount() == vertices_size / 2);
for (auto i = 0u; i < indices_size; i++) {
vertex_builder.AppendIndex(indices[i]);
}
Expand Down

0 comments on commit a441164

Please sign in to comment.