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 #include "GrTextureStripAtlas.h" | 9 #include "GrTextureStripAtlas.h" |
10 #include "SkPixelRef.h" | 10 #include "SkPixelRef.h" |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 } | 266 } |
267 } | 267 } |
268 } | 268 } |
269 row->fNext = NULL; | 269 row->fNext = NULL; |
270 row->fPrev = NULL; | 270 row->fPrev = NULL; |
271 } | 271 } |
272 | 272 |
273 int GrTextureStripAtlas::searchByKey(uint32_t key) { | 273 int GrTextureStripAtlas::searchByKey(uint32_t key) { |
274 AtlasRow target; | 274 AtlasRow target; |
275 target.fKey = key; | 275 target.fKey = key; |
276 return SkTSearch<AtlasRow, GrTextureStripAtlas::compareKeys>((const AtlasRow
**)fKeyTable.begin(), | 276 return SkTSearch<const AtlasRow, |
277 fKeyTable.count
(), | 277 GrTextureStripAtlas::KeyLess>((const AtlasRow**)fKeyTable.b
egin(), |
278 &target, | 278 fKeyTable.count(), |
279 sizeof(AtlasRow
*)); | 279 &target, |
280 } | 280 sizeof(AtlasRow*)); |
| 281 } |
281 | 282 |
282 #ifdef SK_DEBUG | 283 #ifdef SK_DEBUG |
283 void GrTextureStripAtlas::validate() { | 284 void GrTextureStripAtlas::validate() { |
284 | 285 |
285 // Our key table should be sorted | 286 // Our key table should be sorted |
286 uint32_t prev = 1 > fKeyTable.count() ? 0 : fKeyTable[0]->fKey; | 287 uint32_t prev = 1 > fKeyTable.count() ? 0 : fKeyTable[0]->fKey; |
287 for (int i = 1; i < fKeyTable.count(); ++i) { | 288 for (int i = 1; i < fKeyTable.count(); ++i) { |
288 GrAssert(prev < fKeyTable[i]->fKey); | 289 GrAssert(prev < fKeyTable[i]->fKey); |
289 GrAssert(fKeyTable[i]->fKey != kEmptyAtlasRowKey); | 290 GrAssert(fKeyTable[i]->fKey != kEmptyAtlasRowKey); |
290 prev = fKeyTable[i]->fKey; | 291 prev = fKeyTable[i]->fKey; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 | 339 |
339 // If we have locked rows, we should have a locked texture, otherwise | 340 // If we have locked rows, we should have a locked texture, otherwise |
340 // it should be unlocked | 341 // it should be unlocked |
341 if (fLockedRows == 0) { | 342 if (fLockedRows == 0) { |
342 GrAssert(NULL == fTexture); | 343 GrAssert(NULL == fTexture); |
343 } else { | 344 } else { |
344 GrAssert(NULL != fTexture); | 345 GrAssert(NULL != fTexture); |
345 } | 346 } |
346 } | 347 } |
347 #endif | 348 #endif |
OLD | NEW |