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