OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 #include "PathOpsTestCommon.h" | 7 #include "PathOpsTestCommon.h" |
8 #include "SkPathOpsCubic.h" | 8 #include "SkPathOpsCubic.h" |
9 #include "SkPathOpsLine.h" | 9 #include "SkPathOpsLine.h" |
10 #include "SkPathOpsQuad.h" | 10 #include "SkPathOpsQuad.h" |
11 #include "SkPathOpsRect.h" | 11 #include "SkPathOpsRect.h" |
12 #include "Test.h" | 12 #include "Test.h" |
13 #include "TestClassDef.h" | |
14 | 13 |
15 static const SkDLine lineTests[] = { | 14 static const SkDLine lineTests[] = { |
16 {{{2, 1}, {2, 1}}}, | 15 {{{2, 1}, {2, 1}}}, |
17 {{{2, 1}, {1, 1}}}, | 16 {{{2, 1}, {1, 1}}}, |
18 {{{2, 1}, {2, 2}}}, | 17 {{{2, 1}, {2, 2}}}, |
19 {{{1, 1}, {2, 2}}}, | 18 {{{1, 1}, {2, 2}}}, |
20 {{{3, 0}, {2, 1}}}, | 19 {{{3, 0}, {2, 1}}}, |
21 {{{3, 2}, {1, 1}}}, | 20 {{{3, 2}, {1, 1}}}, |
22 }; | 21 }; |
23 | 22 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 SkTMax(cubic[1].fY, SkTMax(cubic[2].fY, cubic[3].fY)))); | 92 SkTMax(cubic[1].fY, SkTMax(cubic[2].fY, cubic[3].fY)))); |
94 rect2.setBounds(cubic); | 93 rect2.setBounds(cubic); |
95 REPORTER_ASSERT(reporter, rect.intersects(&rect2)); | 94 REPORTER_ASSERT(reporter, rect.intersects(&rect2)); |
96 // FIXME: add a recursive box subdivision method to verify that tight bo
unds is correct | 95 // FIXME: add a recursive box subdivision method to verify that tight bo
unds is correct |
97 SkDPoint leftTop = {rect2.fLeft, rect2.fTop}; | 96 SkDPoint leftTop = {rect2.fLeft, rect2.fTop}; |
98 REPORTER_ASSERT(reporter, rect.contains(leftTop)); | 97 REPORTER_ASSERT(reporter, rect.contains(leftTop)); |
99 SkDPoint rightBottom = {rect2.fRight, rect2.fBottom}; | 98 SkDPoint rightBottom = {rect2.fRight, rect2.fBottom}; |
100 REPORTER_ASSERT(reporter, rect.contains(rightBottom)); | 99 REPORTER_ASSERT(reporter, rect.contains(rightBottom)); |
101 } | 100 } |
102 } | 101 } |
OLD | NEW |