Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
SkClosestSect Struct Reference

Public Member Functions

 SkClosestSect ()
 
bool find (const SkTSpan *span1, const SkTSpan *span2 SkDEBUGPARAMS(SkIntersections *i))
 
void finish (SkIntersections *intersections) const
 

Public Attributes

STArray< SkDCubic::kMaxIntersections *2, SkClosestRecord, truefClosest
 
int fUsed
 

Detailed Description

Definition at line 1739 of file SkPathOpsTSect.cpp.

Constructor & Destructor Documentation

◆ SkClosestSect()

SkClosestSect::SkClosestSect ( )
inline

Definition at line 1740 of file SkPathOpsTSect.cpp.

1741 : fUsed(0) {
1743 }
STArray< SkDCubic::kMaxIntersections *2, SkClosestRecord, true > fClosest

Member Function Documentation

◆ find()

bool SkClosestSect::find ( const SkTSpan span1,
const SkTSpan *span2   SkDEBUGPARAMSSkIntersections *i 
)
inline

Definition at line 1745 of file SkPathOpsTSect.cpp.

1746 {
1747 SkClosestRecord* record = &fClosest[fUsed];
1748 record->findEnd(span1, span2, 0, 0);
1749 record->findEnd(span1, span2, 0, span2->part().pointLast());
1750 record->findEnd(span1, span2, span1->part().pointLast(), 0);
1751 record->findEnd(span1, span2, span1->part().pointLast(), span2->part().pointLast());
1752 if (record->fClosest == FLT_MAX) {
1753 return false;
1754 }
1755 for (int index = 0; index < fUsed; ++index) {
1756 SkClosestRecord* test = &fClosest[index];
1757 if (test->matesWith(*record SkDEBUGPARAMS(i))) {
1758 if (test->fClosest > record->fClosest) {
1759 test->merge(*record);
1760 }
1761 test->update(*record);
1762 record->reset();
1763 return false;
1764 }
1765 }
1766 ++fUsed;
1768 return true;
1769 }
#define SkDEBUGPARAMS(...)
virtual int pointLast() const =0
const SkTCurve & part() const
void findEnd(const SkTSpan *span1, const SkTSpan *span2, int c1Index, int c2Index)

◆ finish()

void SkClosestSect::finish ( SkIntersections intersections) const
inline

Definition at line 1771 of file SkPathOpsTSect.cpp.

1771 {
1773 const SkClosestRecord*, true> closestPtrs;
1774 for (int index = 0; index < fUsed; ++index) {
1775 closestPtrs.push_back(&fClosest[index]);
1776 }
1777 SkTQSort<const SkClosestRecord>(closestPtrs.begin(), closestPtrs.end());
1778 for (int index = 0; index < fUsed; ++index) {
1779 const SkClosestRecord* test = closestPtrs[index];
1780 test->addIntersection(intersections);
1781 }
1782 }
static const int kMaxIntersections

Member Data Documentation

◆ fClosest

STArray<SkDCubic::kMaxIntersections * 2, SkClosestRecord, true> SkClosestSect::fClosest

Definition at line 1785 of file SkPathOpsTSect.cpp.

◆ fUsed

int SkClosestSect::fUsed

Definition at line 1786 of file SkPathOpsTSect.cpp.


The documentation for this struct was generated from the following file: