Definition at line 1523 of file SkPolyUtils.cpp.
◆ add()
Definition at line 1555 of file SkPolyUtils.cpp.
1555 {
1556 int index = hash(v);
1557 fGrid[index].addToTail(v);
1558 ++fNumVerts;
1559 }
◆ checkTriangle()
bool ReflexHash::checkTriangle |
( |
const SkPoint & |
p0, |
|
|
const SkPoint & |
p1, |
|
|
const SkPoint & |
p2, |
|
|
uint16_t |
ignoreIndex0, |
|
|
uint16_t |
ignoreIndex1 |
|
) |
| const |
|
inline |
Definition at line 1567 of file SkPolyUtils.cpp.
1568 {
1569 if (!fNumVerts) {
1570 return false;
1571 }
1572
1575 int h0 = (triBounds.
fLeft - fBounds.
fLeft)*fGridConversion.
fX;
1576 int h1 = (triBounds.
fRight - fBounds.
fLeft)*fGridConversion.
fX;
1577 int v0 = (triBounds.
fTop - fBounds.
fTop)*fGridConversion.
fY;
1578 int v1 = (triBounds.
fBottom - fBounds.
fTop)*fGridConversion.
fY;
1579
1580 for (int v = v0; v <= v1; ++v) {
1581 for (
int h = h0;
h <= h1; ++
h) {
1582 int i = v * fHCount +
h;
1584 reflexIter != fGrid[
i].
end(); ++reflexIter) {
1586 if (reflexVertex->
fIndex != ignoreIndex0 &&
1587 reflexVertex->
fIndex != ignoreIndex1 &&
1589 return true;
1590 }
1591 }
1592
1593 }
1594 }
1595
1596 return false;
1597 }
static void compute_triangle_bounds(const SkPoint &p0, const SkPoint &p1, const SkPoint &p2, SkRect *bounds)
static bool point_in_triangle(const SkPoint &p0, const SkPoint &p1, const SkPoint &p2, const SkPoint &p)
static const char * begin(const StringSlice &s)
SkScalar fBottom
larger y-axis bounds
SkScalar fLeft
smaller x-axis bounds
SkScalar fRight
larger x-axis bounds
SkScalar fTop
smaller y-axis bounds
◆ init()
bool ReflexHash::init |
( |
const SkRect & |
bounds, |
|
|
int |
vertexCount |
|
) |
| |
|
inline |
Definition at line 1525 of file SkPolyUtils.cpp.
1525 {
1527 fNumVerts = 0;
1531 return false;
1532 }
1533
1534
1537 return false;
1538 }
1540 fVCount = vertexCount/fHCount;
1544 return false;
1545 }
1546
1547 fGrid.
resize(fHCount*fVCount);
1548 for (
int i = 0;
i < fGrid.
size(); ++
i) {
1550 }
1551
1552 return true;
1553 }
static bool SkIsFinite(T x, Pack... values)
static constexpr float sk_ieee_float_divide(float numer, float denom)
#define SkScalarRoundToInt(x)
static float max(float r, float g, float b)
static float min(float r, float g, float b)
Optional< SkRect > bounds
void set(float x, float y)
◆ remove()
Definition at line 1561 of file SkPolyUtils.cpp.
1561 {
1562 int index = hash(v);
1564 --fNumVerts;
1565 }
void remove(int index, int count=1)
The documentation for this class was generated from the following file: