28 contours.closeContourIfNeeded();
29 contours.moveToStartOfContour(pts[0]);
32 contours.addPointToCurrentContour(pts[1]);
44 contours.closeContourIfNeeded();
48 SK_ABORT(
"The while loop above failed.");
53 contours.closeContourIfNeeded();
67 return {left, top, right, bottom};
74bool Contours::currentContourIsEmpty()
const {
75 int32_t lastEnd = fContours.empty() ? 0 : fContours.back().end;
76 return lastEnd ==
SkToS32(fPoints.size());
79void Contours::addPointToCurrentContour(
SkPoint p) {
80 if (this->currentContourIsEmpty()) {
81 fPoints.push_back(fContourStart);
82 fContourBounds =
extend_rect(fContourBounds, fContourStart);
84 Point point = RoundSkPoint(
p);
85 fPoints.push_back(point);
86 fContourBounds =
extend_rect(fContourBounds, point);
89void Contours::moveToStartOfContour(
SkPoint p) {
90 fContourStart = RoundSkPoint(
p);
93void Contours::closeContourIfNeeded() {
94 if (this->currentContourIsEmpty()) {
98 fContours.push_back({fContourBounds,
SkToS32(fPoints.size())});
99 fContourBounds = kEmptyRect;
#define SK_ABORT(message,...)
#define SkScalarRoundToInt(x)
constexpr int32_t SkToS32(S x)
Verb next(SkPoint pts[4])
std::vector< myers::Segment > segments() const
static constexpr double kScaleFactor
static Contours Make(SkPath path)
static float max(float r, float g, float b)
static float min(float r, float g, float b)
static SkIRect extend_rect(SkIRect r, Point p)
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
int32_t fBottom
larger y-axis bounds
int32_t fTop
smaller y-axis bounds
int32_t fLeft
smaller x-axis bounds
int32_t fRight
larger x-axis bounds