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 "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkGeometry.h" | 9 #include "SkGeometry.h" |
10 #include "SkPaint.h" | 10 #include "SkPaint.h" |
(...skipping 3490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3501 p.setLastPt(10, 10); | 3501 p.setLastPt(10, 10); |
3502 pt = p.getPoint(0); | 3502 pt = p.getPoint(0); |
3503 REPORTER_ASSERT(reporter, pt == SkPoint::Make(10, 10)); | 3503 REPORTER_ASSERT(reporter, pt == SkPoint::Make(10, 10)); |
3504 REPORTER_ASSERT(reporter, p.getLastPt(nullptr)); | 3504 REPORTER_ASSERT(reporter, p.getLastPt(nullptr)); |
3505 p.rMoveTo(10, 10); | 3505 p.rMoveTo(10, 10); |
3506 REPORTER_ASSERT(reporter, p.getLastPt(&pt) && pt == SkPoint::Make(20, 20)); | 3506 REPORTER_ASSERT(reporter, p.getLastPt(&pt) && pt == SkPoint::Make(20, 20)); |
3507 } | 3507 } |
3508 | 3508 |
3509 static void test_contains(skiatest::Reporter* reporter) { | 3509 static void test_contains(skiatest::Reporter* reporter) { |
3510 SkPath p; | 3510 SkPath p; |
| 3511 p.moveTo(SkBits2Float(0xe085e7b1), SkBits2Float(0x5f512c00)); // -7.7191e+1
9f, 1.50724e+19f |
| 3512 p.conicTo(SkBits2Float(0xdfdaa221), SkBits2Float(0x5eaac338), SkBits2Float(0
x60342f13), SkBits2Float(0xdf0cbb58), SkBits2Float(0x3f3504f3)); // -3.15084e+1
9f, 6.15237e+18f, 5.19345e+19f, -1.01408e+19f, 0.707107f |
| 3513 p.conicTo(SkBits2Float(0x60ead799), SkBits2Float(0xdfb76c24), SkBits2Float(0
x609b9872), SkBits2Float(0xdf730de8), SkBits2Float(0x3f3504f4)); // 1.35377e+20
f, -2.6434e+19f, 8.96947e+19f, -1.75139e+19f, 0.707107f |
| 3514 p.lineTo(SkBits2Float(0x609b9872), SkBits2Float(0xdf730de8)); // 8.96947e+1
9f, -1.75139e+19f |
| 3515 p.conicTo(SkBits2Float(0x6018b296), SkBits2Float(0xdeee870d), SkBits2Float(0
xe008cd8e), SkBits2Float(0x5ed5b2db), SkBits2Float(0x3f3504f3)); // 4.40121e+19
f, -8.59386e+18f, -3.94308e+19f, 7.69931e+18f, 0.707107f |
| 3516 p.conicTo(SkBits2Float(0xe0d526d9), SkBits2Float(0x5fa67b31), SkBits2Float(0
xe085e7b2), SkBits2Float(0x5f512c01), SkBits2Float(0x3f3504f3)); // -1.22874e+2
0f, 2.39925e+19f, -7.7191e+19f, 1.50724e+19f, 0.707107f |
| 3517 REPORTER_ASSERT(reporter, !p.contains(-77.2027664f, 15.3066053f)); |
| 3518 |
| 3519 p.reset(); |
3511 p.setFillType(SkPath::kInverseWinding_FillType); | 3520 p.setFillType(SkPath::kInverseWinding_FillType); |
3512 REPORTER_ASSERT(reporter, p.contains(0, 0)); | 3521 REPORTER_ASSERT(reporter, p.contains(0, 0)); |
3513 p.setFillType(SkPath::kWinding_FillType); | 3522 p.setFillType(SkPath::kWinding_FillType); |
3514 REPORTER_ASSERT(reporter, !p.contains(0, 0)); | 3523 REPORTER_ASSERT(reporter, !p.contains(0, 0)); |
3515 p.moveTo(4, 4); | 3524 p.moveTo(4, 4); |
3516 p.lineTo(6, 8); | 3525 p.lineTo(6, 8); |
3517 p.lineTo(8, 4); | 3526 p.lineTo(8, 4); |
3518 // test on edge | 3527 // test on edge |
3519 REPORTER_ASSERT(reporter, p.contains(6, 4)); | 3528 REPORTER_ASSERT(reporter, p.contains(6, 4)); |
3520 REPORTER_ASSERT(reporter, p.contains(5, 6)); | 3529 REPORTER_ASSERT(reporter, p.contains(5, 6)); |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4026 PathTest_Private::TestPathTo(reporter); | 4035 PathTest_Private::TestPathTo(reporter); |
4027 PathRefTest_Private::TestPathRef(reporter); | 4036 PathRefTest_Private::TestPathRef(reporter); |
4028 PathTest_Private::TestPathrefListeners(reporter); | 4037 PathTest_Private::TestPathrefListeners(reporter); |
4029 test_dump(reporter); | 4038 test_dump(reporter); |
4030 test_path_crbug389050(reporter); | 4039 test_path_crbug389050(reporter); |
4031 test_path_crbugskia2820(reporter); | 4040 test_path_crbugskia2820(reporter); |
4032 test_skbug_3469(reporter); | 4041 test_skbug_3469(reporter); |
4033 test_skbug_3239(reporter); | 4042 test_skbug_3239(reporter); |
4034 test_bounds_crbug_513799(reporter); | 4043 test_bounds_crbug_513799(reporter); |
4035 } | 4044 } |
OLD | NEW |