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 <cmath> | 8 #include <cmath> |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkGeometry.h" | 10 #include "SkGeometry.h" |
(...skipping 1478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1489 path.reset(); | 1489 path.reset(); |
1490 path.addRect(0, 0, SkIntToScalar(10), SkIntToScalar(10), SkPath::kCCW_Direct
ion); | 1490 path.addRect(0, 0, SkIntToScalar(10), SkIntToScalar(10), SkPath::kCCW_Direct
ion); |
1491 check_convexity(reporter, path, SkPath::kConvex_Convexity); | 1491 check_convexity(reporter, path, SkPath::kConvex_Convexity); |
1492 REPORTER_ASSERT(reporter, SkPathPriv::CheapIsFirstDirection(path, SkPathPriv
::kCCW_FirstDirection)); | 1492 REPORTER_ASSERT(reporter, SkPathPriv::CheapIsFirstDirection(path, SkPathPriv
::kCCW_FirstDirection)); |
1493 | 1493 |
1494 path.reset(); | 1494 path.reset(); |
1495 path.addRect(0, 0, SkIntToScalar(10), SkIntToScalar(10), SkPath::kCW_Directi
on); | 1495 path.addRect(0, 0, SkIntToScalar(10), SkIntToScalar(10), SkPath::kCW_Directi
on); |
1496 check_convexity(reporter, path, SkPath::kConvex_Convexity); | 1496 check_convexity(reporter, path, SkPath::kConvex_Convexity); |
1497 REPORTER_ASSERT(reporter, SkPathPriv::CheapIsFirstDirection(path, SkPathPriv
::kCW_FirstDirection)); | 1497 REPORTER_ASSERT(reporter, SkPathPriv::CheapIsFirstDirection(path, SkPathPriv
::kCW_FirstDirection)); |
1498 | 1498 |
| 1499 path.reset(); |
| 1500 path.quadTo(100, 100, 50, 50); // This is a convex path from GM:convexpaths |
| 1501 check_convexity(reporter, path, SkPath::kConvex_Convexity); |
| 1502 |
1499 static const struct { | 1503 static const struct { |
1500 const char* fPathStr; | 1504 const char* fPathStr; |
1501 SkPath::Convexity fExpectedConvexity; | 1505 SkPath::Convexity fExpectedConvexity; |
1502 SkPathPriv::FirstDirection fExpectedDirection; | 1506 SkPathPriv::FirstDirection fExpectedDirection; |
1503 } gRec[] = { | 1507 } gRec[] = { |
1504 { "", SkPath::kConvex_Convexity, SkPathPriv::kUnknown_FirstDirection }, | 1508 { "", SkPath::kConvex_Convexity, SkPathPriv::kUnknown_FirstDirection }, |
1505 { "0 0", SkPath::kConvex_Convexity, SkPathPriv::kUnknown_FirstDirection
}, | 1509 { "0 0", SkPath::kConvex_Convexity, SkPathPriv::kUnknown_FirstDirection
}, |
1506 { "0 0 10 10", SkPath::kConvex_Convexity, SkPathPriv::kUnknown_FirstDire
ction }, | 1510 { "0 0 10 10", SkPath::kConvex_Convexity, SkPathPriv::kUnknown_FirstDire
ction }, |
1507 { "0 0 10 10 20 20 0 0 10 10", SkPath::kConcave_Convexity, SkPathPriv::k
Unknown_FirstDirection }, | 1511 { "0 0 10 10 20 20 0 0 10 10", SkPath::kConcave_Convexity, SkPathPriv::k
Unknown_FirstDirection }, |
1508 { "0 0 10 10 10 20", SkPath::kConvex_Convexity, SkPathPriv::kCW_FirstDir
ection }, | 1512 { "0 0 10 10 10 20", SkPath::kConvex_Convexity, SkPathPriv::kCW_FirstDir
ection }, |
(...skipping 2933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4442 PathRefTest_Private::TestPathRef(reporter); | 4446 PathRefTest_Private::TestPathRef(reporter); |
4443 PathTest_Private::TestPathrefListeners(reporter); | 4447 PathTest_Private::TestPathrefListeners(reporter); |
4444 test_dump(reporter); | 4448 test_dump(reporter); |
4445 test_path_crbug389050(reporter); | 4449 test_path_crbug389050(reporter); |
4446 test_path_crbugskia2820(reporter); | 4450 test_path_crbugskia2820(reporter); |
4447 test_skbug_3469(reporter); | 4451 test_skbug_3469(reporter); |
4448 test_skbug_3239(reporter); | 4452 test_skbug_3239(reporter); |
4449 test_bounds_crbug_513799(reporter); | 4453 test_bounds_crbug_513799(reporter); |
4450 test_fuzz_crbug_638223(); | 4454 test_fuzz_crbug_638223(); |
4451 } | 4455 } |
OLD | NEW |