Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: src/gpu/GrMemoryPool.cpp

Issue 27192003: Start cleaning up 64bit Win warnings (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: revertedGrBytesPerPixel to returning a size_t Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrIndexBuffer.h ('k') | src/gpu/GrRenderTarget.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 "GrMemoryPool.h" 8 #include "GrMemoryPool.h"
9 9
10 #ifdef SK_DEBUG 10 #ifdef SK_DEBUG
(...skipping 23 matching lines...) Expand all
34 SkASSERT(fHead == fTail); 34 SkASSERT(fHead == fTail);
35 SkASSERT(0 == fHead->fLiveCount); 35 SkASSERT(0 == fHead->fLiveCount);
36 DeleteBlock(fHead); 36 DeleteBlock(fHead);
37 }; 37 };
38 38
39 void* GrMemoryPool::allocate(size_t size) { 39 void* GrMemoryPool::allocate(size_t size) {
40 VALIDATE; 40 VALIDATE;
41 size = GrSizeAlignUp(size, kAlignment); 41 size = GrSizeAlignUp(size, kAlignment);
42 size += kPerAllocPad; 42 size += kPerAllocPad;
43 if (fTail->fFreeSize < size) { 43 if (fTail->fFreeSize < size) {
44 int blockSize = size; 44 size_t blockSize = size;
45 blockSize = GrMax<size_t>(blockSize, fMinAllocSize); 45 blockSize = GrMax<size_t>(blockSize, fMinAllocSize);
46 BlockHeader* block = CreateBlock(blockSize); 46 BlockHeader* block = CreateBlock(blockSize);
47 47
48 block->fPrev = fTail; 48 block->fPrev = fTail;
49 block->fNext = NULL; 49 block->fNext = NULL;
50 SkASSERT(NULL == fTail->fNext); 50 SkASSERT(NULL == fTail->fNext);
51 fTail->fNext = block; 51 fTail->fNext = block;
52 fTail = block; 52 fTail = block;
53 } 53 }
54 SkASSERT(fTail->fFreeSize >= size); 54 SkASSERT(fTail->fFreeSize >= size);
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 SkASSERT(userStart == block->fCurrPtr); 152 SkASSERT(userStart == block->fCurrPtr);
153 } else { 153 } else {
154 SkASSERT(block == *reinterpret_cast<BlockHeader**>(userStart)); 154 SkASSERT(block == *reinterpret_cast<BlockHeader**>(userStart));
155 } 155 }
156 prev = block; 156 prev = block;
157 } while ((block = block->fNext)); 157 } while ((block = block->fNext));
158 SkASSERT(allocCount == fAllocationCnt); 158 SkASSERT(allocCount == fAllocationCnt);
159 SkASSERT(prev == fTail); 159 SkASSERT(prev == fTail);
160 #endif 160 #endif
161 } 161 }
OLDNEW
« no previous file with comments | « src/gpu/GrIndexBuffer.h ('k') | src/gpu/GrRenderTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698