#include <path_measure.h>
Definition at line 21 of file path_measure.h.
◆ ~CanvasPathMeasure()
flutter::CanvasPathMeasure::~CanvasPathMeasure |
( |
| ) |
|
|
override |
◆ Create()
void flutter::CanvasPathMeasure::Create |
( |
Dart_Handle |
wrapper, |
|
|
const CanvasPath * |
path, |
|
|
bool |
forceClosed |
|
) |
| |
|
static |
Definition at line 23 of file path_measure.cc.
25 {
28 fml::MakeRefCounted<CanvasPathMeasure>();
33 std::make_unique<SkContourMeasureIter>(skPath, forceClosed, resScale);
34 } else {
35 pathMeasure->path_measure_ = std::make_unique<SkContourMeasureIter>();
36 }
38}
const SkContourMeasureIter & pathMeasure() const
static void ThrowIfUIOperationsProhibited()
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
◆ getLength()
double flutter::CanvasPathMeasure::getLength |
( |
int |
contour_index | ) |
|
Definition at line 49 of file path_measure.cc.
49 {
50 if (static_cast<std::vector<sk_sp<SkContourMeasure>>::size_type>(
51 contour_index) < measures_.size()) {
52 return measures_[contour_index]->length();
53 }
54 return -1;
55}
◆ getPosTan()
tonic::Float32List flutter::CanvasPathMeasure::getPosTan |
( |
int |
contour_index, |
|
|
double |
distance |
|
) |
| |
Definition at line 57 of file path_measure.cc.
58 {
60 posTan[0] = 0;
61 if (static_cast<std::vector<sk_sp<SkContourMeasure>>::size_type>(
62 contour_index) >= measures_.size()) {
63 return posTan;
64 }
65
69 bool success = measures_[contour_index]->getPosTan(fdistance, &
pos, &tan);
70
71 if (success) {
72 posTan[0] = 1;
77 }
78
79 return posTan;
80}
@ Dart_TypedData_kFloat32
DART_EXPORT Dart_Handle Dart_NewTypedData(Dart_TypedData_Type type, intptr_t length)
static float SafeNarrow(double value)
constexpr float y() const
constexpr float x() const
◆ getSegment()
void flutter::CanvasPathMeasure::getSegment |
( |
Dart_Handle |
path_handle, |
|
|
int |
contour_index, |
|
|
double |
start_d, |
|
|
double |
stop_d, |
|
|
bool |
start_with_move_to |
|
) |
| |
Definition at line 82 of file path_measure.cc.
86 {
87 if (static_cast<std::vector<sk_sp<SkContourMeasure>>::size_type>(
88 contour_index) >= measures_.size()) {
90 }
92 bool success = measures_[contour_index]->getSegment(
94 if (!success) {
96 } else {
98 }
99}
static void CreateFrom(Dart_Handle path_handle, const SkPath &src)
static fml::RefPtr< CanvasPath > Create(Dart_Handle wrapper)
◆ isClosed()
bool flutter::CanvasPathMeasure::isClosed |
( |
int |
contour_index | ) |
|
Definition at line 101 of file path_measure.cc.
101 {
102 if (static_cast<std::vector<sk_sp<SkContourMeasure>>::size_type>(
103 contour_index) < measures_.size()) {
104 return measures_[contour_index]->isClosed();
105 }
106 return false;
107}
◆ nextContour()
bool flutter::CanvasPathMeasure::nextContour |
( |
| ) |
|
Definition at line 109 of file path_measure.cc.
109 {
110 auto measure = path_measure_->next();
111 if (measure) {
112 measures_.push_back(std::move(measure));
113 return true;
114 }
115 return false;
116}
◆ pathMeasure()
◆ setPath()
void flutter::CanvasPathMeasure::setPath |
( |
const CanvasPath * |
path, |
|
|
bool |
isClosed |
|
) |
| |
Definition at line 44 of file path_measure.cc.
44 {
46 path_measure_->reset(skPath,
isClosed);
47}
bool isClosed(int contour_index)
The documentation for this class was generated from the following files: