Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Macros | Functions
SkPathOpsTSect.cpp File Reference
#include "src/pathops/SkPathOpsTSect.h"
#include "include/private/base/SkMacros.h"
#include "include/private/base/SkTArray.h"
#include "src/base/SkTSort.h"
#include "src/pathops/SkIntersections.h"
#include "src/pathops/SkPathOpsConic.h"
#include "src/pathops/SkPathOpsCubic.h"
#include "src/pathops/SkPathOpsLine.h"
#include "src/pathops/SkPathOpsQuad.h"
#include <cfloat>
#include <algorithm>
#include <array>
#include <cmath>

Go to the source code of this file.

Classes

struct  SkClosestRecord
 
struct  SkClosestSect
 

Macros

#define COINCIDENT_SPAN_COUNT   9
 

Functions

template<typename SkTCurve >
static bool is_parallel (const SkDLine &thisLine, const SkTCurve &opp)
 

Macro Definition Documentation

◆ COINCIDENT_SPAN_COUNT

#define COINCIDENT_SPAN_COUNT   9

Definition at line 26 of file SkPathOpsTSect.cpp.

Function Documentation

◆ is_parallel()

template<typename SkTCurve >
static bool is_parallel ( const SkDLine thisLine,
const SkTCurve opp 
)
static

Definition at line 1054 of file SkPathOpsTSect.cpp.

1054 {
1055 if (!opp.IsConic()) {
1056 return false; // FIXME : breaks a lot of stuff now
1057 }
1058 int finds = 0;
1059 SkDLine thisPerp;
1060 thisPerp.fPts[0].fX = thisLine.fPts[1].fX + (thisLine.fPts[1].fY - thisLine.fPts[0].fY);
1061 thisPerp.fPts[0].fY = thisLine.fPts[1].fY + (thisLine.fPts[0].fX - thisLine.fPts[1].fX);
1062 thisPerp.fPts[1] = thisLine.fPts[1];
1063 SkIntersections perpRayI;
1064 perpRayI.intersectRay(opp, thisPerp);
1065 for (int pIndex = 0; pIndex < perpRayI.used(); ++pIndex) {
1066 finds += perpRayI.pt(pIndex).approximatelyEqual(thisPerp.fPts[1]);
1067 }
1068 thisPerp.fPts[1].fX = thisLine.fPts[0].fX + (thisLine.fPts[1].fY - thisLine.fPts[0].fY);
1069 thisPerp.fPts[1].fY = thisLine.fPts[0].fY + (thisLine.fPts[0].fX - thisLine.fPts[1].fX);
1070 thisPerp.fPts[0] = thisLine.fPts[0];
1071 perpRayI.intersectRay(opp, thisPerp);
1072 for (int pIndex = 0; pIndex < perpRayI.used(); ++pIndex) {
1073 finds += perpRayI.pt(pIndex).approximatelyEqual(thisPerp.fPts[0]);
1074 }
1075 return finds >= 2;
1076}
int intersectRay(const SkDLine &, const SkDLine &)
const SkDPoint & pt(int index) const
virtual bool IsConic() const =0
SkDPoint fPts[2]
bool approximatelyEqual(const SkDPoint &a) const