Index: src/gpu/gl/builders/GrGLProgramBuilder.cpp |
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp |
index 65a7cdaa63cd326e633e64670a2c32d117f7522f..28d15174238d8ad198cc6a3dee39866cb2ef4a8a 100644 |
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp |
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp |
@@ -55,9 +55,7 @@ |
// if we have a vertex shader(we don't only if we are using NVPR or NVPR ES), then we may have |
// to setup a few more things like builtin vertex attributes |
- bool hasVertexShader = !(header.fUseNvpr && |
- gpu->glPathRendering()->texturingMode() == |
- GrGLPathRendering::FixedFunction_TexturingMode); |
+ bool hasVertexShader = !header.fUseFragShaderOnly; |
if (hasVertexShader) { |
pb->fVS.setupLocalCoords(); |
pb->fVS.transformGLToSkiaCoords(); |
@@ -94,15 +92,18 @@ |
GrGpu::DrawType drawType, |
bool hasGeometryProcessor, |
GrGpuGL* gpu) { |
- if (desc.getHeader().fUseNvpr) { |
+ if (desc.getHeader().fUseFragShaderOnly) { |
SkASSERT(gpu->glCaps().pathRenderingSupport()); |
+ SkASSERT(gpu->glPathRendering()->texturingMode() == |
+ GrGLPathRendering::FixedFunction_TexturingMode); |
SkASSERT(!hasGeometryProcessor); |
- if (gpu->glPathRendering()->texturingMode() == |
- GrGLPathRendering::FixedFunction_TexturingMode) { |
- return SkNEW_ARGS(GrGLLegacyNvprProgramBuilder, (gpu, optState, desc)); |
- } else { |
- return SkNEW_ARGS(GrGLNvprProgramBuilder, (gpu, optState, desc)); |
- } |
+ return SkNEW_ARGS(GrGLLegacyNvprProgramBuilder, (gpu, optState, desc)); |
+ } else if (GrGpu::IsPathRenderingDrawType(drawType)) { |
+ SkASSERT(gpu->glCaps().pathRenderingSupport()); |
+ SkASSERT(gpu->glPathRendering()->texturingMode() == |
+ GrGLPathRendering::SeparableShaders_TexturingMode); |
+ SkASSERT(!hasGeometryProcessor); |
+ return SkNEW_ARGS(GrGLNvprProgramBuilder, (gpu, optState, desc)); |
} else { |
return SkNEW_ARGS(GrGLProgramBuilder, (gpu, optState, desc)); |
} |
@@ -419,9 +420,7 @@ |
this->cleanupProgram(programID, shadersToDelete); |
return NULL; |
} |
- if (!(this->header().fUseNvpr && |
- fGpu->glPathRendering()->texturingMode() == |
- GrGLPathRendering::FixedFunction_TexturingMode)) { |
+ if (!this->header().fUseFragShaderOnly) { |
if (!fVS.compileAndAttachShaders(programID, &shadersToDelete)) { |
this->cleanupProgram(programID, shadersToDelete); |
return NULL; |