Fix two inconsistencies in handling fixed-function texture coordinate set generation
Prevent off-by-one bug leaving the texture coordinate set 0 always enabled if
it ever was used. This makes the code consistent with its apparent purpose.
When enabling / disabling texture coordinate sets, call glPathTexGen
only if path rendering is applicable. This makes the functions
consistent with GrGpuGL::resetContext.
R=cdalton@nvidia.com, bsalomon@google.com
Author: kkinnunen@nvidia.com
Review URL: https://codereview.chromium.org/54403003
git-svn-id: http://skia.googlecode.com/svn/trunk@12074 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index 7ddd861..f80bc2e 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -241,8 +241,11 @@
fColorEffects->setData(fGpu, fUniformManager, colorStages);
fCoverageEffects->setData(fGpu, fUniformManager, coverageStages);
+
+ // TexGen state applies to the the fixed function vertex shader. For custom shaders, it's
+ // ignored, so we don't need to change the texgen settings in that case.
if (!fHasVertexShader) {
- fGpu->disableUnusedTexGen(fNumTexCoordSets);
+ fGpu->flushTexGenSettings(fNumTexCoordSets);
}
}