1 // Copyright 2013 The Flutter Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef FLUTTER_LIB_UI_PAINTING_VERTICES_H_ 6 #define FLUTTER_LIB_UI_PAINTING_VERTICES_H_ 7 8 #include "flutter/lib/ui/dart_wrapper.h" 9 #include "third_party/skia/include/core/SkVertices.h" 10 11 namespace tonic { 12 class DartLibraryNatives; 13 } // namespace tonic 14 15 namespace flutter { 16 17 class Vertices : public RefCountedDartWrappable<Vertices> { 18 DEFINE_WRAPPERTYPEINFO(); 19 FML_FRIEND_MAKE_REF_COUNTED(Vertices); 20 21 public: 22 ~Vertices() override; 23 24 static void RegisterNatives(tonic::DartLibraryNatives* natives); 25 26 static fml::RefPtr<Vertices> Create(); 27 28 bool init(SkVertices::VertexMode vertex_mode, 29 const tonic::Float32List& positions, 30 const tonic::Float32List& texture_coordinates, 31 const tonic::Int32List& colors, 32 const tonic::Uint16List& indices); 33 vertices()34 const sk_sp<SkVertices>& vertices() const { return vertices_; } 35 36 private: 37 Vertices(); 38 39 sk_sp<SkVertices> vertices_; 40 }; 41 42 } // namespace flutter 43 44 #endif // FLUTTER_LIB_UI_PAINTING_VERTICES_H_ 45