Index: gm/convexpolyeffect.cpp |
diff --git a/gm/convexpolyeffect.cpp b/gm/convexpolyeffect.cpp |
index 07d5fc2112f15a6bcf0f6d945f00ee0e865d3a9e..60b73c571d97a067d5b566d2ed0b88570dd65212 100644 |
--- a/gm/convexpolyeffect.cpp |
+++ b/gm/convexpolyeffect.cpp |
@@ -17,6 +17,7 @@ |
#include "GrContext.h" |
#include "GrDefaultGeoProcFactory.h" |
#include "GrPathUtils.h" |
+#include "GrResourceProvider.h" |
#include "GrTest.h" |
#include "GrTestBatch.h" |
#include "SkColorPriv.h" |
@@ -52,8 +53,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; |
@@ -62,7 +65,7 @@ private: |
&vertexBuffer, |
&firstVertex); |
- if (!vertices || !batchTarget->quadIndexBuffer()) { |
+ if (!vertices || !indexBuffer) { |
SkDebugf("Could not allocate buffers\n"); |
return; |
} |
@@ -82,7 +85,7 @@ private: |
drawInfo.setVertexCount(kVertsPerCubic); |
drawInfo.setStartIndex(0); |
drawInfo.setIndexCount(kIndicesPerCubic); |
- drawInfo.setIndexBuffer(batchTarget->quadIndexBuffer()); |
+ drawInfo.setIndexBuffer(indexBuffer); |
batchTarget->draw(drawInfo); |
} |