Don't look at current vertex layout when vertex source hasn't been set
Review URL: http://codereview.appspot.com/5959047
git-svn-id: http://skia.googlecode.com/svn/trunk@3545 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp
index 37cac0f..2bdfb0d 100644
--- a/src/gpu/GrInOrderDrawBuffer.cpp
+++ b/src/gpu/GrInOrderDrawBuffer.cpp
@@ -356,7 +356,7 @@
this->pushState();
}
- draw.fVertexLayout = this->getGeomSrc().fVertexLayout;
+ draw.fVertexLayout = this->getVertexLayout();
switch (this->getGeomSrc().fVertexSrc) {
case kBuffer_GeometrySrcType:
draw.fVertexBuffer = this->getGeomSrc().fVertexBuffer;
@@ -364,7 +364,7 @@
case kReserved_GeometrySrcType: // fallthrough
case kArray_GeometrySrcType: {
size_t vertexBytes = (vertexCount + startVertex) *
- VertexSize(this->getGeomSrc().fVertexLayout);
+ VertexSize(draw.fVertexLayout);
poolState.fUsedPoolVertexBytes =
GrMax(poolState.fUsedPoolVertexBytes, vertexBytes);
draw.fVertexBuffer = poolState.fPoolVertexBuffer;
@@ -423,7 +423,7 @@
this->pushState();
}
- draw.fVertexLayout = this->getGeomSrc().fVertexLayout;
+ draw.fVertexLayout = this->getVertexLayout();
switch (this->getGeomSrc().fVertexSrc) {
case kBuffer_GeometrySrcType:
draw.fVertexBuffer = this->getGeomSrc().fVertexBuffer;
@@ -431,7 +431,7 @@
case kReserved_GeometrySrcType: // fallthrough
case kArray_GeometrySrcType: {
size_t vertexBytes = (vertexCount + startVertex) *
- VertexSize(this->getGeomSrc().fVertexLayout);
+ VertexSize(draw.fVertexLayout);
poolState.fUsedPoolVertexBytes =
GrMax(poolState.fUsedPoolVertexBytes, vertexBytes);
draw.fVertexBuffer = poolState.fPoolVertexBuffer;
@@ -706,7 +706,7 @@
#if GR_DEBUG
bool success =
#endif
- fVertexPool.appendVertices(this->getGeomSrc().fVertexLayout,
+ fVertexPool.appendVertices(this->getVertexLayout(),
vertexCount,
vertexArray,
&poolState.fPoolVertexBuffer,