Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
contour::Contours Class Reference

#include <Contour.h>

Public Member Functions

Contour operator[] (size_t i) const
 
Iterator begin () const
 
Iterator end () const
 
size_t size () const
 
bool empty () const
 
std::vector< myers::Segmentsegments () const
 

Static Public Member Functions

static Contours Make (SkPath path)
 

Static Public Attributes

static constexpr double kScaleFactor = 1024
 

Detailed Description

Definition at line 33 of file Contour.h.

Member Function Documentation

◆ begin()

Iterator contour::Contours::begin ( ) const
inline

Definition at line 70 of file Contour.h.

70 {
71 return Iterator{*this, 0};
72 }

◆ empty()

bool contour::Contours::empty ( ) const
inline

Definition at line 82 of file Contour.h.

82 {
83 return fContours.empty();
84 }

◆ end()

Iterator contour::Contours::end ( ) const
inline

Definition at line 74 of file Contour.h.

74 {
75 return Iterator{*this, fContours.size()};
76 }

◆ Make()

Contours contour::Contours::Make ( SkPath  path)
static

Definition at line 16 of file Contour.cpp.

16 {
17 SkPoint pts[4];
18 SkPath::Iter iter(path, false);
19 SkPath::Verb verb;
20 Contours contours;
21 while ((verb = iter.next(pts)) != SkPath::kDone_Verb) {
22 switch (verb) {
24 SK_ABORT("Not implemented");
25 break;
26 }
28 contours.closeContourIfNeeded();
29 contours.moveToStartOfContour(pts[0]);
30 break;
31 case SkPath::kLine_Verb: {
32 contours.addPointToCurrentContour(pts[1]);
33 break;
34 }
35 case SkPath::kQuad_Verb: {
36 SK_ABORT("Not implemented");
37 break;
38 }
40 SK_ABORT("Not implemented");
41 break;
42 }
44 contours.closeContourIfNeeded();
45 break;
46 }
48 SK_ABORT("The while loop above failed.");
49 }
50 }
51
52 // Close the remaining contour.
53 contours.closeContourIfNeeded();
54
55 return contours;
56}
#define SK_ABORT(message,...)
Definition SkAssert.h:70
@ kClose_Verb
Definition SkPath.h:1463
@ kMove_Verb
Definition SkPath.h:1458
@ kConic_Verb
Definition SkPath.h:1461
@ kDone_Verb
Definition SkPath.h:1464
@ kCubic_Verb
Definition SkPath.h:1462
@ kQuad_Verb
Definition SkPath.h:1460
@ kLine_Verb
Definition SkPath.h:1459

◆ operator[]()

Contour contour::Contours::operator[] ( size_t  i) const
inline

Definition at line 62 of file Contour.h.

62 {
63 SkASSERT(i < fContours.size());
64 auto& [bounds, end] = fContours[i];
65 int32_t start = i == 0 ? 0 : fContours[i-1].end;
67 return {points, bounds};
68 }
static const int points[]
#define SkASSERT(cond)
Definition SkAssert.h:116
Iterator end() const
Definition Contour.h:74
Optional< SkRect > bounds
Definition SkRecords.h:189

◆ segments()

std::vector< myers::Segment > contour::Contours::segments ( ) const

Definition at line 58 of file Contour.cpp.

58 {
59 SK_ABORT("Not implemented");
60}

◆ size()

size_t contour::Contours::size ( ) const
inline

Definition at line 78 of file Contour.h.

78 {
79 return fContours.size();
80 }

Member Data Documentation

◆ kScaleFactor

constexpr double contour::Contours::kScaleFactor = 1024
staticconstexpr

Definition at line 59 of file Contour.h.


The documentation for this class was generated from the following files: