Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: experimental/Intersection/QuadraticBezierClip_Test.cpp

Issue 867213004: remove prototype pathops code (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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 "Intersection_Tests.h"
9 #include "QuadraticIntersection_TestData.h"
10
11 static const Quadratic testSet[] = {
12 // data for oneOffTest
13 {{8.0000000000000071, 8.0000000000000071},
14 {8.7289570079366854, 8.7289570079366889},
15 {9.3914917259458743, 9.0593802763083691}},
16 {{8.0000000000000142, 8.0000000000000142},
17 {8.1250000000000107, 8.1250000000000071},
18 {8.2500000000000071, 8.2187500000000053}},
19 // data for oneAtEndTest
20 {{0.91292418204644155, 0.41931201426549197},
21 {0.70491388044579517, 0.64754305977710236},
22 {0, 1 }},
23 {{0.21875, 0.765625 },
24 {0.125, 0.875 },
25 {0, 1 }}
26 };
27
28 static void oneAtEndTest() {
29 const Quadratic& quad1 = testSet[2];
30 const Quadratic& quad2 = testSet[3];
31 double minT = 0;
32 double maxT = 1;
33 bezier_clip(quad1, quad2, minT, maxT);
34 }
35
36
37 static void oneOffTest() {
38 const Quadratic& quad1 = testSet[0];
39 const Quadratic& quad2 = testSet[1];
40 double minT = 0;
41 double maxT = 1;
42 bezier_clip(quad1, quad2, minT, maxT);
43 }
44
45 static void standardTestCases() {
46 for (size_t index = 0; index < quadraticTests_count; ++index) {
47 const Quadratic& quad1 = quadraticTests[index][0];
48 const Quadratic& quad2 = quadraticTests[index][1];
49 Quadratic reduce1, reduce2;
50 int order1 = reduceOrder(quad1, reduce1, kReduceOrder_TreatAsFill);
51 int order2 = reduceOrder(quad2, reduce2, kReduceOrder_TreatAsFill);
52 if (order1 < 3) {
53 SkDebugf("%s [%d] quad1 order=%d\n", __FUNCTION__, (int)index, order 1);
54 }
55 if (order2 < 3) {
56 SkDebugf("%s [%d] quad2 order=%d\n", __FUNCTION__, (int)index, order 2);
57 }
58 if (order1 == 3 && order2 == 3) {
59 double minT = 0;
60 double maxT = 1;
61 bezier_clip(reduce1, reduce2, minT, maxT);
62 }
63 }
64 }
65
66 void QuadraticBezierClip_Test() {
67 oneAtEndTest();
68 oneOffTest();
69 standardTestCases();
70 }
OLDNEW
« no previous file with comments | « experimental/Intersection/QuadraticBezierClip.cpp ('k') | experimental/Intersection/QuadraticBounds.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698