Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(455)

Side by Side Diff: include/core/SkRect.h

Issue 808793002: add sample for arcTo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | samplecode/SampleCode.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 SkRect_DEFINED 8 #ifndef SkRect_DEFINED
9 #define SkRect_DEFINED 9 #define SkRect_DEFINED
10 10
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 685
686 public: 686 public:
687 /** 687 /**
688 * Return true if this rectangle is not empty, and the specified sides of 688 * Return true if this rectangle is not empty, and the specified sides of
689 * a rectangle are not empty, and they intersect. 689 * a rectangle are not empty, and they intersect.
690 */ 690 */
691 bool intersects(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom ) const { 691 bool intersects(SkScalar left, SkScalar top, SkScalar right, SkScalar bottom ) const {
692 return Intersects(fLeft, fTop, fRight, fBottom, left, top, right, bottom ); 692 return Intersects(fLeft, fTop, fRight, fBottom, left, top, right, bottom );
693 } 693 }
694 694
695 bool intersects(const SkRect& r) const {
696 return Intersects(fLeft, fTop, fRight, fBottom,
697 r.fLeft, r.fTop, r.fRight, r.fBottom);
698 }
699
695 /** 700 /**
696 * Return true if rectangles a and b are not empty and intersect. 701 * Return true if rectangles a and b are not empty and intersect.
697 */ 702 */
698 static bool Intersects(const SkRect& a, const SkRect& b) { 703 static bool Intersects(const SkRect& a, const SkRect& b) {
699 return Intersects(a.fLeft, a.fTop, a.fRight, a.fBottom, 704 return Intersects(a.fLeft, a.fTop, a.fRight, a.fBottom,
700 b.fLeft, b.fTop, b.fRight, b.fBottom); 705 b.fLeft, b.fTop, b.fRight, b.fBottom);
701 } 706 }
702 707
703 /** 708 /**
704 * Update this rectangle to enclose itself and the specified rectangle. 709 * Update this rectangle to enclose itself and the specified rectangle.
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 * cast-safe way to treat the rect as an array of (4) SkScalars. 872 * cast-safe way to treat the rect as an array of (4) SkScalars.
868 */ 873 */
869 const SkScalar* asScalars() const { return &fLeft; } 874 const SkScalar* asScalars() const { return &fLeft; }
870 875
871 void dump(bool asHex) const; 876 void dump(bool asHex) const;
872 void dump() const { this->dump(false); } 877 void dump() const { this->dump(false); }
873 void dumpHex() const { this->dump(true); } 878 void dumpHex() const { this->dump(true); }
874 }; 879 };
875 880
876 #endif 881 #endif
OLDNEW
« no previous file with comments | « no previous file | samplecode/SampleCode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698