aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLProgramDesc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/gl/GrGLProgramDesc.cpp')
-rw-r--r--src/gpu/gl/GrGLProgramDesc.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp
index 79088137ca..4a274c6bb1 100644
--- a/src/gpu/gl/GrGLProgramDesc.cpp
+++ b/src/gpu/gl/GrGLProgramDesc.cpp
@@ -257,25 +257,27 @@ bool GrGLProgramDesc::Build(const GrOptDrawState& optState,
header->fEmitsPointSize = GrGpu::kDrawPoints_DrawType == drawType;
- if (gpu->caps()->pathRenderingSupport() &&
- GrGpu::IsPathRenderingDrawType(drawType) &&
- gpu->glPathRendering()->texturingMode() == GrGLPathRendering::FixedFunction_TexturingMode) {
- header->fUseFragShaderOnly = true;
+ bool isPathRendering = GrGpu::IsPathRenderingDrawType(drawType);
+ if (gpu->caps()->pathRenderingSupport() && isPathRendering) {
+ header->fUseNvpr = true;
SkASSERT(!optState.hasGeometryProcessor());
} else {
- header->fUseFragShaderOnly = false;
+ header->fUseNvpr = false;
}
- bool defaultToUniformInputs = GrGpu::IsPathRenderingDrawType(drawType) ||
- GR_GL_NO_CONSTANT_ATTRIBUTES;
+ bool hasUniformColor = inputColorIsUsed &&
+ (isPathRendering || !optState.hasColorVertexAttribute());
+
+ bool hasUniformCoverage = inputCoverageIsUsed &&
+ (isPathRendering || !optState.hasCoverageVertexAttribute());
if (!inputColorIsUsed) {
header->fColorInput = kAllOnes_ColorInput;
- } else if (defaultToUniformInputs && !optState.hasColorVertexAttribute()) {
+ } else if (hasUniformColor) {
header->fColorInput = kUniform_ColorInput;
} else {
header->fColorInput = kAttribute_ColorInput;
- SkASSERT(!header->fUseFragShaderOnly);
+ SkASSERT(!header->fUseNvpr);
}
bool covIsSolidWhite = !optState.hasCoverageVertexAttribute() &&
@@ -283,11 +285,11 @@ bool GrGLProgramDesc::Build(const GrOptDrawState& optState,
if (covIsSolidWhite || !inputCoverageIsUsed) {
header->fCoverageInput = kAllOnes_ColorInput;
- } else if (defaultToUniformInputs && !optState.hasCoverageVertexAttribute()) {
+ } else if (hasUniformCoverage) {
header->fCoverageInput = kUniform_ColorInput;
} else {
header->fCoverageInput = kAttribute_ColorInput;
- SkASSERT(!header->fUseFragShaderOnly);
+ SkASSERT(!header->fUseNvpr);
}
if (optState.readsDst()) {