lullaby/tests/nine_patch_test.cc
// Creates a mesh that wraps around the nine patch's vertex and index data
// vectors.
Creates a mesh that wraps around the nine patch's vertex and index data
vectors.
Creates a mesh that wraps around the nine patch ' s vertex and index data vectors .
MeshData BuildMeshFromNinePatchVerticesAndIndices(
    std::vector<VertexPTT>* nine_patch_vertices,
    std::vector<uint16_t>* nine_patch_indices) {
  DataContainer::DataPtr vertex_data_ptr(
      reinterpret_cast<uint8_t*>(nine_patch_vertices->data()),
      [](const uint8_t* ptr) {});
  DataContainer vertex_data(std::move(vertex_data_ptr),
                            nine_patch_vertices->size() * sizeof(VertexPTT),
                            DataContainer::AccessFlags::kAll);
  DataContainer::DataPtr index_data_ptr(
      reinterpret_cast<uint8_t*>(nine_patch_indices->data()),
      [](const uint8_t* ptr) {});
  DataContainer index_data(std::move(index_data_ptr),
                           nine_patch_indices->size() * sizeof(uint16_t),
                           DataContainer::AccessFlags::kAll);
  return MeshData(lull::MeshData::PrimitiveType::kTriangles,
                  lull::VertexPTT::kFormat, std::move(vertex_data),
                  MeshData::kIndexU16, std::move(index_data));
}
MeshData BuildMeshFromNinePatchVerticesAndIndices ( std :: vector < VertexPTT > * nine_patch_vertices , std :: vector < uint16_t > * nine_patch_indices ) { DataContainer :: DataPtr vertex_data_ptr ( reinterpret_cast < uint8_t * > ( nine_patch_vertices -> data ( ) ) , [ ] ( const uint8_t * ptr ) { } ) ; DataContainer vertex_data ( std :: move ( vertex_data_ptr ) , nine_patch_vertices -> size ( ) * sizeof ( VertexPTT ) , DataContainer :: AccessFlags :: kAll ) ; DataContainer :: DataPtr index_data_ptr ( reinterpret_cast < uint8_t * > ( nine_patch_indices -> data ( ) ) , [ ] ( const uint8_t * ptr ) { } ) ; DataContainer index_data ( std :: move ( index_data_ptr ) , nine_patch_indices -> size ( ) * sizeof ( uint16_t ) , DataContainer :: AccessFlags :: kAll ) ; return MeshData ( lull :: MeshData :: PrimitiveType :: kTriangles , lull :: VertexPTT :: kFormat , std :: move ( vertex_data ) , MeshData :: kIndexU16 , std :: move ( index_data ) ) ; }
Creates a mesh that wraps around the nine patch's vertex and index data
vectors.
Creates a mesh that wraps around the nine patch ' s vertex and index data vectors .
// Data is managed by the vector. // Data is managed by the vector.