OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrGLProgram.h" | 8 #include "GrGLProgram.h" |
9 | 9 |
10 #include "GrAllocator.h" | 10 #include "GrAllocator.h" |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 } | 234 } |
235 } else { | 235 } else { |
236 SkASSERT(!fUniformHandles.fDstCopyTopLeftUni.isValid()); | 236 SkASSERT(!fUniformHandles.fDstCopyTopLeftUni.isValid()); |
237 SkASSERT(!fUniformHandles.fDstCopyScaleUni.isValid()); | 237 SkASSERT(!fUniformHandles.fDstCopyScaleUni.isValid()); |
238 SkASSERT(!fUniformHandles.fDstCopySamplerUni.isValid()); | 238 SkASSERT(!fUniformHandles.fDstCopySamplerUni.isValid()); |
239 } | 239 } |
240 | 240 |
241 fColorEffects->setData(fGpu, fUniformManager, colorStages); | 241 fColorEffects->setData(fGpu, fUniformManager, colorStages); |
242 fCoverageEffects->setData(fGpu, fUniformManager, coverageStages); | 242 fCoverageEffects->setData(fGpu, fUniformManager, coverageStages); |
243 | 243 |
| 244 |
| 245 // TexGen state applies to the the fixed function vertex shader. For custom
shaders, it's |
| 246 // ignored, so we don't need to change the texgen settings in that case. |
244 if (!fHasVertexShader) { | 247 if (!fHasVertexShader) { |
245 fGpu->disableUnusedTexGen(fNumTexCoordSets); | 248 fGpu->flushTexGenSettings(fNumTexCoordSets); |
246 } | 249 } |
247 } | 250 } |
248 | 251 |
249 void GrGLProgram::setColor(const GrDrawState& drawState, | 252 void GrGLProgram::setColor(const GrDrawState& drawState, |
250 GrColor color, | 253 GrColor color, |
251 SharedGLState* sharedState) { | 254 SharedGLState* sharedState) { |
252 const GrGLProgramDesc::KeyHeader& header = fDesc.getHeader(); | 255 const GrGLProgramDesc::KeyHeader& header = fDesc.getHeader(); |
253 if (!drawState.hasColorVertexAttribute()) { | 256 if (!drawState.hasColorVertexAttribute()) { |
254 switch (header.fColorInput) { | 257 switch (header.fColorInput) { |
255 case GrGLProgramDesc::kAttribute_ColorInput: | 258 case GrGLProgramDesc::kAttribute_ColorInput: |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 | 349 |
347 fMatrixState.fViewMatrix = drawState.getViewMatrix(); | 350 fMatrixState.fViewMatrix = drawState.getViewMatrix(); |
348 fMatrixState.fRenderTargetSize = size; | 351 fMatrixState.fRenderTargetSize = size; |
349 fMatrixState.fRenderTargetOrigin = rt->origin(); | 352 fMatrixState.fRenderTargetOrigin = rt->origin(); |
350 | 353 |
351 GrGLfloat viewMatrix[3 * 3]; | 354 GrGLfloat viewMatrix[3 * 3]; |
352 fMatrixState.getGLMatrix<3>(viewMatrix); | 355 fMatrixState.getGLMatrix<3>(viewMatrix); |
353 fUniformManager.setMatrix3f(fUniformHandles.fViewMatrixUni, viewMatrix); | 356 fUniformManager.setMatrix3f(fUniformHandles.fViewMatrixUni, viewMatrix); |
354 } | 357 } |
355 } | 358 } |
OLD | NEW |