| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| 74 // is not related to its "index". | 74 // is not related to its "index". |
| 75 SkTDArray<Pair> fList; | 75 SkTDArray<Pair> fList; |
| 76 | 76 |
| 77 static int Cmp(const Pair* a, const Pair* b); | 77 static bool Less(const Pair& a, const Pair& b); |
| 78 | 78 |
| 79 typedef SkRefCnt INHERITED; | 79 typedef SkRefCnt INHERITED; |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 /** | 82 /** |
| 83 * Templated wrapper for SkPtrSet, just meant to automate typecasting | 83 * Templated wrapper for SkPtrSet, just meant to automate typecasting |
| 84 * parameters to and from void* (which the base class expects). | 84 * parameters to and from void* (which the base class expects). |
| 85 */ | 85 */ |
| 86 template <typename T> class SkTPtrSet : public SkPtrSet { | 86 template <typename T> class SkTPtrSet : public SkPtrSet { |
| 87 public: | 87 public: |
| (...skipping 54 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 |