OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 | 7 |
8 #include "Test.h" | 8 #include "Test.h" |
| 9 #include "TestClassDef.h" |
9 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
10 #include "SkPaint.h" | 11 #include "SkPaint.h" |
11 #include "SkPath.h" | 12 #include "SkPath.h" |
12 #include "SkParse.h" | 13 #include "SkParse.h" |
13 #include "SkParsePath.h" | 14 #include "SkParsePath.h" |
14 #include "SkPathEffect.h" | 15 #include "SkPathEffect.h" |
15 #include "SkRandom.h" | 16 #include "SkRandom.h" |
16 #include "SkReader32.h" | 17 #include "SkReader32.h" |
17 #include "SkRRect.h" | 18 #include "SkRRect.h" |
18 #include "SkSize.h" | 19 #include "SkSize.h" |
(...skipping 3153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3172 q.conicTo(8, 7, 6, 5, 0.5f); | 3173 q.conicTo(8, 7, 6, 5, 0.5f); |
3173 q.quadTo(6, 7, 8, 6); | 3174 q.quadTo(6, 7, 8, 6); |
3174 q.cubicTo(5, 6, 7, 8, 7, 5); | 3175 q.cubicTo(5, 6, 7, 8, 7, 5); |
3175 q.close(); | 3176 q.close(); |
3176 p.reversePathTo(q); | 3177 p.reversePathTo(q); |
3177 SkRect reverseExpected = {-4, -4, 8, 8}; | 3178 SkRect reverseExpected = {-4, -4, 8, 8}; |
3178 REPORTER_ASSERT(reporter, p.getBounds() == reverseExpected); | 3179 REPORTER_ASSERT(reporter, p.getBounds() == reverseExpected); |
3179 } | 3180 } |
3180 }; | 3181 }; |
3181 | 3182 |
3182 static void TestPath(skiatest::Reporter* reporter) { | 3183 DEF_TEST(Path, reporter) { |
3183 SkTSize<SkScalar>::Make(3,4); | 3184 SkTSize<SkScalar>::Make(3,4); |
3184 | 3185 |
3185 SkPath p, empty; | 3186 SkPath p, empty; |
3186 SkRect bounds, bounds2; | 3187 SkRect bounds, bounds2; |
3187 test_empty(reporter, p); | 3188 test_empty(reporter, p); |
3188 | 3189 |
3189 REPORTER_ASSERT(reporter, p.getBounds().isEmpty()); | 3190 REPORTER_ASSERT(reporter, p.getBounds().isEmpty()); |
3190 | 3191 |
3191 // this triggers a code path in SkPath::operator= which is otherwise unexerc
ised | 3192 // this triggers a code path in SkPath::operator= which is otherwise unexerc
ised |
3192 SkPath& self = p; | 3193 SkPath& self = p; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3291 test_path_to_region(reporter); | 3292 test_path_to_region(reporter); |
3292 test_rrect(reporter); | 3293 test_rrect(reporter); |
3293 test_arc(reporter); | 3294 test_arc(reporter); |
3294 test_arcTo(reporter); | 3295 test_arcTo(reporter); |
3295 test_addPath(reporter); | 3296 test_addPath(reporter); |
3296 test_conicTo_special_case(reporter); | 3297 test_conicTo_special_case(reporter); |
3297 test_get_point(reporter); | 3298 test_get_point(reporter); |
3298 test_contains(reporter); | 3299 test_contains(reporter); |
3299 PathTest_Private::TestPathTo(reporter); | 3300 PathTest_Private::TestPathTo(reporter); |
3300 } | 3301 } |
3301 | |
3302 #include "TestClassDef.h" | |
3303 DEFINE_TESTCLASS("Path", PathTestClass, TestPath) | |
OLD | NEW |