5#include "flutter/lib/ui/painting/path_measure.h"
9#include "flutter/lib/ui/floating_point.h"
10#include "flutter/lib/ui/painting/matrix.h"
11#include "flutter/lib/ui/ui_dart_state.h"
28 fml::MakeRefCounted<CanvasPathMeasure>();
33 std::make_unique<SkContourMeasureIter>(skPath, forceClosed, resScale);
35 pathMeasure->path_measure_ = std::make_unique<SkContourMeasureIter>();
40CanvasPathMeasure::CanvasPathMeasure() {}
46 path_measure_->reset(skPath,
isClosed);
50 if (
static_cast<std::vector<sk_sp<SkContourMeasure>
>::size_type>(
51 contour_index) < measures_.size()) {
52 return measures_[contour_index]->length();
61 if (
static_cast<std::vector<sk_sp<SkContourMeasure>
>::size_type>(
62 contour_index) >= measures_.size()) {
69 bool success = measures_[contour_index]->getPosTan(fdistance, &
pos, &tan);
86 bool start_with_move_to) {
87 if (
static_cast<std::vector<sk_sp<SkContourMeasure>
>::size_type>(
88 contour_index) >= measures_.size()) {
92 bool success = measures_[contour_index]->getSegment(
102 if (
static_cast<std::vector<sk_sp<SkContourMeasure>
>::size_type>(
103 contour_index) < measures_.size()) {
104 return measures_[contour_index]->isClosed();
110 auto measure = path_measure_->next();
112 measures_.push_back(std::move(measure));
~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 CreateFrom(Dart_Handle path_handle, const SkPath &src)
static fml::RefPtr< CanvasPath > Create(Dart_Handle wrapper)
static void ThrowIfUIOperationsProhibited()
struct _Dart_Handle * Dart_Handle
@ Dart_TypedData_kFloat32
DART_EXPORT Dart_Handle Dart_NewTypedData(Dart_TypedData_Type type, intptr_t length)
IMPLEMENT_WRAPPERTYPEINFO(flutter_gpu, FlutterGpuTestClass)
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
constexpr float y() const
constexpr float x() const