Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Unified Diff: gm/convexpolyeffect.cpp

Issue 1116943004: Move instanced index buffer creation to flush time (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix missing assignment of keys to index buffers Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/beziereffects.cpp ('k') | gyp/gpu.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « gm/beziereffects.cpp ('k') | gyp/gpu.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698