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

Public Member Functions

bool operator< (const SkClosestRecord &rh) const
 
void addIntersection (SkIntersections *intersections) const
 
void findEnd (const SkTSpan *span1, const SkTSpan *span2, int c1Index, int c2Index)
 
bool matesWith (const SkClosestRecord &mate SkDEBUGPARAMS(SkIntersections *i)) const
 
void merge (const SkClosestRecord &mate)
 
void reset ()
 
void update (const SkClosestRecord &mate)
 

Public Attributes

const SkTSpanfC1Span
 
const SkTSpanfC2Span
 
double fC1StartT
 
double fC1EndT
 
double fC2StartT
 
double fC2EndT
 
double fClosest
 
int fC1Index
 
int fC2Index
 

Detailed Description

Definition at line 1661 of file SkPathOpsTSect.cpp.

Member Function Documentation

◆ addIntersection()

void SkClosestRecord::addIntersection ( SkIntersections intersections) const
inline

Definition at line 1666 of file SkPathOpsTSect.cpp.

1666 {
1667 double r1t = fC1Index ? fC1Span->endT() : fC1Span->startT();
1668 double r2t = fC2Index ? fC2Span->endT() : fC2Span->startT();
1669 intersections->insert(r1t, r2t, fC1Span->part()[fC1Index]);
1670 }
int insert(double one, double two, const SkDPoint &pt)
const SkTCurve & part() const
double endT() const
double startT() const
const SkTSpan * fC1Span
const SkTSpan * fC2Span

◆ findEnd()

void SkClosestRecord::findEnd ( const SkTSpan span1,
const SkTSpan span2,
int  c1Index,
int  c2Index 
)
inline

Definition at line 1672 of file SkPathOpsTSect.cpp.

1673 {
1674 const SkTCurve& c1 = span1->part();
1675 const SkTCurve& c2 = span2->part();
1676 if (!c1[c1Index].approximatelyEqual(c2[c2Index])) {
1677 return;
1678 }
1679 double dist = c1[c1Index].distanceSquared(c2[c2Index]);
1680 if (fClosest < dist) {
1681 return;
1682 }
1683 fC1Span = span1;
1684 fC2Span = span2;
1685 fC1StartT = span1->startT();
1686 fC1EndT = span1->endT();
1687 fC2StartT = span2->startT();
1688 fC2EndT = span2->endT();
1689 fC1Index = c1Index;
1690 fC2Index = c2Index;
1691 fClosest = dist;
1692 }

◆ matesWith()

bool SkClosestRecord::matesWith ( const SkClosestRecord &mate   SkDEBUGPARAMSSkIntersections *i) const
inline

Definition at line 1694 of file SkPathOpsTSect.cpp.

1694 {
1695 SkOPOBJASSERT(i, fC1Span == mate.fC1Span || fC1Span->endT() <= mate.fC1Span->startT()
1696 || mate.fC1Span->endT() <= fC1Span->startT());
1697 SkOPOBJASSERT(i, fC2Span == mate.fC2Span || fC2Span->endT() <= mate.fC2Span->startT()
1698 || mate.fC2Span->endT() <= fC2Span->startT());
1699 return fC1Span == mate.fC1Span || fC1Span->endT() == mate.fC1Span->startT()
1700 || fC1Span->startT() == mate.fC1Span->endT()
1701 || fC2Span == mate.fC2Span
1702 || fC2Span->endT() == mate.fC2Span->startT()
1703 || fC2Span->startT() == mate.fC2Span->endT();
1704 }
#define SkOPOBJASSERT(obj, cond)

◆ merge()

void SkClosestRecord::merge ( const SkClosestRecord mate)
inline

Definition at line 1706 of file SkPathOpsTSect.cpp.

1706 {
1707 fC1Span = mate.fC1Span;
1708 fC2Span = mate.fC2Span;
1709 fClosest = mate.fClosest;
1710 fC1Index = mate.fC1Index;
1711 fC2Index = mate.fC2Index;
1712 }

◆ operator<()

bool SkClosestRecord::operator< ( const SkClosestRecord rh) const
inline

Definition at line 1662 of file SkPathOpsTSect.cpp.

1662 {
1663 return fClosest < rh.fClosest;
1664 }

◆ reset()

void SkClosestRecord::reset ( )
inline

Definition at line 1714 of file SkPathOpsTSect.cpp.

1714 {
1715 fClosest = FLT_MAX;
1716 SkDEBUGCODE(fC1Span = nullptr);
1717 SkDEBUGCODE(fC2Span = nullptr);
1719 }
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()

◆ update()

void SkClosestRecord::update ( const SkClosestRecord mate)
inline

Definition at line 1721 of file SkPathOpsTSect.cpp.

1721 {
1726 }
static float max(float r, float g, float b)
Definition: hsl.cpp:49
static float min(float r, float g, float b)
Definition: hsl.cpp:48

Member Data Documentation

◆ fC1EndT

double SkClosestRecord::fC1EndT

Definition at line 1731 of file SkPathOpsTSect.cpp.

◆ fC1Index

int SkClosestRecord::fC1Index

Definition at line 1735 of file SkPathOpsTSect.cpp.

◆ fC1Span

const SkTSpan* SkClosestRecord::fC1Span

Definition at line 1728 of file SkPathOpsTSect.cpp.

◆ fC1StartT

double SkClosestRecord::fC1StartT

Definition at line 1730 of file SkPathOpsTSect.cpp.

◆ fC2EndT

double SkClosestRecord::fC2EndT

Definition at line 1733 of file SkPathOpsTSect.cpp.

◆ fC2Index

int SkClosestRecord::fC2Index

Definition at line 1736 of file SkPathOpsTSect.cpp.

◆ fC2Span

const SkTSpan* SkClosestRecord::fC2Span

Definition at line 1729 of file SkPathOpsTSect.cpp.

◆ fC2StartT

double SkClosestRecord::fC2StartT

Definition at line 1732 of file SkPathOpsTSect.cpp.

◆ fClosest

double SkClosestRecord::fClosest

Definition at line 1734 of file SkPathOpsTSect.cpp.


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