aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-31 20:28:24 +0000
committerGravatar skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-31 20:28:24 +0000
commit747f1ecce610e1093b97dee7c22e4591c149514a (patch)
tree2772332f9f7aa50cdd49cabc9bc2bb83ef1ad2a1
parent84cd77c4eb3145335a76966e582d0d9c71ecc264 (diff)
Sanitizing source files in Skia_Periodic_House_Keeping
git-svn-id: http://skia.googlecode.com/svn/trunk@7499 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--bench/RegionContainBench.cpp1
-rw-r--r--src/gpu/GrBufferAllocPool.cpp26
-rw-r--r--src/gpu/GrBufferAllocPool.h14
-rw-r--r--src/gpu/GrDrawTarget.cpp6
-rw-r--r--src/gpu/GrDrawTarget.h8
-rw-r--r--src/gpu/GrGpu.cpp6
-rw-r--r--src/gpu/GrGpu.h2
-rw-r--r--src/gpu/GrInOrderDrawBuffer.cpp16
-rw-r--r--src/gpu/GrInOrderDrawBuffer.h6
-rw-r--r--src/gpu/GrTextContext.cpp4
-rw-r--r--src/utils/SkMD5.h1
-rw-r--r--src/utils/SkSHA1.h1
-rw-r--r--tests/MD5Test.cpp2
-rw-r--r--tests/SHA1Test.cpp2
-rw-r--r--tools/filtermain.cpp2
15 files changed, 48 insertions, 49 deletions
diff --git a/bench/RegionContainBench.cpp b/bench/RegionContainBench.cpp
index 8597f3120c..1aae264c75 100644
--- a/bench/RegionContainBench.cpp
+++ b/bench/RegionContainBench.cpp
@@ -66,4 +66,3 @@ private:
static SkBenchmark* gF0(void* p) { return SkNEW_ARGS(RegionContainBench, (p, sect_proc, "sect")); }
static BenchRegistry gR0(gF0);
-
diff --git a/src/gpu/GrBufferAllocPool.cpp b/src/gpu/GrBufferAllocPool.cpp
index ec8a9c9545..831c430891 100644
--- a/src/gpu/GrBufferAllocPool.cpp
+++ b/src/gpu/GrBufferAllocPool.cpp
@@ -373,7 +373,7 @@ GrVertexBufferAllocPool::GrVertexBufferAllocPool(GrGpu* gpu,
preallocBufferCnt) {
}
-void* GrVertexBufferAllocPool::makeSpace(size_t vertexSize,
+void* GrVertexBufferAllocPool::makeSpace(GrVertexLayout layout,
int vertexCount,
const GrVertexBuffer** buffer,
int* startVertex) {
@@ -382,41 +382,43 @@ void* GrVertexBufferAllocPool::makeSpace(size_t vertexSize,
GrAssert(NULL != buffer);
GrAssert(NULL != startVertex);
+ size_t vSize = GrDrawState::VertexSize(layout);
size_t offset = 0; // assign to suppress warning
const GrGeometryBuffer* geomBuffer = NULL; // assign to suppress warning
- void* ptr = INHERITED::makeSpace(vertexSize * vertexCount,
- vertexSize,
+ void* ptr = INHERITED::makeSpace(vSize * vertexCount,
+ vSize,
&geomBuffer,
&offset);
*buffer = (const GrVertexBuffer*) geomBuffer;
- GrAssert(0 == offset % vertexSize);
- *startVertex = offset / vertexSize;
+ GrAssert(0 == offset % vSize);
+ *startVertex = offset / vSize;
return ptr;
}
-bool GrVertexBufferAllocPool::appendVertices(size_t vertexSize,
+bool GrVertexBufferAllocPool::appendVertices(GrVertexLayout layout,
int vertexCount,
const void* vertices,
const GrVertexBuffer** buffer,
int* startVertex) {
- void* space = makeSpace(vertexSize, vertexCount, buffer, startVertex);
+ void* space = makeSpace(layout, vertexCount, buffer, startVertex);
if (NULL != space) {
memcpy(space,
vertices,
- vertexSize * vertexCount);
+ GrDrawState::VertexSize(layout) * vertexCount);
return true;
} else {
return false;
}
}
-int GrVertexBufferAllocPool::preallocatedBufferVertices(size_t vertexSize) const {
- return INHERITED::preallocatedBufferSize() / vertexSize;
+int GrVertexBufferAllocPool::preallocatedBufferVertices(GrVertexLayout layout) const {
+ return INHERITED::preallocatedBufferSize() /
+ GrDrawState::VertexSize(layout);
}
-int GrVertexBufferAllocPool::currentBufferVertices(size_t vertexSize) const {
- return currentBufferItems(vertexSize);
+int GrVertexBufferAllocPool::currentBufferVertices(GrVertexLayout layout) const {
+ return currentBufferItems(GrDrawState::VertexSize(layout));
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/GrBufferAllocPool.h b/src/gpu/GrBufferAllocPool.h
index ffd8c34092..654ba744f9 100644
--- a/src/gpu/GrBufferAllocPool.h
+++ b/src/gpu/GrBufferAllocPool.h
@@ -222,7 +222,7 @@ public:
* the buffer at the offset indicated by startVertex. Until that time they
* may be in temporary storage and/or the buffer may be locked.
*
- * @param vertexSize specifies size of a vertex to allocate space for
+ * @param layout specifies type of vertices to allocate space for
* @param vertexCount number of vertices to allocate space for
* @param buffer returns the vertex buffer that will hold the
* vertices.
@@ -230,7 +230,7 @@ public:
* In units of the size of a vertex from layout param.
* @return pointer to first vertex.
*/
- void* makeSpace(size_t vertexSize,
+ void* makeSpace(GrVertexLayout layout,
int vertexCount,
const GrVertexBuffer** buffer,
int* startVertex);
@@ -238,7 +238,7 @@ public:
/**
* Shortcut to make space and then write verts into the made space.
*/
- bool appendVertices(size_t vertexSize,
+ bool appendVertices(GrVertexLayout layout,
int vertexCount,
const void* vertices,
const GrVertexBuffer** buffer,
@@ -251,21 +251,21 @@ public:
* would fit in the next available preallocated buffer. If any makeSpace
* would force a new VB to be created the return value will be zero.
*
- * @param the size of a vertex to compute space for.
+ * @param the format of vertices to compute space for.
* @return the number of vertices that would fit in the current buffer.
*/
- int currentBufferVertices(size_t vertexSize) const;
+ int currentBufferVertices(GrVertexLayout layout) const;
/**
* Gets the number of vertices that can fit in a preallocated vertex buffer.
* Zero if no preallocated buffers.
*
- * @param the size of a vertex to compute space for.
+ * @param the format of vertices to compute space for.
*
* @return number of vertices that fit in one of the preallocated vertex
* buffers.
*/
- int preallocatedBufferVertices(size_t vertexSize) const;
+ int preallocatedBufferVertices(GrVertexLayout layout) const;
private:
typedef GrBufferAllocPool INHERITED;
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 04ffaa4451..d2d1d8d347 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -86,7 +86,7 @@ bool GrDrawTarget::reserveVertexSpace(GrVertexLayout vertexLayout,
this->releasePreviousVertexSource();
geoSrc.fVertexSrc = kNone_GeometrySrcType;
- acquired = this->onReserveVertexSpace(GrDrawState::VertexSize(vertexLayout),
+ acquired = this->onReserveVertexSpace(vertexLayout,
vertexCount,
vertices);
}
@@ -126,7 +126,7 @@ bool GrDrawTarget::reserveVertexAndIndexSpace(GrVertexLayout vertexLayout,
int indexCount,
void** vertices,
void** indices) {
- this->willReserveVertexAndIndexSpace(GrDrawState::VertexSize(vertexLayout), vertexCount, indexCount);
+ this->willReserveVertexAndIndexSpace(vertexLayout, vertexCount, indexCount);
if (vertexCount) {
if (!this->reserveVertexSpace(vertexLayout, vertexCount, vertices)) {
if (indexCount) {
@@ -146,7 +146,7 @@ bool GrDrawTarget::reserveVertexAndIndexSpace(GrVertexLayout vertexLayout,
return true;
}
-bool GrDrawTarget::geometryHints(size_t vertexSize,
+bool GrDrawTarget::geometryHints(GrVertexLayout vertexLayout,
int32_t* vertexCount,
int32_t* indexCount) const {
if (NULL != vertexCount) {
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index 1c8ada11f3..2d1ca6cbaf 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -254,7 +254,7 @@ public:
* Also may hint whether the draw target should be flushed first. This is
* useful for deferred targets.
*
- * @param vertexSize size of vertices caller would like to reserve
+ * @param vertexLayout layout of vertices caller would like to reserve
* @param vertexCount in: hint about how many vertices the caller would
* like to allocate.
* out: a hint about the number of vertices that can be
@@ -268,7 +268,7 @@ public:
*
* @return true if target should be flushed based on the input values.
*/
- virtual bool geometryHints(size_t vertexSize,
+ virtual bool geometryHints(GrVertexLayout vertexLayout,
int* vertexCount,
int* indexCount) const;
@@ -761,10 +761,10 @@ protected:
private:
// A subclass can optionally overload this function to be notified before
// vertex and index space is reserved.
- virtual void willReserveVertexAndIndexSpace(size_t vertexSize, int vertexCount, int indexCount) {}
+ virtual void willReserveVertexAndIndexSpace(GrVertexLayout,int vertexCount, int indexCount) {}
// implemented by subclass to allocate space for reserved geom
- virtual bool onReserveVertexSpace(size_t vertexSize, int vertexCount, void** vertices) = 0;
+ virtual bool onReserveVertexSpace(GrVertexLayout, int vertexCount, void** vertices) = 0;
virtual bool onReserveIndexSpace(int indexCount, void** indices) = 0;
// implemented by subclass to handle release of reserved geom space
virtual void releaseReservedVertexSpace() = 0;
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 4cce03f16e..b0ce7fe82e 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -429,7 +429,7 @@ void GrGpu::prepareIndexPool() {
}
}
-bool GrGpu::onReserveVertexSpace(size_t vertexSize,
+bool GrGpu::onReserveVertexSpace(GrVertexLayout vertexLayout,
int vertexCount,
void** vertices) {
GeometryPoolState& geomPoolState = fGeomPoolStateStack.back();
@@ -439,7 +439,7 @@ bool GrGpu::onReserveVertexSpace(size_t vertexSize,
this->prepareVertexPool();
- *vertices = fVertexPool->makeSpace(vertexSize,
+ *vertices = fVertexPool->makeSpace(vertexLayout,
vertexCount,
&geomPoolState.fPoolVertexBuffer,
&geomPoolState.fPoolStartVertex);
@@ -490,7 +490,7 @@ void GrGpu::onSetVertexSourceToArray(const void* vertexArray, int vertexCount) {
#if GR_DEBUG
bool success =
#endif
- fVertexPool->appendVertices(GrDrawState::VertexSize(this->getVertexLayout()),
+ fVertexPool->appendVertices(this->getVertexLayout(),
vertexCount,
vertexArray,
&geomPoolState.fPoolVertexBuffer,
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index bcda2574f5..ebfc60fdd8 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -423,7 +423,7 @@ protected:
private:
// GrDrawTarget overrides
- virtual bool onReserveVertexSpace(size_t vSize, int vertexCount, void** vertices) SK_OVERRIDE;
+ virtual bool onReserveVertexSpace(GrVertexLayout, int vertexCount, void** vertices) SK_OVERRIDE;
virtual bool onReserveIndexSpace(int indexCount, void** indices) SK_OVERRIDE;
virtual void releaseReservedVertexSpace() SK_OVERRIDE;
virtual void releaseReservedIndexSpace() SK_OVERRIDE;
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp
index a0e3e99fe7..197cf0bac2 100644
--- a/src/gpu/GrInOrderDrawBuffer.cpp
+++ b/src/gpu/GrInOrderDrawBuffer.cpp
@@ -592,7 +592,7 @@ void GrInOrderDrawBuffer::setAutoFlushTarget(GrDrawTarget* target) {
}
void GrInOrderDrawBuffer::willReserveVertexAndIndexSpace(
- size_t vertexSize,
+ GrVertexLayout vertexLayout,
int vertexCount,
int indexCount) {
if (NULL != fAutoFlushTarget) {
@@ -624,14 +624,14 @@ void GrInOrderDrawBuffer::willReserveVertexAndIndexSpace(
!unreleasedVertexSpace &&
!unreleasedIndexSpace &&
!targetHasReservedGeom &&
- this->geometryHints(vertexSize, &vcount, &icount)) {
+ this->geometryHints(vertexLayout, &vcount, &icount)) {
this->flushTo(fAutoFlushTarget);
}
}
}
-bool GrInOrderDrawBuffer::geometryHints(size_t vertexSize,
+bool GrInOrderDrawBuffer::geometryHints(GrVertexLayout vertexLayout,
int* vertexCount,
int* indexCount) const {
// we will recommend a flush if the data could fit in a single
@@ -649,10 +649,10 @@ bool GrInOrderDrawBuffer::geometryHints(size_t vertexSize,
*indexCount = currIndices;
}
if (NULL != vertexCount) {
- int32_t currVertices = fVertexPool.currentBufferVertices(vertexSize);
+ int32_t currVertices = fVertexPool.currentBufferVertices(vertexLayout);
if (*vertexCount > currVertices &&
(!fVertexPool.preallocatedBuffersRemaining() &&
- *vertexCount <= fVertexPool.preallocatedBufferVertices(vertexSize))) {
+ *vertexCount <= fVertexPool.preallocatedBufferVertices(vertexLayout))) {
flush = true;
}
@@ -661,7 +661,7 @@ bool GrInOrderDrawBuffer::geometryHints(size_t vertexSize,
return flush;
}
-bool GrInOrderDrawBuffer::onReserveVertexSpace(size_t vertexSize,
+bool GrInOrderDrawBuffer::onReserveVertexSpace(GrVertexLayout vertexLayout,
int vertexCount,
void** vertices) {
GeometryPoolState& poolState = fGeoPoolStateStack.back();
@@ -669,7 +669,7 @@ bool GrInOrderDrawBuffer::onReserveVertexSpace(size_t vertexSize,
GrAssert(NULL != vertices);
GrAssert(0 == poolState.fUsedPoolVertexBytes);
- *vertices = fVertexPool.makeSpace(vertexSize,
+ *vertices = fVertexPool.makeSpace(vertexLayout,
vertexCount,
&poolState.fPoolVertexBuffer,
&poolState.fPoolStartVertex);
@@ -736,7 +736,7 @@ void GrInOrderDrawBuffer::onSetVertexSourceToArray(const void* vertexArray,
#if GR_DEBUG
bool success =
#endif
- fVertexPool.appendVertices(GrDrawState::VertexSize(this->getVertexLayout()),
+ fVertexPool.appendVertices(this->getVertexLayout(),
vertexCount,
vertexArray,
&poolState.fPoolVertexBuffer,
diff --git a/src/gpu/GrInOrderDrawBuffer.h b/src/gpu/GrInOrderDrawBuffer.h
index 21011c9650..353d5bff52 100644
--- a/src/gpu/GrInOrderDrawBuffer.h
+++ b/src/gpu/GrInOrderDrawBuffer.h
@@ -100,7 +100,7 @@ public:
int indicesPerInstance)
SK_OVERRIDE;
- virtual bool geometryHints(size_t vertexSize,
+ virtual bool geometryHints(GrVertexLayout vertexLayout,
int* vertexCount,
int* indexCount) const SK_OVERRIDE;
@@ -152,7 +152,7 @@ private:
// overrides from GrDrawTarget
virtual void onDraw(const DrawInfo&) SK_OVERRIDE;
virtual void onStencilPath(const GrPath*, const SkStrokeRec& stroke, SkPath::FillType) SK_OVERRIDE;
- virtual bool onReserveVertexSpace(size_t vertexSize,
+ virtual bool onReserveVertexSpace(GrVertexLayout layout,
int vertexCount,
void** vertices) SK_OVERRIDE;
virtual bool onReserveIndexSpace(int indexCount,
@@ -167,7 +167,7 @@ private:
virtual void releaseIndexArray() SK_OVERRIDE;
virtual void geometrySourceWillPush() SK_OVERRIDE;
virtual void geometrySourceWillPop(const GeometrySrcState& restoredState) SK_OVERRIDE;
- virtual void willReserveVertexAndIndexSpace(size_t vertexSize,
+ virtual void willReserveVertexAndIndexSpace(GrVertexLayout vertexLayout,
int vertexCount,
int indexCount) SK_OVERRIDE;
diff --git a/src/gpu/GrTextContext.cpp b/src/gpu/GrTextContext.cpp
index 97e92fa1ef..206f4ca3fb 100644
--- a/src/gpu/GrTextContext.cpp
+++ b/src/gpu/GrTextContext.cpp
@@ -204,7 +204,7 @@ HAS_ATLAS:
// a number of verts to reserve and whether to perform a flush.
fMaxVertices = kMinRequestedVerts;
bool flush = (NULL != fDrawTarget) &&
- fDrawTarget->geometryHints(GrDrawState::VertexSize(fVertexLayout),
+ fDrawTarget->geometryHints(fVertexLayout,
&fMaxVertices,
NULL);
if (flush) {
@@ -214,7 +214,7 @@ HAS_ATLAS:
fDrawTarget = fContext->getTextTarget(fPaint);
fMaxVertices = kDefaultRequestedVerts;
// ignore return, no point in flushing again.
- fDrawTarget->geometryHints(GrDrawState::VertexSize(fVertexLayout),
+ fDrawTarget->geometryHints(fVertexLayout,
&fMaxVertices,
NULL);
diff --git a/src/utils/SkMD5.h b/src/utils/SkMD5.h
index 23119e897c..6fbdb46b44 100644
--- a/src/utils/SkMD5.h
+++ b/src/utils/SkMD5.h
@@ -51,4 +51,3 @@ private:
};
#endif
-
diff --git a/src/utils/SkSHA1.h b/src/utils/SkSHA1.h
index e0653c62e6..10bbc43c50 100644
--- a/src/utils/SkSHA1.h
+++ b/src/utils/SkSHA1.h
@@ -51,4 +51,3 @@ private:
};
#endif
-
diff --git a/tests/MD5Test.cpp b/tests/MD5Test.cpp
index a7b132b272..9b9e756aa8 100644
--- a/tests/MD5Test.cpp
+++ b/tests/MD5Test.cpp
@@ -65,4 +65,4 @@ static void TestMD5(skiatest::Reporter* reporter) {
}
#include "TestClassDef.h"
-DEFINE_TESTCLASS("MD5", MD5TestClass, TestMD5) \ No newline at end of file
+DEFINE_TESTCLASS("MD5", MD5TestClass, TestMD5)
diff --git a/tests/SHA1Test.cpp b/tests/SHA1Test.cpp
index 9f078499bf..dde828cb51 100644
--- a/tests/SHA1Test.cpp
+++ b/tests/SHA1Test.cpp
@@ -52,4 +52,4 @@ static void TestSHA1(skiatest::Reporter* reporter) {
}
#include "TestClassDef.h"
-DEFINE_TESTCLASS("SHA1", SHA1TestClass, TestSHA1) \ No newline at end of file
+DEFINE_TESTCLASS("SHA1", SHA1TestClass, TestSHA1)
diff --git a/tools/filtermain.cpp b/tools/filtermain.cpp
index ecaf3b2e3c..3715b3e229 100644
--- a/tools/filtermain.cpp
+++ b/tools/filtermain.cpp
@@ -86,7 +86,7 @@ static int filter_picture(const SkString& inFile, const SkString& outFile) {
(SkColorGetG(p0->getColor()) == SkColorGetG(p1->getColor())) &&
(SkColorGetB(p0->getColor()) == SkColorGetB(p1->getColor()))) {
commands[i]->setVisible(false);
- SkColor newColor = SkColorSetA(p1->getColor(),
+ SkColor newColor = SkColorSetA(p1->getColor(),
SkColorGetA(p0->getColor()));
p1->setColor(newColor);
commands[i+2]->setVisible(false);