Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2012 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
#ifndef SkIntersections_DEFINE
|
|
|
|
#define SkIntersections_DEFINE
|
|
|
|
|
2015-04-20 15:31:59 +00:00
|
|
|
#include "SkPathOpsConic.h"
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
#include "SkPathOpsCubic.h"
|
|
|
|
#include "SkPathOpsLine.h"
|
|
|
|
#include "SkPathOpsPoint.h"
|
|
|
|
#include "SkPathOpsQuad.h"
|
|
|
|
|
|
|
|
class SkIntersections {
|
|
|
|
public:
|
|
|
|
SkIntersections()
|
|
|
|
: fSwap(0)
|
|
|
|
#ifdef SK_DEBUG
|
|
|
|
, fDepth(0)
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
sk_bzero(fPt, sizeof(fPt));
|
2014-06-17 12:15:38 +00:00
|
|
|
sk_bzero(fPt2, sizeof(fPt2));
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
sk_bzero(fT, sizeof(fT));
|
2014-06-17 12:15:38 +00:00
|
|
|
sk_bzero(fNearlySame, sizeof(fNearlySame));
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
reset();
|
2013-10-02 14:49:34 +00:00
|
|
|
fMax = 0; // require that the caller set the max
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class TArray {
|
|
|
|
public:
|
2015-03-26 14:52:43 +00:00
|
|
|
explicit TArray(const double ts[10]) : fTArray(ts) {}
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
double operator[](int n) const {
|
|
|
|
return fTArray[n];
|
|
|
|
}
|
|
|
|
const double* fTArray;
|
|
|
|
};
|
|
|
|
TArray operator[](int n) const { return TArray(fT[n]); }
|
|
|
|
|
2013-07-15 13:29:13 +00:00
|
|
|
void allowNear(bool nearAllowed) {
|
|
|
|
fAllowNear = nearAllowed;
|
|
|
|
}
|
|
|
|
|
2015-03-26 14:52:43 +00:00
|
|
|
void clearCoincidence(int index) {
|
|
|
|
SkASSERT(index >= 0);
|
|
|
|
int bit = 1 << index;
|
|
|
|
fIsCoincident[0] &= ~bit;
|
|
|
|
fIsCoincident[1] &= ~bit;
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
}
|
|
|
|
|
2015-04-20 15:31:59 +00:00
|
|
|
int conicHorizontal(const SkPoint a[3], SkScalar weight, SkScalar left, SkScalar right,
|
|
|
|
SkScalar y, bool flipped) {
|
|
|
|
SkDConic conic;
|
|
|
|
conic.set(a, weight);
|
|
|
|
fMax = 2;
|
|
|
|
return horizontal(conic, left, right, y, flipped);
|
|
|
|
}
|
|
|
|
|
|
|
|
int conicVertical(const SkPoint a[3], SkScalar weight, SkScalar top, SkScalar bottom,
|
|
|
|
SkScalar x, bool flipped) {
|
|
|
|
SkDConic conic;
|
|
|
|
conic.set(a, weight);
|
|
|
|
fMax = 2;
|
|
|
|
return vertical(conic, top, bottom, x, flipped);
|
|
|
|
}
|
|
|
|
|
|
|
|
int conicLine(const SkPoint a[3], SkScalar weight, const SkPoint b[2]) {
|
|
|
|
SkDConic conic;
|
|
|
|
conic.set(a, weight);
|
|
|
|
SkDLine line;
|
|
|
|
line.set(b);
|
|
|
|
fMax = 3; // 2; permit small coincident segment + non-coincident intersection
|
|
|
|
return intersect(conic, line);
|
|
|
|
}
|
|
|
|
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
int cubicHorizontal(const SkPoint a[4], SkScalar left, SkScalar right, SkScalar y,
|
|
|
|
bool flipped) {
|
|
|
|
SkDCubic cubic;
|
|
|
|
cubic.set(a);
|
2013-10-02 14:49:34 +00:00
|
|
|
fMax = 3;
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
return horizontal(cubic, left, right, y, flipped);
|
|
|
|
}
|
|
|
|
|
|
|
|
int cubicVertical(const SkPoint a[4], SkScalar top, SkScalar bottom, SkScalar x, bool flipped) {
|
|
|
|
SkDCubic cubic;
|
|
|
|
cubic.set(a);
|
2013-10-02 14:49:34 +00:00
|
|
|
fMax = 3;
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
return vertical(cubic, top, bottom, x, flipped);
|
|
|
|
}
|
|
|
|
|
|
|
|
int cubicLine(const SkPoint a[4], const SkPoint b[2]) {
|
|
|
|
SkDCubic cubic;
|
|
|
|
cubic.set(a);
|
|
|
|
SkDLine line;
|
|
|
|
line.set(b);
|
2013-10-02 14:49:34 +00:00
|
|
|
fMax = 3;
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
return intersect(cubic, line);
|
|
|
|
}
|
|
|
|
|
2013-07-15 13:29:13 +00:00
|
|
|
bool hasT(double t) const {
|
|
|
|
SkASSERT(t == 0 || t == 1);
|
|
|
|
return fUsed > 0 && (t == 0 ? fT[0][0] == 0 : fT[0][fUsed - 1] == 1);
|
|
|
|
}
|
|
|
|
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
int insertSwap(double one, double two, const SkDPoint& pt) {
|
|
|
|
if (fSwap) {
|
|
|
|
return insert(two, one, pt);
|
|
|
|
} else {
|
|
|
|
return insert(one, two, pt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool isCoincident(int index) {
|
|
|
|
return (fIsCoincident[0] & 1 << index) != 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int lineHorizontal(const SkPoint a[2], SkScalar left, SkScalar right, SkScalar y,
|
|
|
|
bool flipped) {
|
|
|
|
SkDLine line;
|
|
|
|
line.set(a);
|
2013-10-02 14:49:34 +00:00
|
|
|
fMax = 2;
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
return horizontal(line, left, right, y, flipped);
|
|
|
|
}
|
|
|
|
|
|
|
|
int lineVertical(const SkPoint a[2], SkScalar top, SkScalar bottom, SkScalar x, bool flipped) {
|
|
|
|
SkDLine line;
|
|
|
|
line.set(a);
|
2013-10-02 14:49:34 +00:00
|
|
|
fMax = 2;
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
return vertical(line, top, bottom, x, flipped);
|
|
|
|
}
|
|
|
|
|
|
|
|
int lineLine(const SkPoint a[2], const SkPoint b[2]) {
|
|
|
|
SkDLine aLine, bLine;
|
|
|
|
aLine.set(a);
|
|
|
|
bLine.set(b);
|
2013-10-02 14:49:34 +00:00
|
|
|
fMax = 2;
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
return intersect(aLine, bLine);
|
|
|
|
}
|
|
|
|
|
2014-06-17 12:15:38 +00:00
|
|
|
bool nearlySame(int index) const {
|
|
|
|
SkASSERT(index == 0 || index == 1);
|
|
|
|
return fNearlySame[index];
|
|
|
|
}
|
|
|
|
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
const SkDPoint& pt(int index) const {
|
|
|
|
return fPt[index];
|
|
|
|
}
|
|
|
|
|
2014-06-17 12:15:38 +00:00
|
|
|
const SkDPoint& pt2(int index) const {
|
|
|
|
return fPt2[index];
|
|
|
|
}
|
|
|
|
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
int quadHorizontal(const SkPoint a[3], SkScalar left, SkScalar right, SkScalar y,
|
|
|
|
bool flipped) {
|
|
|
|
SkDQuad quad;
|
|
|
|
quad.set(a);
|
2013-10-02 14:49:34 +00:00
|
|
|
fMax = 2;
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
return horizontal(quad, left, right, y, flipped);
|
|
|
|
}
|
|
|
|
|
|
|
|
int quadVertical(const SkPoint a[3], SkScalar top, SkScalar bottom, SkScalar x, bool flipped) {
|
|
|
|
SkDQuad quad;
|
|
|
|
quad.set(a);
|
2013-10-02 14:49:34 +00:00
|
|
|
fMax = 2;
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
return vertical(quad, top, bottom, x, flipped);
|
|
|
|
}
|
|
|
|
|
|
|
|
int quadLine(const SkPoint a[3], const SkPoint b[2]) {
|
|
|
|
SkDQuad quad;
|
|
|
|
quad.set(a);
|
|
|
|
SkDLine line;
|
|
|
|
line.set(b);
|
2014-04-25 12:59:11 +00:00
|
|
|
fMax = 3; // 2; permit small coincident segment + non-coincident intersection
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
return intersect(quad, line);
|
|
|
|
}
|
|
|
|
|
2014-06-17 12:15:38 +00:00
|
|
|
// leaves swap, max alone
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
void reset() {
|
2013-07-15 13:29:13 +00:00
|
|
|
fAllowNear = true;
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
fUsed = 0;
|
2015-03-26 14:52:43 +00:00
|
|
|
sk_bzero(fIsCoincident, sizeof(fIsCoincident));
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
}
|
|
|
|
|
2014-06-17 12:15:38 +00:00
|
|
|
void set(bool swap, int tIndex, double t) {
|
|
|
|
fT[(int) swap][tIndex] = t;
|
|
|
|
}
|
|
|
|
|
2013-10-02 14:49:34 +00:00
|
|
|
void setMax(int max) {
|
|
|
|
fMax = max;
|
|
|
|
}
|
|
|
|
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
void swap() {
|
|
|
|
fSwap ^= true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool swapped() const {
|
|
|
|
return fSwap;
|
|
|
|
}
|
2014-11-13 14:58:52 +00:00
|
|
|
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
int used() const {
|
|
|
|
return fUsed;
|
|
|
|
}
|
|
|
|
|
|
|
|
void downDepth() {
|
|
|
|
SkASSERT(--fDepth >= 0);
|
|
|
|
}
|
|
|
|
|
2015-03-26 14:52:43 +00:00
|
|
|
bool unBumpT(int index) {
|
|
|
|
SkASSERT(fUsed == 1);
|
|
|
|
fT[0][index] = fT[0][index] * (1 + BUMP_EPSILON * 2) - BUMP_EPSILON;
|
|
|
|
if (!between(0, fT[0][index], 1)) {
|
|
|
|
fUsed = 0;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
void upDepth() {
|
|
|
|
SkASSERT(++fDepth < 16);
|
|
|
|
}
|
|
|
|
|
2014-11-13 14:58:52 +00:00
|
|
|
void alignQuadPts(const SkPoint a[3], const SkPoint b[3]);
|
|
|
|
int cleanUpCoincidence();
|
2015-03-26 14:52:43 +00:00
|
|
|
int closestTo(double rangeStart, double rangeEnd, const SkDPoint& testPt, double* dist) const;
|
2014-06-17 12:15:38 +00:00
|
|
|
void cubicInsert(double one, double two, const SkDPoint& pt, const SkDCubic& c1,
|
|
|
|
const SkDCubic& c2);
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
void flip();
|
|
|
|
int horizontal(const SkDLine&, double left, double right, double y, bool flipped);
|
|
|
|
int horizontal(const SkDQuad&, double left, double right, double y, bool flipped);
|
|
|
|
int horizontal(const SkDQuad&, double left, double right, double y, double tRange[2]);
|
|
|
|
int horizontal(const SkDCubic&, double y, double tRange[3]);
|
2015-04-20 15:31:59 +00:00
|
|
|
int horizontal(const SkDConic&, double left, double right, double y, bool flipped);
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
int horizontal(const SkDCubic&, double left, double right, double y, bool flipped);
|
|
|
|
int horizontal(const SkDCubic&, double left, double right, double y, double tRange[3]);
|
2015-05-11 14:21:27 +00:00
|
|
|
static double HorizontalIntercept(const SkDLine& line, double y);
|
|
|
|
static int HorizontalIntercept(const SkDQuad& quad, SkScalar y, double* roots);
|
|
|
|
static int HorizontalIntercept(const SkDConic& conic, SkScalar y, double* roots);
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
// FIXME : does not respect swap
|
|
|
|
int insert(double one, double two, const SkDPoint& pt);
|
2014-06-17 12:15:38 +00:00
|
|
|
void insertNear(double one, double two, const SkDPoint& pt1, const SkDPoint& pt2);
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
// start if index == 0 : end if index == 1
|
2015-03-26 14:52:43 +00:00
|
|
|
int insertCoincident(double one, double two, const SkDPoint& pt);
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
int intersect(const SkDLine&, const SkDLine&);
|
|
|
|
int intersect(const SkDQuad&, const SkDLine&);
|
|
|
|
int intersect(const SkDQuad&, const SkDQuad&);
|
2015-04-20 15:31:59 +00:00
|
|
|
int intersect(const SkDConic&, const SkDLine&);
|
|
|
|
int intersect(const SkDConic&, const SkDQuad&);
|
|
|
|
int intersect(const SkDConic&, const SkDConic&);
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
int intersect(const SkDCubic&, const SkDLine&);
|
2015-04-20 15:31:59 +00:00
|
|
|
int intersect(const SkDCubic&, const SkDQuad&);
|
|
|
|
int intersect(const SkDCubic&, const SkDConic&);
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
int intersect(const SkDCubic&, const SkDCubic&);
|
2013-06-04 17:59:42 +00:00
|
|
|
int intersectRay(const SkDLine&, const SkDLine&);
|
|
|
|
int intersectRay(const SkDQuad&, const SkDLine&);
|
2015-04-20 15:31:59 +00:00
|
|
|
int intersectRay(const SkDConic&, const SkDLine&);
|
2013-06-04 17:59:42 +00:00
|
|
|
int intersectRay(const SkDCubic&, const SkDLine&);
|
2015-03-26 14:52:43 +00:00
|
|
|
void merge(const SkIntersections& , int , const SkIntersections& , int );
|
|
|
|
int mostOutside(double rangeStart, double rangeEnd, const SkDPoint& origin) const;
|
2013-11-01 17:36:03 +00:00
|
|
|
void removeOne(int index);
|
2015-03-26 14:52:43 +00:00
|
|
|
void setCoincident(int index);
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
int vertical(const SkDLine&, double top, double bottom, double x, bool flipped);
|
|
|
|
int vertical(const SkDQuad&, double top, double bottom, double x, bool flipped);
|
2015-04-20 15:31:59 +00:00
|
|
|
int vertical(const SkDConic&, double top, double bottom, double x, bool flipped);
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
int vertical(const SkDCubic&, double top, double bottom, double x, bool flipped);
|
2015-05-11 14:21:27 +00:00
|
|
|
static double VerticalIntercept(const SkDLine& line, double x);
|
|
|
|
static int VerticalIntercept(const SkDQuad& quad, SkScalar x, double* roots);
|
|
|
|
static int VerticalIntercept(const SkDConic& conic, SkScalar x, double* roots);
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
|
|
|
|
int depth() const {
|
|
|
|
#ifdef SK_DEBUG
|
|
|
|
return fDepth;
|
|
|
|
#else
|
|
|
|
return 0;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2015-05-11 14:21:27 +00:00
|
|
|
int debugCoincidentUsed() const;
|
2015-03-26 14:52:43 +00:00
|
|
|
void dump() const; // implemented for testing only
|
|
|
|
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
private:
|
2013-10-02 14:49:34 +00:00
|
|
|
bool cubicCheckCoincidence(const SkDCubic& c1, const SkDCubic& c2);
|
|
|
|
bool cubicExactEnd(const SkDCubic& cubic1, bool start, const SkDCubic& cubic2);
|
|
|
|
void cubicNearEnd(const SkDCubic& cubic1, bool start, const SkDCubic& cubic2, const SkDRect& );
|
|
|
|
void cleanUpParallelLines(bool parallel);
|
|
|
|
void computePoints(const SkDLine& line, int used);
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
|
2015-03-26 14:52:43 +00:00
|
|
|
SkDPoint fPt[10]; // FIXME: since scans store points as SkPoint, this should also
|
|
|
|
SkDPoint fPt2[2]; // used by nearly same to store alternate intersection point
|
|
|
|
double fT[2][10];
|
2013-09-16 15:55:01 +00:00
|
|
|
uint16_t fIsCoincident[2]; // bit set for each curve's coincident T
|
2014-06-17 12:15:38 +00:00
|
|
|
bool fNearlySame[2]; // true if end points nearly match
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
unsigned char fUsed;
|
2013-10-02 14:49:34 +00:00
|
|
|
unsigned char fMax;
|
2013-07-15 13:29:13 +00:00
|
|
|
bool fAllowNear;
|
Add base types for path ops
Paths contain lines, quads, and cubics, which are
collectively curves.
To work with path intersections, intermediary curves
are constructed. For now, those intermediates use
doubles to guarantee sufficient precision.
The DVector, DPoint, DLine, DQuad, and DCubic
structs encapsulate these intermediate curves.
The DRect and DTriangle structs are created to
describe intersectable areas of interest.
The Bounds struct inherits from SkRect to create
a SkScalar-based rectangle that intersects shared
edges.
This also includes common math equalities and
debugging that the remainder of path ops builds on,
as well as a temporary top-level interface in
include/pathops/SkPathOps.h.
Review URL: https://codereview.chromium.org/12827020
git-svn-id: http://skia.googlecode.com/svn/trunk@8551 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-08 11:47:37 +00:00
|
|
|
bool fSwap;
|
|
|
|
#ifdef SK_DEBUG
|
|
|
|
int fDepth;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|