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

Side by Side Diff: src/gpu/GrAllocator.h

Issue 216503004: SK_SUPPORT_LEGACY_GRTYPES to hide duplicate types from SkTypes.h (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright 2010 Google Inc. 2 * Copyright 2010 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 #ifndef GrAllocator_DEFINED 8 #ifndef GrAllocator_DEFINED
9 #define GrAllocator_DEFINED 9 #define GrAllocator_DEFINED
10 10
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 void* ret = (char*)fBlocks[fCount/fItemsPerBlock] + 73 void* ret = (char*)fBlocks[fCount/fItemsPerBlock] +
74 fItemSize * indexInBlock; 74 fItemSize * indexInBlock;
75 ++fCount; 75 ++fCount;
76 return ret; 76 return ret;
77 } 77 }
78 78
79 /** 79 /**
80 * removes all added items 80 * removes all added items
81 */ 81 */
82 void reset() { 82 void reset() {
83 int blockCount = GrMax((unsigned)1, 83 int blockCount = SkTMax((unsigned)1,
84 GrUIDivRoundUp(fCount, fItemsPerBlock)); 84 GrUIDivRoundUp(fCount, fItemsPerBlock));
85 for (int i = 1; i < blockCount; ++i) { 85 for (int i = 1; i < blockCount; ++i) {
86 sk_free(fBlocks[i]); 86 sk_free(fBlocks[i]);
87 } 87 }
88 if (fOwnFirstBlock) { 88 if (fOwnFirstBlock) {
89 sk_free(fBlocks[0]); 89 sk_free(fBlocks[0]);
90 fBlocks[0] = NULL; 90 fBlocks[0] = NULL;
91 } 91 }
92 fBlocks.pop_back_n(blockCount-1); 92 fBlocks.pop_back_n(blockCount-1);
93 fCount = 0; 93 fCount = 0;
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 public: 259 public:
260 GrSTAllocator() : INHERITED(N) { 260 GrSTAllocator() : INHERITED(N) {
261 this->setInitialBlock(fStorage.get()); 261 this->setInitialBlock(fStorage.get());
262 } 262 }
263 263
264 private: 264 private:
265 SkAlignedSTStorage<N, T> fStorage; 265 SkAlignedSTStorage<N, T> fStorage;
266 }; 266 };
267 267
268 #endif 268 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698