Index: src/gpu/gl/GrGLProgramDesc.cpp |
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp |
index c6560be2b257e91991d1dffd106a7a2fdcd46f38..c0a9e13ed19ca4eddf30e6cd283886dc82da5ab0 100644 |
--- a/src/gpu/gl/GrGLProgramDesc.cpp |
+++ b/src/gpu/gl/GrGLProgramDesc.cpp |
@@ -163,7 +163,7 @@ bool GrGLProgramDesc::Build(const GrOptDrawState& optState, |
GrGpu::DrawType drawType, |
GrBlendCoeff srcCoeff, |
GrBlendCoeff dstCoeff, |
- const GrGpuGL* gpu, |
+ GrGpuGL* gpu, |
const GrDeviceCoordTexture* dstCopy, |
const GrEffectStage** geometryProcessor, |
SkTArray<const GrEffectStage*, true>* colorStages, |
@@ -260,12 +260,11 @@ bool GrGLProgramDesc::Build(const GrOptDrawState& optState, |
// Because header is a pointer into the dynamic array, we can't push any new data into the key |
// below here. |
- // We will only require a vertex shader if we have more than just the position VA attrib. |
- // If we have a geom processor we must us a vertex shader and we should not have a geometry |
- // processor if we are doing path rendering. |
- SkASSERT(!GrGpu::IsPathRenderingDrawType(drawType) || !optState.requiresVertexShader()); |
- header->fRequiresVertexShader = optState.requiresVertexShader() || |
- !GrGpu::IsPathRenderingDrawType(drawType); |
+ header->fUseFragShaderOnly = gpu->caps()->pathRenderingSupport() && |
+ GrGpu::IsPathRenderingDrawType(drawType) && |
+ gpu->glPathRendering()->texturingMode() == GrGLPathRendering::FixedFunction_TexturingMode; |
+ SkASSERT(!header->fUseFragShaderOnly || !optState.hasGeometryProcessor()); |
+ |
header->fEmitsPointSize = GrGpu::kDrawPoints_DrawType == drawType; |
// Currently the experimental GS will only work with triangle prims (and it doesn't do anything |
@@ -277,7 +276,7 @@ bool GrGLProgramDesc::Build(const GrOptDrawState& optState, |
header->fExperimentalGS = false; |
#endif |
#endif |
- bool defaultToUniformInputs = GR_GL_NO_CONSTANT_ATTRIBUTES || gpu->caps()->pathRenderingSupport(); |
+ bool defaultToUniformInputs = GR_GL_NO_CONSTANT_ATTRIBUTES || header->fUseFragShaderOnly; |
if (!inputColorIsUsed) { |
header->fColorInput = kAllOnes_ColorInput; |
@@ -285,7 +284,7 @@ bool GrGLProgramDesc::Build(const GrOptDrawState& optState, |
header->fColorInput = kUniform_ColorInput; |
} else { |
header->fColorInput = kAttribute_ColorInput; |
- header->fRequiresVertexShader = true; |
+ header->fUseFragShaderOnly = false; |
} |
bool covIsSolidWhite = !requiresCoverageAttrib && 0xffffffff == optState.getCoverageColor(); |
@@ -296,7 +295,7 @@ bool GrGLProgramDesc::Build(const GrOptDrawState& optState, |
header->fCoverageInput = kUniform_ColorInput; |
} else { |
header->fCoverageInput = kAttribute_ColorInput; |
- header->fRequiresVertexShader = true; |
+ header->fUseFragShaderOnly = false; |
} |
if (optState.readsDst()) { |