| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 #ifndef SkPath_DEFINED | 8 #ifndef SkPath_DEFINED |
| 9 #define SkPath_DEFINED | 9 #define SkPath_DEFINED |
| 10 | 10 |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 | 498 |
| 499 /** | 499 /** |
| 500 * Returns whether or not a fill type is inverted | 500 * Returns whether or not a fill type is inverted |
| 501 * | 501 * |
| 502 * kWinding_FillType -> false | 502 * kWinding_FillType -> false |
| 503 * kEvenOdd_FillType -> false | 503 * kEvenOdd_FillType -> false |
| 504 * kInverseWinding_FillType -> true | 504 * kInverseWinding_FillType -> true |
| 505 * kInverseEvenOdd_FillType -> true | 505 * kInverseEvenOdd_FillType -> true |
| 506 */ | 506 */ |
| 507 static bool IsInverseFillType(FillType fill) { | 507 static bool IsInverseFillType(FillType fill) { |
| 508 SK_COMPILE_ASSERT(0 == kWinding_FillType, fill_type_mismatch); | 508 static_assert(0 == kWinding_FillType, "fill_type_mismatch"); |
| 509 SK_COMPILE_ASSERT(1 == kEvenOdd_FillType, fill_type_mismatch); | 509 static_assert(1 == kEvenOdd_FillType, "fill_type_mismatch"); |
| 510 SK_COMPILE_ASSERT(2 == kInverseWinding_FillType, fill_type_mismatch); | 510 static_assert(2 == kInverseWinding_FillType, "fill_type_mismatch"); |
| 511 SK_COMPILE_ASSERT(3 == kInverseEvenOdd_FillType, fill_type_mismatch); | 511 static_assert(3 == kInverseEvenOdd_FillType, "fill_type_mismatch"); |
| 512 return (fill & 2) != 0; | 512 return (fill & 2) != 0; |
| 513 } | 513 } |
| 514 | 514 |
| 515 /** | 515 /** |
| 516 * Returns the equivalent non-inverted fill type to the given fill type | 516 * Returns the equivalent non-inverted fill type to the given fill type |
| 517 * | 517 * |
| 518 * kWinding_FillType -> kWinding_FillType | 518 * kWinding_FillType -> kWinding_FillType |
| 519 * kEvenOdd_FillType -> kEvenOdd_FillType | 519 * kEvenOdd_FillType -> kEvenOdd_FillType |
| 520 * kInverseWinding_FillType -> kWinding_FillType | 520 * kInverseWinding_FillType -> kWinding_FillType |
| 521 * kInverseEvenOdd_FillType -> kEvenOdd_FillType | 521 * kInverseEvenOdd_FillType -> kEvenOdd_FillType |
| 522 */ | 522 */ |
| 523 static FillType ConvertToNonInverseFillType(FillType fill) { | 523 static FillType ConvertToNonInverseFillType(FillType fill) { |
| 524 SK_COMPILE_ASSERT(0 == kWinding_FillType, fill_type_mismatch); | 524 static_assert(0 == kWinding_FillType, "fill_type_mismatch"); |
| 525 SK_COMPILE_ASSERT(1 == kEvenOdd_FillType, fill_type_mismatch); | 525 static_assert(1 == kEvenOdd_FillType, "fill_type_mismatch"); |
| 526 SK_COMPILE_ASSERT(2 == kInverseWinding_FillType, fill_type_mismatch); | 526 static_assert(2 == kInverseWinding_FillType, "fill_type_mismatch"); |
| 527 SK_COMPILE_ASSERT(3 == kInverseEvenOdd_FillType, fill_type_mismatch); | 527 static_assert(3 == kInverseEvenOdd_FillType, "fill_type_mismatch"); |
| 528 return (FillType)(fill & 1); | 528 return (FillType)(fill & 1); |
| 529 } | 529 } |
| 530 | 530 |
| 531 /** | 531 /** |
| 532 * Returns true if the path specifies a rectangle. | 532 * Returns true if the path specifies a rectangle. |
| 533 * | 533 * |
| 534 * If this returns false, then all output parameters are ignored, and left | 534 * If this returns false, then all output parameters are ignored, and left |
| 535 * unchanged. If this returns true, then each of the output parameters | 535 * unchanged. If this returns true, then each of the output parameters |
| 536 * are checked for NULL. If they are not, they return their value. | 536 * are checked for NULL. If they are not, they return their value. |
| 537 * | 537 * |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 void setPt(int index, SkScalar x, SkScalar y); | 1002 void setPt(int index, SkScalar x, SkScalar y); |
| 1003 | 1003 |
| 1004 friend class SkAutoPathBoundsUpdate; | 1004 friend class SkAutoPathBoundsUpdate; |
| 1005 friend class SkAutoDisableOvalCheck; | 1005 friend class SkAutoDisableOvalCheck; |
| 1006 friend class SkAutoDisableDirectionCheck; | 1006 friend class SkAutoDisableDirectionCheck; |
| 1007 friend class SkBench_AddPathTest; // perf test reversePathTo | 1007 friend class SkBench_AddPathTest; // perf test reversePathTo |
| 1008 friend class PathTest_Private; // unit test reversePathTo | 1008 friend class PathTest_Private; // unit test reversePathTo |
| 1009 }; | 1009 }; |
| 1010 | 1010 |
| 1011 #endif | 1011 #endif |
| OLD | NEW |