| 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 Block* block = iter.get(); | 313 Block* block = iter.get(); |
| 314 if (largestSize < block->fSize) { | 314 if (largestSize < block->fSize) { |
| 315 largestSize = block->fSize; | 315 largestSize = block->fSize; |
| 316 } | 316 } |
| 317 iter.next(); | 317 iter.next(); |
| 318 } | 318 } |
| 319 SkASSERT(largestSize == fLargestBlockSize); | 319 SkASSERT(largestSize == fLargestBlockSize); |
| 320 #endif | 320 #endif |
| 321 } | 321 } |
| 322 fFreeSize -= alignedSize; | 322 fFreeSize -= alignedSize; |
| 323 SkASSERT(allocSize > 0); | 323 SkASSERT(*allocSize > 0); |
| 324 | 324 |
| 325 return true; | 325 return true; |
| 326 } | 326 } |
| 327 | 327 |
| 328 SkDebugf("Can't allocate %d bytes, %d bytes available, largest free block %d
\n", alignedSize, fFreeSize, fLargestBlockSize); | 328 SkDebugf("Can't allocate %d bytes, %d bytes available, largest free block %d
\n", alignedSize, fFreeSize, fLargestBlockSize); |
| 329 | 329 |
| 330 return false; | 330 return false; |
| 331 } | 331 } |
| 332 | 332 |
| 333 void GrVkFreeListAlloc::free(VkDeviceSize allocOffset, VkDeviceSize allocSize) { | 333 void GrVkFreeListAlloc::free(VkDeviceSize allocOffset, VkDeviceSize allocSize) { |
| (...skipping 214 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 |