shape ops work in progress
git-svn-id: http://skia.googlecode.com/svn/trunk@7738 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/experimental/Intersection/CubicToQuadratics.cpp b/experimental/Intersection/CubicToQuadratics.cpp
index 66288b4..dc4b51b 100644
--- a/experimental/Intersection/CubicToQuadratics.cpp
+++ b/experimental/Intersection/CubicToQuadratics.cpp
@@ -149,11 +149,23 @@
double inflectT[2];
int inflections = find_cubic_inflections(cubic, inflectT);
SkASSERT(inflections <= 2);
+ CubicPair pair;
+ if (inflections == 1) {
+ chop_at(cubic, pair, inflectT[0]);
+ int orderP1 = reduceOrder(pair.first(), reduced, kReduceOrder_NoQuadraticsAllowed);
+ if (orderP1 < 2) {
+ --inflections;
+ } else {
+ int orderP2 = reduceOrder(pair.second(), reduced, kReduceOrder_NoQuadraticsAllowed);
+ if (orderP2 < 2) {
+ --inflections;
+ }
+ }
+ }
if (inflections == 0 && addSimpleTs(cubic, precision, ts)) {
return;
}
if (inflections == 1) {
- CubicPair pair;
chop_at(cubic, pair, inflectT[0]);
addTs(pair.first(), precision, 0, inflectT[0], ts);
addTs(pair.second(), precision, inflectT[0], 1, ts);