aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/builders
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2014-10-28 10:27:44 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-28 10:27:44 -0700
commit0e602827df086d2bbb215d828d7fdcbbe16e792b (patch)
tree5757d88a4e655f032accda6500591bb88dec1020 /src/gpu/gl/builders
parent98102a8f795abbfcb98547ced4a8b72eadbad377 (diff)
Working patch to remove constant attributes. This may cause some gm mismatches, I will rebaseline tonight.
Diffstat (limited to 'src/gpu/gl/builders')
-rw-r--r--src/gpu/gl/builders/GrGLProgramBuilder.cpp25
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;