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

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

Issue 1278323002: api helpers inspired by blink use-cases (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 months 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 | « include/core/SkMatrix.h ('k') | no next file » | 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 2012 Google Inc. 2 * Copyright 2012 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 #ifndef SkRRect_DEFINED 8 #ifndef SkRRect_DEFINED
9 #define SkRRect_DEFINED 9 #define SkRRect_DEFINED
10 10
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 return; 127 return;
128 } 128 }
129 129
130 fRect = rect; 130 fRect = rect;
131 memset(fRadii, 0, sizeof(fRadii)); 131 memset(fRadii, 0, sizeof(fRadii));
132 fType = kRect_Type; 132 fType = kRect_Type;
133 133
134 SkDEBUGCODE(this->validate();) 134 SkDEBUGCODE(this->validate();)
135 } 135 }
136 136
137 static SkRRect MakeRect(const SkRect& r) {
138 SkRRect rr;
139 rr.setRect(r);
140 return rr;
141 }
142
137 /** 143 /**
138 * Set this RR to match the supplied oval. All x radii will equal half the 144 * Set this RR to match the supplied oval. All x radii will equal half the
139 * width and all y radii will equal half the height. 145 * width and all y radii will equal half the height.
140 */ 146 */
141 void setOval(const SkRect& oval) { 147 void setOval(const SkRect& oval) {
142 if (oval.isEmpty()) { 148 if (oval.isEmpty()) {
143 this->setEmpty(); 149 this->setEmpty();
144 return; 150 return;
145 } 151 }
146 152
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 // uninitialized data 304 // uninitialized data
299 305
300 void computeType(); 306 void computeType();
301 bool checkCornerContainment(SkScalar x, SkScalar y) const; 307 bool checkCornerContainment(SkScalar x, SkScalar y) const;
302 308
303 // to access fRadii directly 309 // to access fRadii directly
304 friend class SkPath; 310 friend class SkPath;
305 }; 311 };
306 312
307 #endif 313 #endif
OLDNEW
« no previous file with comments | « include/core/SkMatrix.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698