Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/)
This CL is part II of IV (I broke down the 1280 files into 4 CLs).
Review URL: https://codereview.appspot.com/6474054
git-svn-id: http://skia.googlecode.com/svn/trunk@5263 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrAllocator.h b/src/gpu/GrAllocator.h
index ae456cd..dc4c3de 100755
--- a/src/gpu/GrAllocator.h
+++ b/src/gpu/GrAllocator.h
@@ -55,8 +55,8 @@
} else if (fOwnFirstBlock) {
fBlocks[0] = GrMalloc(fBlockSize);
}
- }
- void* ret = (char*)fBlocks[fCount/fItemsPerBlock] +
+ }
+ void* ret = (char*)fBlocks[fCount/fItemsPerBlock] +
fItemSize * indexInBlock;
++fCount;
return ret;
@@ -65,8 +65,8 @@
/**
* removes all added items
*/
- void reset() {
- int blockCount = GrMax((unsigned)1,
+ void reset() {
+ int blockCount = GrMax((unsigned)1,
GrUIDivRoundUp(fCount, fItemsPerBlock));
for (int i = 1; i < blockCount; ++i) {
GrFree(fBlocks[i]);
@@ -85,12 +85,12 @@
int count() const {
return fCount;
}
-
+
/**
* is the count 0
*/
bool empty() const { return fCount == 0; }
-
+
/**
* access last item, only call if count() != 0
*/
@@ -98,7 +98,7 @@
GrAssert(fCount);
return (*this)[fCount-1];
}
-
+
/**
* access last item, only call if count() != 0
*/
@@ -106,28 +106,28 @@
GrAssert(fCount);
return (*this)[fCount-1];
}
-
+
/**
* access item by index.
- */
+ */
void* operator[] (int i) {
GrAssert(i >= 0 && i < fCount);
- return (char*)fBlocks[i / fItemsPerBlock] +
+ return (char*)fBlocks[i / fItemsPerBlock] +
fItemSize * (i % fItemsPerBlock);
}
/**
* access item by index.
- */
+ */
const void* operator[] (int i) const {
GrAssert(i >= 0 && i < fCount);
- return (const char*)fBlocks[i / fItemsPerBlock] +
+ return (const char*)fBlocks[i / fItemsPerBlock] +
fItemSize * (i % fItemsPerBlock);
}
private:
static const int NUM_INIT_BLOCK_PTRS = 8;
-
+
SkSTArray<NUM_INIT_BLOCK_PTRS, void*> fBlocks;
size_t fBlockSize;
size_t fItemSize;
@@ -184,19 +184,19 @@
}
fAllocator.reset();
}
-
+
/**
* count of items
*/
int count() const {
return fAllocator.count();
}
-
+
/**
* is the count 0
*/
bool empty() const { return fAllocator.empty(); }
-
+
/**
* access last item, only call if count() != 0
*/
@@ -213,11 +213,11 @@
/**
* access item by index.
- */
+ */
T& operator[] (int i) {
return *(T*)(fAllocator[i]);
}
-
+
/**
* access item by index.
*/