Index: src/gpu/GrMemoryPool.cpp |
diff --git a/src/gpu/GrMemoryPool.cpp b/src/gpu/GrMemoryPool.cpp |
index fc777e0db05dde53e73811520c5c5bfad2c383bb..a7707929625b88064a5d326af153a7afd7a9a1e4 100644 |
--- a/src/gpu/GrMemoryPool.cpp |
+++ b/src/gpu/GrMemoryPool.cpp |
@@ -30,9 +30,9 @@ GrMemoryPool::GrMemoryPool(size_t preallocSize, size_t minAllocSize) { |
GrMemoryPool::~GrMemoryPool() { |
VALIDATE; |
- GrAssert(0 == fAllocationCnt); |
- GrAssert(fHead == fTail); |
- GrAssert(0 == fHead->fLiveCount); |
+ SkASSERT(0 == fAllocationCnt); |
+ SkASSERT(fHead == fTail); |
+ SkASSERT(0 == fHead->fLiveCount); |
DeleteBlock(fHead); |
}; |
@@ -47,11 +47,11 @@ void* GrMemoryPool::allocate(size_t size) { |
block->fPrev = fTail; |
block->fNext = NULL; |
- GrAssert(NULL == fTail->fNext); |
+ SkASSERT(NULL == fTail->fNext); |
fTail->fNext = block; |
fTail = block; |
} |
- GrAssert(fTail->fFreeSize >= size); |
+ SkASSERT(fTail->fFreeSize >= size); |
intptr_t ptr = fTail->fCurrPtr; |
// We stash a pointer to the block header, just before the allocated space, |
// so that we can decrement the live count on delete in constant time. |
@@ -80,12 +80,12 @@ void GrMemoryPool::release(void* p) { |
} else { |
BlockHeader* prev = block->fPrev; |
BlockHeader* next = block->fNext; |
- GrAssert(prev); |
+ SkASSERT(prev); |
prev->fNext = next; |
if (next) { |
next->fPrev = prev; |
} else { |
- GrAssert(fTail == block); |
+ SkASSERT(fTail == block); |
fTail = prev; |
} |
DeleteBlock(block); |
@@ -106,7 +106,7 @@ GrMemoryPool::BlockHeader* GrMemoryPool::CreateBlock(size_t size) { |
BlockHeader* block = |
reinterpret_cast<BlockHeader*>(GrMalloc(size + kHeaderSize)); |
// we assume malloc gives us aligned memory |
- GrAssert(!(reinterpret_cast<intptr_t>(block) % kAlignment)); |
+ SkASSERT(!(reinterpret_cast<intptr_t>(block) % kAlignment)); |
block->fLiveCount = 0; |
block->fFreeSize = size; |
block->fCurrPtr = reinterpret_cast<intptr_t>(block) + kHeaderSize; |
@@ -122,13 +122,13 @@ void GrMemoryPool::validate() { |
#ifdef SK_DEBUG |
BlockHeader* block = fHead; |
BlockHeader* prev = NULL; |
- GrAssert(block); |
+ SkASSERT(block); |
int allocCount = 0; |
do { |
allocCount += block->fLiveCount; |
- GrAssert(prev == block->fPrev); |
+ SkASSERT(prev == block->fPrev); |
if (NULL != prev) { |
- GrAssert(prev->fNext == block); |
+ SkASSERT(prev->fNext == block); |
} |
intptr_t b = reinterpret_cast<intptr_t>(block); |
@@ -137,25 +137,25 @@ void GrMemoryPool::validate() { |
size_t userSize = totalSize - kHeaderSize; |
intptr_t userStart = b + kHeaderSize; |
- GrAssert(!(b % kAlignment)); |
- GrAssert(!(totalSize % kAlignment)); |
- GrAssert(!(userSize % kAlignment)); |
- GrAssert(!(block->fCurrPtr % kAlignment)); |
+ SkASSERT(!(b % kAlignment)); |
+ SkASSERT(!(totalSize % kAlignment)); |
+ SkASSERT(!(userSize % kAlignment)); |
+ SkASSERT(!(block->fCurrPtr % kAlignment)); |
if (fHead != block) { |
- GrAssert(block->fLiveCount); |
- GrAssert(userSize >= fMinAllocSize); |
+ SkASSERT(block->fLiveCount); |
+ SkASSERT(userSize >= fMinAllocSize); |
} else { |
- GrAssert(userSize == fPreallocSize); |
+ SkASSERT(userSize == fPreallocSize); |
} |
if (!block->fLiveCount) { |
- GrAssert(ptrOffset == kHeaderSize); |
- GrAssert(userStart == block->fCurrPtr); |
+ SkASSERT(ptrOffset == kHeaderSize); |
+ SkASSERT(userStart == block->fCurrPtr); |
} else { |
- GrAssert(block == *reinterpret_cast<BlockHeader**>(userStart)); |
+ SkASSERT(block == *reinterpret_cast<BlockHeader**>(userStart)); |
} |
prev = block; |
} while ((block = block->fNext)); |
- GrAssert(allocCount == fAllocationCnt); |
- GrAssert(prev == fTail); |
+ SkASSERT(allocCount == fAllocationCnt); |
+ SkASSERT(prev == fTail); |
#endif |
} |