diff options
author | joshualitt <joshualitt@chromium.org> | 2014-10-28 10:27:44 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-28 10:27:44 -0700 |
commit | 0e602827df086d2bbb215d828d7fdcbbe16e792b (patch) | |
tree | 5757d88a4e655f032accda6500591bb88dec1020 /src/gpu/gl/builders | |
parent | 98102a8f795abbfcb98547ced4a8b72eadbad377 (diff) |
Working patch to remove constant attributes. This may cause some gm mismatches, I will rebaseline tonight.
BUG=skia:
Committed: https://skia.googlesource.com/skia/+/84c94c0dfd1e12e97d8a835882dda575f36e41d2
Committed: https://skia.googlesource.com/skia/+/95f5194abce19e8ed875f3495fd16c79a9b931b4
Review URL: https://codereview.chromium.org/678073005
Diffstat (limited to 'src/gpu/gl/builders')
-rw-r--r-- | src/gpu/gl/builders/GrGLProgramBuilder.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp index 28d1517423..65a7cdaa63 100644 --- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp +++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp @@ -55,7 +55,9 @@ GrGLProgram* GrGLProgramBuilder::CreateProgram(const GrOptDrawState& optState, // 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.fUseFragShaderOnly; + bool hasVertexShader = !(header.fUseNvpr && + gpu->glPathRendering()->texturingMode() == + GrGLPathRendering::FixedFunction_TexturingMode); if (hasVertexShader) { pb->fVS.setupLocalCoords(); pb->fVS.transformGLToSkiaCoords(); @@ -92,18 +94,15 @@ GrGLProgramBuilder::CreateProgramBuilder(const GrGLProgramDesc& desc, GrGpu::DrawType drawType, bool hasGeometryProcessor, GrGpuGL* gpu) { - if (desc.getHeader().fUseFragShaderOnly) { + if (desc.getHeader().fUseNvpr) { SkASSERT(gpu->glCaps().pathRenderingSupport()); - SkASSERT(gpu->glPathRendering()->texturingMode() == - GrGLPathRendering::FixedFunction_TexturingMode); SkASSERT(!hasGeometryProcessor); - 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)); + if (gpu->glPathRendering()->texturingMode() == + GrGLPathRendering::FixedFunction_TexturingMode) { + return SkNEW_ARGS(GrGLLegacyNvprProgramBuilder, (gpu, optState, desc)); + } else { + return SkNEW_ARGS(GrGLNvprProgramBuilder, (gpu, optState, desc)); + } } else { return SkNEW_ARGS(GrGLProgramBuilder, (gpu, optState, desc)); } @@ -420,7 +419,9 @@ GrGLProgram* GrGLProgramBuilder::finalize() { this->cleanupProgram(programID, shadersToDelete); return NULL; } - if (!this->header().fUseFragShaderOnly) { + if (!(this->header().fUseNvpr && + fGpu->glPathRendering()->texturingMode() == + GrGLPathRendering::FixedFunction_TexturingMode)) { if (!fVS.compileAndAttachShaders(programID, &shadersToDelete)) { this->cleanupProgram(programID, shadersToDelete); return NULL; |