Index: src/gpu/GrInOrderDrawBuffer.cpp |
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp |
index 8190ec0e8a880bc4a6aa696f0c4a5b2f5545080c..e298be6c8bffb575798ae14250512495626e0fe5 100644 |
--- a/src/gpu/GrInOrderDrawBuffer.cpp |
+++ b/src/gpu/GrInOrderDrawBuffer.cpp |
@@ -8,7 +8,6 @@ |
#include "GrInOrderDrawBuffer.h" |
#include "GrDefaultGeoProcFactory.h" |
-#include "GrResourceProvider.h" |
#include "GrTemplates.h" |
GrInOrderDrawBuffer::GrInOrderDrawBuffer(GrContext* context, |
@@ -138,18 +137,17 @@ |
vertexStride == sizeof(GrDefaultGeoProcFactory::PositionColorAttr)); |
int instanceCount = fGeoData.count(); |
- SkAutoTUnref<const GrIndexBuffer> indexBuffer( |
- batchTarget->resourceProvider()->refQuadIndexBuffer()); |
- |
int vertexCount = kVertsPerRect * instanceCount; |
+ |
const GrVertexBuffer* vertexBuffer; |
int firstVertex; |
+ |
void* vertices = batchTarget->vertexPool()->makeSpace(vertexStride, |
vertexCount, |
&vertexBuffer, |
&firstVertex); |
- if (!vertices || !indexBuffer) { |
+ if (!vertices || !batchTarget->quadIndexBuffer()) { |
SkDebugf("Could not allocate buffers\n"); |
return; |
} |
@@ -183,6 +181,8 @@ |
} |
} |
+ const GrIndexBuffer* quadIndexBuffer = batchTarget->quadIndexBuffer(); |
+ |
GrDrawTarget::DrawInfo drawInfo; |
drawInfo.setPrimitiveType(kTriangles_GrPrimitiveType); |
drawInfo.setStartVertex(0); |
@@ -191,9 +191,9 @@ |
drawInfo.setIndicesPerInstance(kIndicesPerRect); |
drawInfo.adjustStartVertex(firstVertex); |
drawInfo.setVertexBuffer(vertexBuffer); |
- drawInfo.setIndexBuffer(indexBuffer); |
- |
- int maxInstancesPerDraw = indexBuffer->maxQuads(); |
+ drawInfo.setIndexBuffer(quadIndexBuffer); |
+ |
+ int maxInstancesPerDraw = quadIndexBuffer->maxQuads(); |
while (instanceCount) { |
drawInfo.setInstanceCount(SkTMin(instanceCount, maxInstancesPerDraw)); |
drawInfo.setVertexCount(drawInfo.instanceCount() * drawInfo.verticesPerInstance()); |