aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkPathOpsTypes.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-07-06 11:38:33 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-06 11:38:33 -0700
commit27c8eb8ffd7e221693d840c2b9279d53fe6f03d4 (patch)
tree67fbbc378aced5c5de9ec9611021db6ef7659c3c /src/pathops/SkPathOpsTypes.cpp
parent334e588d9ed5390efb82beb37329b56a380f1d0e (diff)
When three or more edges are coincident, the logic needs
to compute the overlapping ranges and combine the winding into a single destination. This computes coincidence more rigorously, fixing the edge cases exposed by this bug. Also, add the ability to debug and dump pathop structures from the coincident context. TBR=reed@google.com BUG=skia:3651 Review URL: https://codereview.chromium.org/1182493015
Diffstat (limited to 'src/pathops/SkPathOpsTypes.cpp')
-rw-r--r--src/pathops/SkPathOpsTypes.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/pathops/SkPathOpsTypes.cpp b/src/pathops/SkPathOpsTypes.cpp
index 2c8d778c69..dcd33c9d73 100644
--- a/src/pathops/SkPathOpsTypes.cpp
+++ b/src/pathops/SkPathOpsTypes.cpp
@@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
#include "SkFloatBits.h"
+#include "SkOpCoincidence.h"
#include "SkPathOpsTypes.h"
static bool arguments_denormalized(float a, float b, int epsilon) {
@@ -198,3 +199,21 @@ double SkDCubeRoot(double x) {
}
return result;
}
+
+SkOpGlobalState::SkOpGlobalState(SkOpCoincidence* coincidence, SkOpContourHead* head)
+ : fCoincidence(coincidence)
+ , fContourHead(head)
+ , fNested(0)
+ , fWindingFailed(false)
+ , fAngleCoincidence(false)
+ , fPhase(kIntersecting)
+ SkDEBUGPARAMS(fAngleID(0))
+ SkDEBUGPARAMS(fContourID(0))
+ SkDEBUGPARAMS(fPtTID(0))
+ SkDEBUGPARAMS(fSegmentID(0))
+ SkDEBUGPARAMS(fSpanID(0)) {
+ if (coincidence) {
+ coincidence->debugSetGlobalState(this);
+ }
+}
+