7 #include "display_list/dl_vertices.h"
11 #include "third_party/skia/include/core/SkPoint.h"
12 #include "third_party/skia/include/core/SkRect.h"
17 return Rect::MakeLTRB(rect.fLeft, rect.fTop, rect.fRight, rect.fBottom);
22 case flutter::DlVertexMode::kTriangles:
24 case flutter::DlVertexMode::kTriangleStrip:
26 case flutter::DlVertexMode::kTriangleFan:
32 const flutter::DlVertices* vertices) {
33 auto bounds =
ToRect(vertices->bounds());
35 std::vector<Point> positions(vertices->vertex_count());
36 for (
auto i = 0; i < vertices->vertex_count(); i++) {
40 std::vector<uint16_t> indices(vertices->index_count());
41 for (
auto i = 0; i < vertices->index_count(); i++) {
42 indices[i] = vertices->indices()[i];
45 std::vector<Color> colors;
46 if (vertices->colors()) {
47 colors.reserve(vertices->vertex_count());
48 for (
auto i = 0; i < vertices->vertex_count(); i++) {
53 std::vector<Point> texture_coordinates;
54 if (vertices->texture_coordinates()) {
55 texture_coordinates.reserve(vertices->vertex_count());
56 for (
auto i = 0; i < vertices->vertex_count(); i++) {
57 texture_coordinates.push_back(
61 return std::make_shared<VerticesGeometry>(
62 positions, indices, texture_coordinates, colors, bounds, mode);