OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkPathOpsBounds.h" | 8 #include "SkPathOpsBounds.h" |
9 #include "Test.h" | 9 #include "Test.h" |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 bool empty = bounds.isReallyEmpty(); | 85 bool empty = bounds.isReallyEmpty(); |
86 REPORTER_ASSERT(reporter, empty); | 86 REPORTER_ASSERT(reporter, empty); |
87 } | 87 } |
88 for (size_t index = 0; index < notEmptyTestsCount; ++index) { | 88 for (size_t index = 0; index < notEmptyTestsCount; ++index) { |
89 const SkPathOpsBounds& bounds = static_cast<const SkPathOpsBounds&>(notR
eallyEmpty[index]); | 89 const SkPathOpsBounds& bounds = static_cast<const SkPathOpsBounds&>(notR
eallyEmpty[index]); |
90 SkASSERT(ValidBounds(bounds)); | 90 SkASSERT(ValidBounds(bounds)); |
91 bool empty = bounds.isReallyEmpty(); | 91 bool empty = bounds.isReallyEmpty(); |
92 REPORTER_ASSERT(reporter, !empty); | 92 REPORTER_ASSERT(reporter, !empty); |
93 } | 93 } |
94 const SkPoint curvePts[] = {{0, 0}, {1, 2}, {3, 4}, {5, 6}}; | 94 const SkPoint curvePts[] = {{0, 0}, {1, 2}, {3, 4}, {5, 6}}; |
95 bounds.setLineBounds(curvePts); | 95 bounds.setLineBounds(curvePts, 1); |
96 expected.set(0, 0, 1, 2); | 96 expected.set(0, 0, 1, 2); |
97 REPORTER_ASSERT(reporter, bounds == expected); | 97 REPORTER_ASSERT(reporter, bounds == expected); |
98 (bounds.*SetCurveBounds[1])(curvePts); | 98 (bounds.*SetCurveBounds[SkPath::kLine_Verb])(curvePts, 1); |
99 REPORTER_ASSERT(reporter, bounds == expected); | 99 REPORTER_ASSERT(reporter, bounds == expected); |
100 bounds.setQuadBounds(curvePts); | 100 bounds.setQuadBounds(curvePts, 1); |
101 expected.set(0, 0, 3, 4); | 101 expected.set(0, 0, 3, 4); |
102 REPORTER_ASSERT(reporter, bounds == expected); | 102 REPORTER_ASSERT(reporter, bounds == expected); |
103 (bounds.*SetCurveBounds[2])(curvePts); | 103 (bounds.*SetCurveBounds[SkPath::kQuad_Verb])(curvePts, 1); |
104 REPORTER_ASSERT(reporter, bounds == expected); | 104 REPORTER_ASSERT(reporter, bounds == expected); |
105 bounds.setCubicBounds(curvePts); | 105 bounds.setCubicBounds(curvePts, 1); |
106 expected.set(0, 0, 5, 6); | 106 expected.set(0, 0, 5, 6); |
107 REPORTER_ASSERT(reporter, bounds == expected); | 107 REPORTER_ASSERT(reporter, bounds == expected); |
108 (bounds.*SetCurveBounds[3])(curvePts); | 108 (bounds.*SetCurveBounds[SkPath::kCubic_Verb])(curvePts, 1); |
109 REPORTER_ASSERT(reporter, bounds == expected); | 109 REPORTER_ASSERT(reporter, bounds == expected); |
110 } | 110 } |
OLD | NEW |