aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLPathRendering.cpp
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2016-03-17 11:35:45 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-17 11:35:45 -0700
commit0e1853c89615d14d0d03c87c7e0c604e5285cc54 (patch)
treee0ffc4b77a62d396b548f6e45fc8b335d3e6ecc1 /src/gpu/gl/GrGLPathRendering.cpp
parent852f15da7ceb53cfb49b9f728baa6dbc53b27694 (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/gl/GrGLPathRendering.cpp')
-rw-r--r--src/gpu/gl/GrGLPathRendering.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/gpu/gl/GrGLPathRendering.cpp b/src/gpu/gl/GrGLPathRendering.cpp
index 723d73d535..47274f9d69 100644
--- a/src/gpu/gl/GrGLPathRendering.cpp
+++ b/src/gpu/gl/GrGLPathRendering.cpp
@@ -142,13 +142,16 @@ void GrGLPathRendering::onStencilPath(const StencilPathArgs& args, const GrPath*
}
}
-void GrGLPathRendering::onDrawPath(const DrawPathArgs& args, const GrPath* path) {
- if (!this->gpu()->flushGLState(args)) {
+void GrGLPathRendering::onDrawPath(const GrPipeline& pipeline,
+ const GrPrimitiveProcessor& primProc,
+ const GrStencilSettings& stencil,
+ const GrPath* path) {
+ if (!this->gpu()->flushGLState(pipeline, primProc)) {
return;
}
const GrGLPath* glPath = static_cast<const GrGLPath*>(path);
- this->flushPathStencilSettings(*args.fStencil);
+ this->flushPathStencilSettings(stencil);
SkASSERT(!fHWPathStencilSettings.isTwoSided());
GrGLenum fillMode = gr_stencil_op_to_gl_path_rendering_fill_mode(
@@ -167,16 +170,18 @@ void GrGLPathRendering::onDrawPath(const DrawPathArgs& args, const GrPath* path)
}
}
-void GrGLPathRendering::onDrawPaths(const DrawPathArgs& args, const GrPathRange* pathRange,
+void GrGLPathRendering::onDrawPaths(const GrPipeline& pipeline,
+ const GrPrimitiveProcessor& primProc,
+ const GrStencilSettings& stencil, const GrPathRange* pathRange,
const void* indices, PathIndexType indexType,
const float transformValues[], PathTransformType transformType,
int count) {
SkDEBUGCODE(verify_floats(transformValues, gXformType2ComponentCount[transformType] * count));
- if (!this->gpu()->flushGLState(args)) {
+ if (!this->gpu()->flushGLState(pipeline, primProc)) {
return;
}
- this->flushPathStencilSettings(*args.fStencil);
+ this->flushPathStencilSettings(stencil);
SkASSERT(!fHWPathStencilSettings.isTwoSided());