OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #ifndef SkPathRef_DEFINED | 9 #ifndef SkPathRef_DEFINED |
10 #define SkPathRef_DEFINED | 10 #define SkPathRef_DEFINED |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 bounds->setEmpty(); | 284 bounds->setEmpty(); |
285 return count ? ref.points()->isFinite() : true; | 285 return count ? ref.points()->isFinite() : true; |
286 } else { | 286 } else { |
287 return bounds->setBoundsCheck(ref.points(), count); | 287 return bounds->setBoundsCheck(ref.points(), count); |
288 } | 288 } |
289 } | 289 } |
290 | 290 |
291 // called, if dirty, by getBounds() | 291 // called, if dirty, by getBounds() |
292 void computeBounds() const { | 292 void computeBounds() const { |
293 SkDEBUGCODE(this->validate();) | 293 SkDEBUGCODE(this->validate();) |
294 SkASSERT(fBoundsIsDirty); | 294 // TODO(mtklein): remove fBoundsIsDirty and fIsFinite, |
| 295 // using an inverted rect instead of fBoundsIsDirty and always recalcula
ting fIsFinite. |
| 296 //SkASSERT(fBoundsIsDirty); |
295 | 297 |
296 fIsFinite = ComputePtBounds(fBounds.get(), *this); | 298 fIsFinite = ComputePtBounds(fBounds.get(), *this); |
297 fBoundsIsDirty = false; | 299 fBoundsIsDirty = false; |
298 } | 300 } |
299 | 301 |
300 void setBounds(const SkRect& rect) { | 302 void setBounds(const SkRect& rect) { |
301 SkASSERT(rect.fLeft <= rect.fRight && rect.fTop <= rect.fBottom); | 303 SkASSERT(rect.fLeft <= rect.fRight && rect.fTop <= rect.fBottom); |
302 fBounds = rect; | 304 fBounds = rect; |
303 fBoundsIsDirty = false; | 305 fBoundsIsDirty = false; |
304 fIsFinite = fBounds->isFinite(); | 306 fIsFinite = fBounds->isFinite(); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 kEmptyGenID = 1, // GenID reserved for path ref with zero points and zer
o verbs. | 453 kEmptyGenID = 1, // GenID reserved for path ref with zero points and zer
o verbs. |
452 }; | 454 }; |
453 mutable uint32_t fGenerationID; | 455 mutable uint32_t fGenerationID; |
454 SkDEBUGCODE(int32_t fEditorsAttached;) // assert that only one editor in use
at any time. | 456 SkDEBUGCODE(int32_t fEditorsAttached;) // assert that only one editor in use
at any time. |
455 | 457 |
456 friend class PathRefTest_Private; | 458 friend class PathRefTest_Private; |
457 typedef SkRefCnt INHERITED; | 459 typedef SkRefCnt INHERITED; |
458 }; | 460 }; |
459 | 461 |
460 #endif | 462 #endif |
OLD | NEW |