aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/beziereffects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gm/beziereffects.cpp')
-rw-r--r--gm/beziereffects.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/gm/beziereffects.cpp b/gm/beziereffects.cpp
index 6568422898..182d71aaf6 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 @@ private:
}
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 @@ private:
drawInfo.setVertexCount(kVertsPerCubic);
drawInfo.setStartIndex(0);
drawInfo.setIndexCount(kIndicesPerCubic);
- drawInfo.setIndexBuffer(indexBuffer);
+ drawInfo.setIndexBuffer(batchTarget->quadIndexBuffer());
batchTarget->draw(drawInfo);
}
@@ -475,10 +473,8 @@ private:
}
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 @@ private:
&vertexBuffer,
&firstVertex);
- if (!vertices || !indexBuffer) {
+ if (!vertices || !batchTarget->quadIndexBuffer()) {
SkDebugf("Could not allocate buffers\n");
return;
}
@@ -509,7 +505,7 @@ private:
drawInfo.setVertexCount(kVertsPerCubic);
drawInfo.setStartIndex(0);
drawInfo.setIndexCount(kIndicesPerCubic);
- drawInfo.setIndexBuffer(indexBuffer);
+ drawInfo.setIndexBuffer(batchTarget->quadIndexBuffer());
batchTarget->draw(drawInfo);
}