Move vertex layout from GeometrySrcState to GrDrawState.
Also adds AutoStateRestore member to AutoGeometryPush to push DrawState as well
as GeometrySrcState. And removed vertex layout as an argument to a number of
functions -- they will get vertex layout info from the current DrawState.
Review URL: https://codereview.appspot.com/7286047
git-svn-id: http://skia.googlecode.com/svn/trunk@7600 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 47d4069..d695e16 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -471,7 +471,7 @@
void GrGpu::releaseReservedVertexSpace() {
const GeometrySrcState& geoSrc = this->getGeomSrc();
GrAssert(kReserved_GeometrySrcType == geoSrc.fVertexSrc);
- size_t bytes = geoSrc.fVertexCount * GrDrawState::VertexSize(geoSrc.fVertexLayout);
+ size_t bytes = geoSrc.fVertexCount * geoSrc.fVertexSize;
fVertexPool->putBack(bytes);
--fVertexPoolUseCnt;
}
@@ -490,7 +490,7 @@
#if GR_DEBUG
bool success =
#endif
- fVertexPool->appendVertices(GrDrawState::VertexSize(this->getVertexLayout()),
+ fVertexPool->appendVertices(this->getVertexSize(),
vertexCount,
vertexArray,
&geomPoolState.fPoolVertexBuffer,
@@ -517,7 +517,7 @@
// if vertex source was array, we stowed data in the pool
const GeometrySrcState& geoSrc = this->getGeomSrc();
GrAssert(kArray_GeometrySrcType == geoSrc.fVertexSrc);
- size_t bytes = geoSrc.fVertexCount * GrDrawState::VertexSize(geoSrc.fVertexLayout);
+ size_t bytes = geoSrc.fVertexCount * geoSrc.fVertexSize;
fVertexPool->putBack(bytes);
--fVertexPoolUseCnt;
}