Home | History | Annotate | Download | only in Intersection
      1 /*
      2  * Copyright 2012 Google Inc.
      3  *
      4  * Use of this source code is governed by a BSD-style license that can be
      5  * found in the LICENSE file.
      6  */
      7 #include "CurveIntersection.h"
      8 #include "CubicIntersection_TestData.h"
      9 #include "Intersection_Tests.h"
     10 
     11 void CubicBezierClip_Test() {
     12     for (size_t index = 0; index < tests_count; ++index) {
     13         const Cubic& cubic1 = tests[index][0];
     14         const Cubic& cubic2 = tests[index][1];
     15         Cubic reduce1, reduce2;
     16         int order1 = reduceOrder(cubic1, reduce1, kReduceOrder_NoQuadraticsAllowed,
     17                 kReduceOrder_TreatAsFill);
     18         int order2 = reduceOrder(cubic2, reduce2, kReduceOrder_NoQuadraticsAllowed,
     19                 kReduceOrder_TreatAsFill);
     20         if (order1 < 4) {
     21             SkDebugf("%s [%d] cubic1 order=%d\n", __FUNCTION__, (int) index, order1);
     22         }
     23         if (order2 < 4) {
     24             SkDebugf("%s [%d] cubic2 order=%d\n", __FUNCTION__, (int) index, order2);
     25         }
     26         if (order1 == 4 && order2 == 4) {
     27             double minT = 0;
     28             double maxT = 1;
     29             bezier_clip(reduce1, reduce2, minT, maxT);
     30         }
     31     }
     32 }
     33