Index: gm/beziereffects.cpp |
diff --git a/gm/beziereffects.cpp b/gm/beziereffects.cpp |
index 656842289867710a072b6ae1456d409d0cbd9a93..182d71aaf6749c52a7bd8b50cc8bdeb4137bdb36 100644 |
--- a/gm/beziereffects.cpp |
+++ b/gm/beziereffects.cpp |
@@ -16,7 +16,6 @@ |
#include "GrBufferAllocPool.h" |
#include "GrContext.h" |
#include "GrPathUtils.h" |
-#include "GrResourceProvider.h" |
#include "GrTest.h" |
#include "GrTestBatch.h" |
#include "SkColorPriv.h" |
@@ -67,18 +66,17 @@ |
} |
void onGenerateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline) override { |
- SkAutoTUnref<const GrIndexBuffer> indexBuffer( |
- batchTarget->resourceProvider()->refQuadIndexBuffer()); |
- |
size_t vertexStride = this->geometryProcessor()->getVertexStride(); |
+ |
const GrVertexBuffer* vertexBuffer; |
int firstVertex; |
+ |
void* vertices = batchTarget->vertexPool()->makeSpace(vertexStride, |
kVertsPerCubic, |
&vertexBuffer, |
&firstVertex); |
- if (!vertices || !indexBuffer) { |
+ if (!vertices || !batchTarget->quadIndexBuffer()) { |
SkDebugf("Could not allocate buffers\n"); |
return; |
} |
@@ -102,7 +100,7 @@ |
drawInfo.setVertexCount(kVertsPerCubic); |
drawInfo.setStartIndex(0); |
drawInfo.setIndexCount(kIndicesPerCubic); |
- drawInfo.setIndexBuffer(indexBuffer); |
+ drawInfo.setIndexBuffer(batchTarget->quadIndexBuffer()); |
batchTarget->draw(drawInfo); |
} |
@@ -475,10 +473,8 @@ |
} |
void onGenerateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline) override { |
- SkAutoTUnref<const GrIndexBuffer> indexBuffer( |
- batchTarget->resourceProvider()->refQuadIndexBuffer()); |
- |
size_t vertexStride = this->geometryProcessor()->getVertexStride(); |
+ |
const GrVertexBuffer* vertexBuffer; |
int firstVertex; |
@@ -487,7 +483,7 @@ |
&vertexBuffer, |
&firstVertex); |
- if (!vertices || !indexBuffer) { |
+ if (!vertices || !batchTarget->quadIndexBuffer()) { |
SkDebugf("Could not allocate buffers\n"); |
return; |
} |
@@ -509,7 +505,7 @@ |
drawInfo.setVertexCount(kVertsPerCubic); |
drawInfo.setStartIndex(0); |
drawInfo.setIndexCount(kIndicesPerCubic); |
- drawInfo.setIndexBuffer(indexBuffer); |
+ drawInfo.setIndexBuffer(batchTarget->quadIndexBuffer()); |
batchTarget->draw(drawInfo); |
} |