diff options
author | egdaniel <egdaniel@google.com> | 2016-03-17 11:35:45 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-17 11:35:45 -0700 |
commit | 0e1853c89615d14d0d03c87c7e0c604e5285cc54 (patch) | |
tree | e0ffc4b77a62d396b548f6e45fc8b335d3e6ecc1 /src/gpu/batches/GrTessellatingPathRenderer.cpp | |
parent | 852f15da7ceb53cfb49b9f728baa6dbc53b27694 (diff) |
Update how we send draws to gpu backend to reduce state setting.
The main change here is that we pull primitive type off of the vertices, we set the gpu state on gpu once per pipeline/prim proc draw batch, and we create the ProgramDescriptor only for the Cache/ProgramBuilder.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1806983002
Review URL: https://codereview.chromium.org/1806983002
Diffstat (limited to 'src/gpu/batches/GrTessellatingPathRenderer.cpp')
-rw-r--r-- | src/gpu/batches/GrTessellatingPathRenderer.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gpu/batches/GrTessellatingPathRenderer.cpp b/src/gpu/batches/GrTessellatingPathRenderer.cpp index 06f31cd8db..c00e8ecbe6 100644 --- a/src/gpu/batches/GrTessellatingPathRenderer.cpp +++ b/src/gpu/batches/GrTessellatingPathRenderer.cpp @@ -10,8 +10,8 @@ #include "GrBatchFlushState.h" #include "GrBatchTest.h" #include "GrDefaultGeoProcFactory.h" +#include "GrMesh.h" #include "GrPathUtils.h" -#include "GrVertices.h" #include "GrResourceCache.h" #include "GrResourceProvider.h" #include "GrTessellator.h" @@ -228,14 +228,15 @@ private: void drawVertices(Target* target, const GrGeometryProcessor* gp, const GrVertexBuffer* vb, int firstVertex, int count) const { - target->initDraw(gp, this->pipeline()); SkASSERT(gp->getVertexStride() == sizeof(SkPoint)); GrPrimitiveType primitiveType = TESSELLATOR_WIREFRAME ? kLines_GrPrimitiveType : kTriangles_GrPrimitiveType; - GrVertices vertices; - vertices.init(primitiveType, vb, firstVertex, count); - target->draw(vertices); + target->initDraw(gp); + + GrMesh mesh; + mesh.init(primitiveType, vb, firstVertex, count); + target->draw(mesh); } bool onCombineIfPossible(GrBatch*, const GrCaps&) override { return false; } |