diff options
author | 2016-03-17 11:35:45 -0700 | |
---|---|---|
committer | 2016-03-17 11:35:45 -0700 | |
commit | 0e1853c89615d14d0d03c87c7e0c604e5285cc54 (patch) | |
tree | e0ffc4b77a62d396b548f6e45fc8b335d3e6ecc1 /src/gpu/batches/GrDrawPathBatch.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/GrDrawPathBatch.cpp')
-rw-r--r-- | src/gpu/batches/GrDrawPathBatch.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/gpu/batches/GrDrawPathBatch.cpp b/src/gpu/batches/GrDrawPathBatch.cpp index b11585861c..4a68820763 100644 --- a/src/gpu/batches/GrDrawPathBatch.cpp +++ b/src/gpu/batches/GrDrawPathBatch.cpp @@ -23,10 +23,8 @@ void GrDrawPathBatch::onDraw(GrBatchFlushState* state) { SkAutoTUnref<GrPathProcessor> pathProc(GrPathProcessor::Create(this->color(), this->overrides(), this->viewMatrix())); - state->gpu()->buildProgramDesc(&desc, *pathProc, *this->pipeline()); - GrPathRendering::DrawPathArgs args(pathProc, this->pipeline(), - &desc, &this->stencilSettings()); - state->gpu()->pathRendering()->drawPath(args, fPath.get()); + state->gpu()->pathRendering()->drawPath(*this->pipeline(), *pathProc, this->stencilSettings(), + fPath.get()); } SkString GrDrawPathRangeBatch::dumpInfo() const { @@ -123,14 +121,13 @@ void GrDrawPathRangeBatch::onDraw(GrBatchFlushState* state) { drawMatrix, localMatrix)); - GrProgramDesc desc; - state->gpu()->buildProgramDesc(&desc, *pathProc, *this->pipeline()); - GrPathRendering::DrawPathArgs args(pathProc, this->pipeline(), - &desc, &this->stencilSettings()); - if (fDraws.count() == 1) { const InstanceData& instances = *head.fInstanceData; - state->gpu()->pathRendering()->drawPaths(args, fPathRange.get(), instances.indices(), + state->gpu()->pathRendering()->drawPaths(*this->pipeline(), + *pathProc, + this->stencilSettings(), + fPathRange.get(), + instances.indices(), GrPathRange::kU16_PathIndexType, instances.transformValues(), instances.transformType(), @@ -155,9 +152,15 @@ void GrDrawPathRangeBatch::onDraw(GrBatchFlushState* state) { } SkASSERT(idx == fTotalPathCount); - state->gpu()->pathRendering()->drawPaths(args, fPathRange.get(), indexStorage, - GrPathRange::kU16_PathIndexType, transformStorage, - this->transformType(), fTotalPathCount); + state->gpu()->pathRendering()->drawPaths(*this->pipeline(), + *pathProc, + this->stencilSettings(), + fPathRange.get(), + indexStorage, + GrPathRange::kU16_PathIndexType, + transformStorage, + this->transformType(), + fTotalPathCount); } } |