| 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 18 matching lines...) Expand all Loading... |
| 29 * | 29 * |
| 30 * The points and verbs are stored in a single allocation. The points are at the
begining of the | 30 * The points and verbs are stored in a single allocation. The points are at the
begining of the |
| 31 * allocation while the verbs are stored at end of the allocation, in reverse or
der. Thus the points | 31 * allocation while the verbs are stored at end of the allocation, in reverse or
der. Thus the points |
| 32 * and verbs both grow into the middle of the allocation until the meet. To acce
ss verb i in the | 32 * and verbs both grow into the middle of the allocation until the meet. To acce
ss verb i in the |
| 33 * verb array use ref.verbs()[~i] (because verbs() returns a pointer just beyond
the first | 33 * verb array use ref.verbs()[~i] (because verbs() returns a pointer just beyond
the first |
| 34 * logical verb or the last verb in memory). | 34 * logical verb or the last verb in memory). |
| 35 */ | 35 */ |
| 36 | 36 |
| 37 class SK_API SkPathRef : public ::SkRefCnt { | 37 class SK_API SkPathRef : public ::SkRefCnt { |
| 38 public: | 38 public: |
| 39 SK_DECLARE_INST_COUNT(SkPathRef); | |
| 40 | |
| 41 class Editor { | 39 class Editor { |
| 42 public: | 40 public: |
| 43 Editor(SkAutoTUnref<SkPathRef>* pathRef, | 41 Editor(SkAutoTUnref<SkPathRef>* pathRef, |
| 44 int incReserveVerbs = 0, | 42 int incReserveVerbs = 0, |
| 45 int incReservePoints = 0); | 43 int incReservePoints = 0); |
| 46 | 44 |
| 47 ~Editor() { SkDEBUGCODE(sk_atomic_dec(&fPathRef->fEditorsAttached);) } | 45 ~Editor() { SkDEBUGCODE(sk_atomic_dec(&fPathRef->fEditorsAttached);) } |
| 48 | 46 |
| 49 /** | 47 /** |
| 50 * Returns the array of points. | 48 * Returns the array of points. |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 kEmptyGenID = 1, // GenID reserved for path ref with zero points and zer
o verbs. | 450 kEmptyGenID = 1, // GenID reserved for path ref with zero points and zer
o verbs. |
| 453 }; | 451 }; |
| 454 mutable uint32_t fGenerationID; | 452 mutable uint32_t fGenerationID; |
| 455 SkDEBUGCODE(int32_t fEditorsAttached;) // assert that only one editor in use
at any time. | 453 SkDEBUGCODE(int32_t fEditorsAttached;) // assert that only one editor in use
at any time. |
| 456 | 454 |
| 457 friend class PathRefTest_Private; | 455 friend class PathRefTest_Private; |
| 458 typedef SkRefCnt INHERITED; | 456 typedef SkRefCnt INHERITED; |
| 459 }; | 457 }; |
| 460 | 458 |
| 461 #endif | 459 #endif |
| OLD | NEW |