OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |