| Index: src/gpu/gl/builders/GrGLProgramBuilder.cpp
|
| diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
|
| index 64150a4fda96b8abcd77c1f97fff210c6b912bc9..e783ed1688b19d07d417307becfdd805d52e5a9a 100644
|
| --- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
|
| +++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
|
| @@ -29,11 +29,13 @@ static const GrGLShaderVar::Precision kDefaultFragmentPrecision = GrGLShaderVar:
|
| const int GrGLProgramBuilder::kVarsPerBlock = 8;
|
|
|
| GrGLProgram* GrGLProgramBuilder::CreateProgram(const GrOptDrawState& optState,
|
| + const GrProgramDesc& desc,
|
| GrGpu::DrawType drawType,
|
| GrGpuGL* gpu) {
|
| // create a builder. This will be handed off to effects so they can use it to add
|
| // uniforms, varyings, textures, etc
|
| SkAutoTDelete<GrGLProgramBuilder> builder(CreateProgramBuilder(optState,
|
| + desc,
|
| drawType,
|
| optState.hasGeometryProcessor(),
|
| gpu));
|
| @@ -73,10 +75,10 @@ GrGLProgram* GrGLProgramBuilder::CreateProgram(const GrOptDrawState& optState,
|
|
|
| GrGLProgramBuilder*
|
| GrGLProgramBuilder::CreateProgramBuilder(const GrOptDrawState& optState,
|
| + const GrProgramDesc& desc,
|
| GrGpu::DrawType drawType,
|
| bool hasGeometryProcessor,
|
| GrGpuGL* gpu) {
|
| - const GrProgramDesc& desc = optState.programDesc();
|
| if (GrGLProgramDescBuilder::GetHeader(desc).fUseNvpr) {
|
| SkASSERT(gpu->glCaps().pathRenderingSupport());
|
| SkASSERT(GrProgramDesc::kAttribute_ColorInput != desc.header().fColorInput);
|
| @@ -84,26 +86,28 @@ GrGLProgramBuilder::CreateProgramBuilder(const GrOptDrawState& optState,
|
| SkASSERT(!hasGeometryProcessor);
|
| if (gpu->glPathRendering()->texturingMode() ==
|
| GrGLPathRendering::FixedFunction_TexturingMode) {
|
| - return SkNEW_ARGS(GrGLLegacyNvprProgramBuilder, (gpu, optState));
|
| + return SkNEW_ARGS(GrGLLegacyNvprProgramBuilder, (gpu, optState, desc));
|
| } else {
|
| - return SkNEW_ARGS(GrGLNvprProgramBuilder, (gpu, optState));
|
| + return SkNEW_ARGS(GrGLNvprProgramBuilder, (gpu, optState, desc));
|
| }
|
| } else {
|
| - return SkNEW_ARGS(GrGLProgramBuilder, (gpu, optState));
|
| + return SkNEW_ARGS(GrGLProgramBuilder, (gpu, optState, desc));
|
| }
|
| }
|
|
|
| /////////////////////////////////////////////////////////////////////////////
|
|
|
| -GrGLProgramBuilder::GrGLProgramBuilder(GrGpuGL* gpu, const GrOptDrawState& optState)
|
| +GrGLProgramBuilder::GrGLProgramBuilder(GrGpuGL* gpu,
|
| + const GrOptDrawState& optState,
|
| + const GrProgramDesc& desc)
|
| : fVS(this)
|
| , fGS(this)
|
| - , fFS(this, optState.programDesc().header().fFragPosKey)
|
| + , fFS(this, desc.header().fFragPosKey)
|
| , fOutOfStage(true)
|
| , fStageIndex(-1)
|
| , fGeometryProcessor(NULL)
|
| , fOptState(optState)
|
| - , fDesc(optState.programDesc())
|
| + , fDesc(desc)
|
| , fGpu(gpu)
|
| , fUniforms(kVarsPerBlock) {
|
| }
|
| @@ -234,9 +238,7 @@ void GrGLProgramBuilder::emitAndInstallProcs(GrGLSLExpr4* inputColor, GrGLSLExpr
|
| fVS.setupUniformViewMatrix();
|
|
|
| const GrProgramDesc::KeyHeader& header = this->header();
|
| - if (header.fEmitsPointSize) {
|
| - fVS.codeAppend("gl_PointSize = 1.0;");
|
| - }
|
| + fVS.codeAppend("gl_PointSize = 1.0;");
|
|
|
| // Setup position
|
| // TODO it'd be possible to remove these from the vertexshader builder and have them
|
|
|