Intersection work in progress
Review URL: https://codereview.appspot.com/5576043
git-svn-id: http://skia.googlecode.com/svn/trunk@3087 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/experimental/Intersection/QuadraticBezierClip_Test.cpp b/experimental/Intersection/QuadraticBezierClip_Test.cpp
index 4fe35ba..894d899 100644
--- a/experimental/Intersection/QuadraticBezierClip_Test.cpp
+++ b/experimental/Intersection/QuadraticBezierClip_Test.cpp
@@ -1,10 +1,24 @@
-/*
- * QuadraticBezierClip_Test.cpp
- * edge
- *
- * Created by Cary Clark on 1/10/12.
- * Copyright 2012 __MyCompanyName__. All rights reserved.
- *
- */
+#include "CubicIntersection.h"
+#include "Intersection_Tests.h"
+#include "QuadraticIntersection_TestData.h"
-
+void QuadraticBezierClip_Test() {
+ for (size_t index = 0; index < quadraticTests_count; ++index) {
+ const Quadratic& quad1 = quadraticTests[index][0];
+ const Quadratic& quad2 = quadraticTests[index][1];
+ Quadratic reduce1, reduce2;
+ int order1 = reduceOrder(quad1, reduce1);
+ int order2 = reduceOrder(quad2, reduce2);
+ if (order1 < 3) {
+ printf("%s [%d] quad1 order=%d\n", __FUNCTION__, (int)index, order1);
+ }
+ if (order2 < 3) {
+ printf("%s [%d] quad2 order=%d\n", __FUNCTION__, (int)index, order2);
+ }
+ if (order1 == 3 && order2 == 3) {
+ double minT = 0;
+ double maxT = 1;
+ bezier_clip(reduce1, reduce2, minT, maxT);
+ }
+ }
+}