aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-11-22 07:02:11 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-11-22 07:02:11 +0000
commite0a868c84ebc34c5a16b5faa1546016abb9ca0ac (patch)
treeaa08273eefda08985356c87c2f8645e110c05f2b /src/gpu/gl
parent52314f82ba8696e957e70eabde672b6470fedf7a (diff)
Apply hairline optimization only if the path renderer wants it
Make the decision to convert thin, non-hairline paths to hairline paths at the renderer level. The current nv_path_rendering implementation does not render hairlines. Rendering the hairlines with normal renderers cause unneccessary gl program changes, which is quite slow. Changes the behavior of non-nv_path_rendering paths to always perform the optimization if the shape ends up being painted by a renderer that wants the optimization. Previously the optimization was applied only when callgraph started with SkCanvas::drawPath. Applies the optimization for GrAAHairLineRenderer and GrDefaultPathRenderer. This changes gm results for dashing3_{msaa4,gpu} and drawlooper_msaa4. R=bsalomon@google.com, jvanverth@google.com, rmistry@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/38573007 git-svn-id: http://skia.googlecode.com/svn/trunk@12357 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl')
-rw-r--r--src/gpu/gl/GrGLProgram.cpp4
-rw-r--r--src/gpu/gl/GrGLProgramDesc.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index accaf884d1..5b030fa36a 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -207,10 +207,10 @@ void GrGLProgram::setData(GrDrawState::BlendOptFlags blendOpts,
coverage = 0;
} else if (blendOpts & GrDrawState::kEmitCoverage_BlendOptFlag) {
color = 0xffffffff;
- coverage = drawState.getCoverage();
+ coverage = drawState.getCoverageColor();
} else {
color = drawState.getColor();
- coverage = drawState.getCoverage();
+ coverage = drawState.getCoverageColor();
}
this->setColor(drawState, color, sharedState);
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp
index e655210a45..381461a03b 100644
--- a/src/gpu/gl/GrGLProgramDesc.cpp
+++ b/src/gpu/gl/GrGLProgramDesc.cpp
@@ -156,7 +156,7 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState,
header->fHasVertexCode = true;
}
- bool covIsSolidWhite = !requiresCoverageAttrib && 0xffffffff == drawState.getCoverage();
+ bool covIsSolidWhite = !requiresCoverageAttrib && 0xffffffff == drawState.getCoverageColor();
if (skipCoverage) {
header->fCoverageInput = kTransBlack_ColorInput;