Chromium Code Reviews| 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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 561 | 561 |
| 562 /** | 562 /** |
| 563 * Add a closed rectangle contour to the path | 563 * Add a closed rectangle contour to the path |
| 564 * @param rect The rectangle to add as a closed contour to the path | 564 * @param rect The rectangle to add as a closed contour to the path |
| 565 * @param dir The direction to wind the rectangle's contour. | 565 * @param dir The direction to wind the rectangle's contour. |
| 566 */ | 566 */ |
| 567 void addRect(const SkRect& rect, Direction dir = kCW_Direction); | 567 void addRect(const SkRect& rect, Direction dir = kCW_Direction); |
| 568 | 568 |
| 569 /** | 569 /** |
| 570 * Add a closed rectangle contour to the path | 570 * Add a closed rectangle contour to the path |
| 571 * @param rect The rectangle to add as a closed contour to the path | |
| 572 * @param dir The direction to wind the rectangle's contour. | |
| 573 * @param start Starting point for the contour (initial moveTo), expressed as | |
| 574 * a corner index, starting in the upper-left position, clock- wise: | |
| 575 * | |
| 576 * 0 1 | |
| 577 * *-------* | |
| 578 * | | | |
| 579 * *-------* | |
| 580 * 3 2 | |
| 581 */ | |
| 582 void addRect(const SkRect& rect, Direction dir, unsigned start); | |
| 583 | |
| 584 /** | |
| 585 * Add a closed rectangle contour to the path | |
| 571 * | 586 * |
| 572 * @param left The left side of a rectangle to add as a closed contour | 587 * @param left The left side of a rectangle to add as a closed contour |
| 573 * to the path | 588 * to the path |
| 574 * @param top The top of a rectangle to add as a closed contour to the | 589 * @param top The top of a rectangle to add as a closed contour to the |
| 575 * path | 590 * path |
| 576 * @param right The right side of a rectangle to add as a closed contour | 591 * @param right The right side of a rectangle to add as a closed contour |
| 577 * to the path | 592 * to the path |
| 578 * @param bottom The bottom of a rectangle to add as a closed contour to | 593 * @param bottom The bottom of a rectangle to add as a closed contour to |
| 579 * the path | 594 * the path |
| 580 * @param dir The direction to wind the rectangle's contour. | 595 * @param dir The direction to wind the rectangle's contour. |
| 581 */ | 596 */ |
| 582 void addRect(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom, | 597 void addRect(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom, |
| 583 Direction dir = kCW_Direction); | 598 Direction dir = kCW_Direction); |
| 584 | 599 |
| 585 /** | 600 /** |
| 586 * Add a closed oval contour to the path | 601 * Add a closed oval contour to the path |
| 587 * | 602 * |
| 588 * @param oval The bounding oval to add as a closed contour to the path | 603 * @param oval The bounding oval to add as a closed contour to the path |
| 589 * @param dir The direction to wind the oval's contour. | 604 * @param dir The direction to wind the oval's contour. |
|
reed1
2015/11/17 15:02:51
Should we document here where our starting point i
f(malita)
2015/11/17 15:35:15
Done.
| |
| 590 */ | 605 */ |
| 591 void addOval(const SkRect& oval, Direction dir = kCW_Direction); | 606 void addOval(const SkRect& oval, Direction dir = kCW_Direction); |
| 592 | 607 |
| 593 /** | 608 /** |
| 609 * Add a closed oval contour to the path | |
| 610 * | |
| 611 * @param oval The bounding oval to add as a closed contour to the path | |
| 612 * @param dir The direction to wind the oval's contour. | |
| 613 * @param start Starting point for the contour (initial moveTo), expressed | |
| 614 * as an index of the ellipse vertices in 90/0/270/180deg orde r: | |
|
reed1
2015/11/17 15:02:51
Might add that the 0->1->2->3 ordering is in CW di
f(malita)
2015/11/17 15:35:15
Done.
| |
| 615 * | |
| 616 * 0 | |
| 617 * -*- | |
| 618 * | | | |
| 619 * 3 * * 1 | |
| 620 * | | | |
| 621 * -*- | |
| 622 * 2 | |
| 623 */ | |
| 624 void addOval(const SkRect& oval, Direction dir, unsigned start); | |
| 625 | |
| 626 /** | |
| 594 * Add a closed circle contour to the path | 627 * Add a closed circle contour to the path |
| 595 * | 628 * |
| 596 * @param x The x-coordinate of the center of a circle to add as a | 629 * @param x The x-coordinate of the center of a circle to add as a |
| 597 * closed contour to the path | 630 * closed contour to the path |
| 598 * @param y The y-coordinate of the center of a circle to add as a | 631 * @param y The y-coordinate of the center of a circle to add as a |
| 599 * closed contour to the path | 632 * closed contour to the path |
| 600 * @param radius The radius of a circle to add as a closed contour to the | 633 * @param radius The radius of a circle to add as a closed contour to the |
| 601 * path | 634 * path |
| 602 * @param dir The direction to wind the circle's contour. | 635 * @param dir The direction to wind the circle's contour. |
| 603 */ | 636 */ |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 634 * sqaure corner and oversized radii are proportionally scaled down). | 667 * sqaure corner and oversized radii are proportionally scaled down). |
| 635 */ | 668 */ |
| 636 void addRoundRect(const SkRect& rect, const SkScalar radii[], | 669 void addRoundRect(const SkRect& rect, const SkScalar radii[], |
| 637 Direction dir = kCW_Direction); | 670 Direction dir = kCW_Direction); |
| 638 | 671 |
| 639 /** | 672 /** |
| 640 * Add an SkRRect contour to the path | 673 * Add an SkRRect contour to the path |
| 641 * @param rrect The rounded rect to add as a closed contour | 674 * @param rrect The rounded rect to add as a closed contour |
| 642 * @param dir The winding direction for the new contour. | 675 * @param dir The winding direction for the new contour. |
| 643 */ | 676 */ |
| 644 void addRRect(const SkRRect& rrect, Direction dir = kCW_Direction); | 677 void addRRect(const SkRRect& rrect, Direction dir = kCW_Direction); |
|
reed1
2015/11/17 15:02:51
Document where our starting point is?
f(malita)
2015/11/17 15:35:15
Done.
| |
| 645 | 678 |
| 646 /** | 679 /** |
| 680 * Add an SkRRect contour to the path | |
| 681 * @param rrect The rounded rect to add as a closed contour | |
| 682 * @param dir The winding direction for the new contour. | |
| 683 * @param start Starting point for the contour (initial moveTo), expressed as | |
| 684 * an index of the radii minor/major points, ordered clock-wis e: | |
| 685 * | |
| 686 * 0 1 | |
| 687 * *----* | |
| 688 * 7 * * 2 | |
| 689 * | | | |
| 690 * 6 * * 3 | |
| 691 * *----* | |
| 692 * 5 4 | |
| 693 */ | |
| 694 void addRRect(const SkRRect& rrect, Direction dir, unsigned startIndex); | |
| 695 | |
| 696 /** | |
| 647 * Add a new contour made of just lines. This is just a fast version of | 697 * Add a new contour made of just lines. This is just a fast version of |
| 648 * the following: | 698 * the following: |
| 649 * this->moveTo(pts[0]); | 699 * this->moveTo(pts[0]); |
| 650 * for (int i = 1; i < count; ++i) { | 700 * for (int i = 1; i < count; ++i) { |
| 651 * this->lineTo(pts[i]); | 701 * this->lineTo(pts[i]); |
| 652 * } | 702 * } |
| 653 * if (close) { | 703 * if (close) { |
| 654 * this->close(); | 704 * this->close(); |
| 655 * } | 705 * } |
| 656 */ | 706 */ |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1001 void setPt(int index, SkScalar x, SkScalar y); | 1051 void setPt(int index, SkScalar x, SkScalar y); |
| 1002 | 1052 |
| 1003 friend class SkAutoPathBoundsUpdate; | 1053 friend class SkAutoPathBoundsUpdate; |
| 1004 friend class SkAutoDisableOvalCheck; | 1054 friend class SkAutoDisableOvalCheck; |
| 1005 friend class SkAutoDisableDirectionCheck; | 1055 friend class SkAutoDisableDirectionCheck; |
| 1006 friend class SkBench_AddPathTest; // perf test reversePathTo | 1056 friend class SkBench_AddPathTest; // perf test reversePathTo |
| 1007 friend class PathTest_Private; // unit test reversePathTo | 1057 friend class PathTest_Private; // unit test reversePathTo |
| 1008 }; | 1058 }; |
| 1009 | 1059 |
| 1010 #endif | 1060 #endif |
| OLD | NEW |