OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrVkMemory.h" | 8 #include "GrVkMemory.h" |
9 | 9 |
10 #include "GrVkGpu.h" | 10 #include "GrVkGpu.h" |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 #ifdef SK_DEBUG | 290 #ifdef SK_DEBUG |
291 VkDeviceSize largestSize = 0; | 291 VkDeviceSize largestSize = 0; |
292 iter = fFreeList.headIter(); | 292 iter = fFreeList.headIter(); |
293 while (iter.get()) { | 293 while (iter.get()) { |
294 Block* block = iter.get(); | 294 Block* block = iter.get(); |
295 if (largestSize < block->fSize) { | 295 if (largestSize < block->fSize) { |
296 largestSize = block->fSize; | 296 largestSize = block->fSize; |
297 } | 297 } |
298 iter.next(); | 298 iter.next(); |
299 } | 299 } |
300 SkASSERT(largestSize == fLargestBlockSize) | 300 SkASSERT(largestSize == fLargestBlockSize); |
301 #endif | 301 #endif |
302 } else { | 302 } else { |
303 SkASSERT(bestFit->fSize == alignedSize); | 303 SkASSERT(bestFit->fSize == alignedSize); |
304 if (fLargestBlockOffset == originalBestFitOffset) { | 304 if (fLargestBlockOffset == originalBestFitOffset) { |
305 fLargestBlockSize = secondLargestSize; | 305 fLargestBlockSize = secondLargestSize; |
306 fLargestBlockOffset = secondLargestOffset; | 306 fLargestBlockOffset = secondLargestOffset; |
307 } | 307 } |
308 fFreeList.remove(bestFit); | 308 fFreeList.remove(bestFit); |
309 #ifdef SK_DEBUG | 309 #ifdef SK_DEBUG |
310 VkDeviceSize largestSize = 0; | 310 VkDeviceSize largestSize = 0; |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 fSubHeaps[i]->free(alloc); | 548 fSubHeaps[i]->free(alloc); |
549 fUsedSize -= alloc.fSize; | 549 fUsedSize -= alloc.fSize; |
550 return true; | 550 return true; |
551 } | 551 } |
552 } | 552 } |
553 | 553 |
554 return false; | 554 return false; |
555 } | 555 } |
556 | 556 |
557 | 557 |
OLD | NEW |