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

Side by Side Diff: src/gpu/effects/GrTextureStripAtlas.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/SkTSort.h ('k') | src/gpu/effects/GrTextureStripAtlas.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 8
9 #ifndef GrTextureStripAtlas_DEFINED 9 #ifndef GrTextureStripAtlas_DEFINED
10 #define GrTextureStripAtlas_DEFINED 10 #define GrTextureStripAtlas_DEFINED
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 /** 114 /**
115 * Searches the key table for a key and returns the index if found; if not f ound, it returns 115 * Searches the key table for a key and returns the index if found; if not f ound, it returns
116 * the bitwise not of the index at which we could insert the key to maintain a sorted list. 116 * the bitwise not of the index at which we could insert the key to maintain a sorted list.
117 **/ 117 **/
118 int searchByKey(uint32_t key); 118 int searchByKey(uint32_t key);
119 119
120 /** 120 /**
121 * Compare two atlas rows by key, so we can sort/search by key 121 * Compare two atlas rows by key, so we can sort/search by key
122 */ 122 */
123 static int compareKeys(const AtlasRow* lhs, const AtlasRow* rhs) { 123 static bool KeyLess(const AtlasRow& lhs, const AtlasRow& rhs) {
124 return lhs->fKey - rhs->fKey; 124 return lhs.fKey < rhs.fKey;
125 } 125 }
126 126
127 #ifdef SK_DEBUG 127 #ifdef SK_DEBUG
128 void validate(); 128 void validate();
129 #endif 129 #endif
130 130
131 /** 131 /**
132 * Clean up callback registered with GrContext. Allows this class to 132 * Clean up callback registered with GrContext. Allows this class to
133 * free up any allocated AtlasEntry and GrTextureStripAtlas objects 133 * free up any allocated AtlasEntry and GrTextureStripAtlas objects
134 */ 134 */
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // Head and tail for linked list of least-recently-used rows (front = least recently used). 172 // Head and tail for linked list of least-recently-used rows (front = least recently used).
173 // Note that when a texture is locked, it gets removed from this list until it is unlocked. 173 // Note that when a texture is locked, it gets removed from this list until it is unlocked.
174 AtlasRow* fLRUFront; 174 AtlasRow* fLRUFront;
175 AtlasRow* fLRUBack; 175 AtlasRow* fLRUBack;
176 176
177 // A list of pointers to AtlasRows that currently contain cached images, sor ted by key 177 // A list of pointers to AtlasRows that currently contain cached images, sor ted by key
178 SkTDArray<AtlasRow*> fKeyTable; 178 SkTDArray<AtlasRow*> fKeyTable;
179 }; 179 };
180 180
181 #endif 181 #endif
OLDNEW
« no previous file with comments | « src/core/SkTSort.h ('k') | src/gpu/effects/GrTextureStripAtlas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698