aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/Intersection/Intersections.h
diff options
context:
space:
mode:
authorGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-02-04 14:06:49 +0000
committerGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-02-04 14:06:49 +0000
commitf9502d7dfad5b361a3cdaa42eb75b593c95f79d8 (patch)
treee793008849660a64c24dfc30aaae7347a1f46c82 /experimental/Intersection/Intersections.h
parent9dde018753c4d16cdc60c008c32bb0b573a82944 (diff)
shape ops work in progress
git-svn-id: http://skia.googlecode.com/svn/trunk@7535 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'experimental/Intersection/Intersections.h')
-rw-r--r--experimental/Intersection/Intersections.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/experimental/Intersection/Intersections.h b/experimental/Intersection/Intersections.h
index 779ff33b3f..6dd2777136 100644
--- a/experimental/Intersection/Intersections.h
+++ b/experimental/Intersection/Intersections.h
@@ -12,6 +12,9 @@ public:
Intersections()
: fFlip(0)
, fSwap(0)
+#if SK_DEBUG
+ , fDepth(0)
+#endif
{
// OPTIMIZE: don't need to be initialized in release
bzero(fT, sizeof(fT));
@@ -52,9 +55,15 @@ public:
// remove once curve/curve intersections are improved
void cleanUp();
- int coincidentUsed() const{
+ int coincidentUsed() const {
return fCoincidentUsed;
}
+
+#if SK_DEBUG
+ int depth() const {
+ return fDepth;
+ }
+#endif
void offset(int base, double start, double end) {
for (int index = base; index < fUsed; ++index) {
@@ -105,6 +114,14 @@ public:
return fUsed;
}
+ void downDepth() {
+ SkASSERT(--fDepth >= 0);
+ }
+
+ void upDepth() {
+ SkASSERT(++fDepth < 16);
+ }
+
double fT[2][9];
double fCoincidentT[2][9];
int fUsed;
@@ -112,6 +129,9 @@ public:
int fCoincidentUsed;
bool fFlip;
bool fUnsortable;
+#if SK_DEBUG
+ int fDepth;
+#endif
private:
int fSwap;
};