skia2/experimental/Intersection/CubicBezierClip_Test.cpp
caryclark@google.com 9e49fb63d3 shape ops work in progress
add copyrights everywhere
start working on quadratic line segments (for quad intersection)

git-svn-id: http://skia.googlecode.com/svn/trunk@5286 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-08-27 14:11:33 +00:00

31 lines
1.0 KiB
C++

/*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "CurveIntersection.h"
#include "CubicIntersection_TestData.h"
#include "Intersection_Tests.h"
void CubicBezierClip_Test() {
for (size_t index = 0; index < tests_count; ++index) {
const Cubic& cubic1 = tests[index][0];
const Cubic& cubic2 = tests[index][1];
Cubic reduce1, reduce2;
int order1 = reduceOrder(cubic1, reduce1, kReduceOrder_NoQuadraticsAllowed);
int order2 = reduceOrder(cubic2, reduce2, kReduceOrder_NoQuadraticsAllowed);
if (order1 < 4) {
printf("%s [%d] cubic1 order=%d\n", __FUNCTION__, (int) index, order1);
}
if (order2 < 4) {
printf("%s [%d] cubic2 order=%d\n", __FUNCTION__, (int) index, order2);
}
if (order1 == 4 && order2 == 4) {
double minT = 0;
double maxT = 1;
bezier_clip(reduce1, reduce2, minT, maxT);
}
}
}