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 3496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 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 | 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 | 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 | 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 | 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 | 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)); | 3517 // this may return true or false, depending on the platform's numerics, but
it should not crash |
| 3518 (void) p.contains(-77.2027664f, 15.3066053f); |
3518 | 3519 |
3519 p.reset(); | 3520 p.reset(); |
3520 p.setFillType(SkPath::kInverseWinding_FillType); | 3521 p.setFillType(SkPath::kInverseWinding_FillType); |
3521 REPORTER_ASSERT(reporter, p.contains(0, 0)); | 3522 REPORTER_ASSERT(reporter, p.contains(0, 0)); |
3522 p.setFillType(SkPath::kWinding_FillType); | 3523 p.setFillType(SkPath::kWinding_FillType); |
3523 REPORTER_ASSERT(reporter, !p.contains(0, 0)); | 3524 REPORTER_ASSERT(reporter, !p.contains(0, 0)); |
3524 p.moveTo(4, 4); | 3525 p.moveTo(4, 4); |
3525 p.lineTo(6, 8); | 3526 p.lineTo(6, 8); |
3526 p.lineTo(8, 4); | 3527 p.lineTo(8, 4); |
3527 // test on edge | 3528 // test on edge |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4035 PathTest_Private::TestPathTo(reporter); | 4036 PathTest_Private::TestPathTo(reporter); |
4036 PathRefTest_Private::TestPathRef(reporter); | 4037 PathRefTest_Private::TestPathRef(reporter); |
4037 PathTest_Private::TestPathrefListeners(reporter); | 4038 PathTest_Private::TestPathrefListeners(reporter); |
4038 test_dump(reporter); | 4039 test_dump(reporter); |
4039 test_path_crbug389050(reporter); | 4040 test_path_crbug389050(reporter); |
4040 test_path_crbugskia2820(reporter); | 4041 test_path_crbugskia2820(reporter); |
4041 test_skbug_3469(reporter); | 4042 test_skbug_3469(reporter); |
4042 test_skbug_3239(reporter); | 4043 test_skbug_3239(reporter); |
4043 test_bounds_crbug_513799(reporter); | 4044 test_bounds_crbug_513799(reporter); |
4044 } | 4045 } |
OLD | NEW |