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

Side by Side Diff: src/core/SkBitmapHeap.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 | « include/core/SkTSearch.h ('k') | src/core/SkBitmapHeap.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 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 #ifndef SkBitmapHeap_DEFINED 8 #ifndef SkBitmapHeap_DEFINED
9 #define SkBitmapHeap_DEFINED 9 #define SkBitmapHeap_DEFINED
10 10
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 const uint32_t fWidth; 231 const uint32_t fWidth;
232 const uint32_t fHeight; 232 const uint32_t fHeight;
233 233
234 // TODO: Generalize the LRU caching mechanism 234 // TODO: Generalize the LRU caching mechanism
235 LookupEntry* fMoreRecentlyUsed; 235 LookupEntry* fMoreRecentlyUsed;
236 LookupEntry* fLessRecentlyUsed; 236 LookupEntry* fLessRecentlyUsed;
237 237
238 uint32_t fStorageSlot; // slot of corresponding bitmap in fStorage. 238 uint32_t fStorageSlot; // slot of corresponding bitmap in fStorage.
239 239
240 /** 240 /**
241 * Compare two LookupEntry pointers, returning -1, 0, 1 for sorting. 241 * Compare two LookupEntry pointers for sorting and searching.
242 */ 242 */
243 static int Compare(const LookupEntry* a, const LookupEntry* b); 243 static bool Less(const LookupEntry& a, const LookupEntry& b);
244 }; 244 };
245 245
246 /** 246 /**
247 * Remove the entry from the lookup table. Also deletes the entry pointed 247 * Remove the entry from the lookup table. Also deletes the entry pointed
248 * to by the table. Therefore, if a pointer to that one was passed in, the 248 * to by the table. Therefore, if a pointer to that one was passed in, the
249 * pointer should no longer be used, since the object to which it points has 249 * pointer should no longer be used, since the object to which it points has
250 * been deleted. 250 * been deleted.
251 * @return The index in the lookup table of the entry before removal. 251 * @return The index in the lookup table of the entry before removal.
252 */ 252 */
253 int removeEntryFromLookupTable(LookupEntry*); 253 int removeEntryFromLookupTable(LookupEntry*);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 const int32_t fOwnerCount; 298 const int32_t fOwnerCount;
299 size_t fBytesAllocated; 299 size_t fBytesAllocated;
300 300
301 bool fDeferAddingOwners; 301 bool fDeferAddingOwners;
302 SkTDArray<int> fDeferredEntries; 302 SkTDArray<int> fDeferredEntries;
303 303
304 typedef SkBitmapHeapReader INHERITED; 304 typedef SkBitmapHeapReader INHERITED;
305 }; 305 };
306 306
307 #endif // SkBitmapHeap_DEFINED 307 #endif // SkBitmapHeap_DEFINED
OLDNEW
« no previous file with comments | « include/core/SkTSearch.h ('k') | src/core/SkBitmapHeap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698