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

Side by Side Diff: src/core/SkPtrRecorder.h

Issue 15070011: One SkTSearch to rule them all. Allow key to be of different type than the array. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fixes to compile on gcc Created 7 years, 7 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 | « src/core/SkPictureFlat.h ('k') | src/core/SkPtrRecorder.cpp » ('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 /* 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
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
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
OLDNEW
« no previous file with comments | « src/core/SkPictureFlat.h ('k') | src/core/SkPtrRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698