OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2008 The Android Open Source Project | 3 * Copyright 2008 The Android Open Source Project |
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 | 9 |
10 #ifndef SkPtrSet_DEFINED | 10 #ifndef SkPtrSet_DEFINED |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 */ | 52 */ |
53 void copyToArray(void* array[]) const; | 53 void copyToArray(void* array[]) const; |
54 | 54 |
55 /** | 55 /** |
56 * Call decPtr() on each ptr in the set, and the reset the size of the set | 56 * Call decPtr() on each ptr in the set, and the reset the size of the set |
57 * to 0. | 57 * to 0. |
58 */ | 58 */ |
59 void reset(); | 59 void reset(); |
60 | 60 |
61 protected: | 61 protected: |
62 virtual void incPtr(void* ptr) {} | 62 virtual void incPtr(void*) {} |
63 virtual void decPtr(void* ptr) {} | 63 virtual void decPtr(void*) {} |
64 | 64 |
65 private: | 65 private: |
66 struct Pair { | 66 struct Pair { |
67 void* fPtr; // never NULL | 67 void* fPtr; // never NULL |
68 uint32_t fIndex; // 1...N | 68 uint32_t fIndex; // 1...N |
69 }; | 69 }; |
70 | 70 |
71 // we store the ptrs in sorted-order (using Cmp) so that we can efficiently | 71 // we store the ptrs in sorted-order (using Cmp) so that we can efficiently |
72 // detect duplicates when add() is called. Hence we need to store the | 72 // detect duplicates when add() is called. Hence we need to store the |
73 // ptr and its ID/fIndex explicitly, since the ptr's position in the array | 73 // ptr and its ID/fIndex explicitly, since the ptr's position in the array |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 const char* getNextAddedFactoryName(); | 142 const char* getNextAddedFactoryName(); |
143 private: | 143 private: |
144 int fNextAddedFactory; | 144 int fNextAddedFactory; |
145 SkFactorySet fFactorySet; | 145 SkFactorySet fFactorySet; |
146 SkTDArray<const char*> fNames; | 146 SkTDArray<const char*> fNames; |
147 | 147 |
148 typedef SkRefCnt INHERITED; | 148 typedef SkRefCnt INHERITED; |
149 }; | 149 }; |
150 | 150 |
151 #endif | 151 #endif |
OLD | NEW |