28 fml::MakeRefCounted<CanvasPathMeasure>();
30 const SkPath& skPath =
path->path().GetSkPath();
31 SkScalar resScale = 1;
33 std::make_unique<SkContourMeasureIter>(skPath, forceClosed, resScale);
35 pathMeasure->path_measure_ = std::make_unique<SkContourMeasureIter>();
40CanvasPathMeasure::CanvasPathMeasure() {}
45 path_measure_->reset(
path->path().GetSkPath(),
isClosed);
49 if (
static_cast<std::vector<sk_sp<SkContourMeasure>
>::size_type>(
50 contour_index) < measures_.size()) {
51 return measures_[contour_index]->length();
58 tonic::Float32List posTan(Dart_NewTypedData(Dart_TypedData_kFloat32, 5));
60 if (
static_cast<std::vector<sk_sp<SkContourMeasure>
>::size_type>(
61 contour_index) >= measures_.size()) {
68 bool success = measures_[contour_index]->getPosTan(fdistance, &pos, &tan);
85 bool start_with_move_to) {
86 if (
static_cast<std::vector<sk_sp<SkContourMeasure>
>::size_type>(
87 contour_index) >= measures_.size()) {
91 bool success = measures_[contour_index]->getSegment(
101 if (
static_cast<std::vector<sk_sp<SkContourMeasure>
>::size_type>(
102 contour_index) < measures_.size()) {
103 return measures_[contour_index]->isClosed();
109 auto measure = path_measure_->next();
111 measures_.push_back(std::move(measure));
static void CreateFrom(Dart_Handle path_handle, const SkPath &src)
static fml::RefPtr< CanvasPath > Create(Dart_Handle wrapper)
~CanvasPathMeasure() override
bool isClosed(int contour_index)
void setPath(const CanvasPath *path, bool isClosed)
void getSegment(Dart_Handle path_handle, int contour_index, double start_d, double stop_d, bool start_with_move_to)
const SkContourMeasureIter & pathMeasure() const
double getLength(int contour_index)
static void Create(Dart_Handle wrapper, const CanvasPath *path, bool forceClosed)
tonic::Float32List getPosTan(int contour_index, double distance)
static void ThrowIfUIOperationsProhibited()
#define IMPLEMENT_WRAPPERTYPEINFO(LibraryName, ClassName)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
static float SafeNarrow(double value)
CanvasPathMeasure PathMeasure