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

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

Issue 12699002: Upstream changes from Android. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: more fiex Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « include/core/SkPaint.h ('k') | include/core/SkThread_platform.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 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 * When a rrect is simple, all of its radii are equal. This returns one 181 * When a rrect is simple, all of its radii are equal. This returns one
182 * of those radii. This call requires the rrect to be non-complex. 182 * of those radii. This call requires the rrect to be non-complex.
183 */ 183 */
184 const SkVector& getSimpleRadii() const { 184 const SkVector& getSimpleRadii() const {
185 SkASSERT(!this->isComplex()); 185 SkASSERT(!this->isComplex());
186 return fRadii[0]; 186 return fRadii[0];
187 } 187 }
188 188
189 friend bool operator==(const SkRRect& a, const SkRRect& b) { 189 friend bool operator==(const SkRRect& a, const SkRRect& b) {
190 return a.fRect == b.fRect && 190 return a.fRect == b.fRect &&
191 SkScalarsEqual((SkScalar*) a.fRadii, (SkScalar*) b.fRadii, 8); 191 SkScalarsEqual(a.fRadii[0].asScalars(),
192 b.fRadii[0].asScalars(), 8);
192 } 193 }
193 194
194 friend bool operator!=(const SkRRect& a, const SkRRect& b) { 195 friend bool operator!=(const SkRRect& a, const SkRRect& b) {
195 return a.fRect != b.fRect || 196 return a.fRect != b.fRect ||
196 !SkScalarsEqual((SkScalar*) a.fRadii, (SkScalar*) b.fRadii, 8); 197 !SkScalarsEqual(a.fRadii[0].asScalars(),
198 b.fRadii[0].asScalars(), 8);
197 } 199 }
198 200
199 /** 201 /**
200 * Returns true if (p.fX,p.fY) is inside the RR, and the RR 202 * Returns true if (p.fX,p.fY) is inside the RR, and the RR
201 * is not empty. 203 * is not empty.
202 * 204 *
203 * Contains treats the left and top differently from the right and bottom. 205 * Contains treats the left and top differently from the right and bottom.
204 * The left and top coordinates of the RR are themselves considered 206 * The left and top coordinates of the RR are themselves considered
205 * to be inside, while the right and bottom are not. All the points on the 207 * to be inside, while the right and bottom are not. All the points on the
206 * edges of the corners are considered to be inside. 208 * edges of the corners are considered to be inside.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 // TODO: add padding so we can use memcpy for flattening and not copy 279 // TODO: add padding so we can use memcpy for flattening and not copy
278 // uninitialized data 280 // uninitialized data
279 281
280 void computeType() const; 282 void computeType() const;
281 283
282 // to access fRadii directly 284 // to access fRadii directly
283 friend class SkPath; 285 friend class SkPath;
284 }; 286 };
285 287
286 #endif 288 #endif
OLDNEW
« no previous file with comments | « include/core/SkPaint.h ('k') | include/core/SkThread_platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698