| 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 } else { | 222 } else { |
| 223 SkASSERT(!fUniformHandles.fDstCopyTopLeftUni.isValid()); | 223 SkASSERT(!fUniformHandles.fDstCopyTopLeftUni.isValid()); |
| 224 SkASSERT(!fUniformHandles.fDstCopyScaleUni.isValid()); | 224 SkASSERT(!fUniformHandles.fDstCopyScaleUni.isValid()); |
| 225 SkASSERT(!fUniformHandles.fDstCopySamplerUni.isValid()); | 225 SkASSERT(!fUniformHandles.fDstCopySamplerUni.isValid()); |
| 226 } | 226 } |
| 227 | 227 |
| 228 fColorEffects->setData(fGpu, fUniformManager, colorStages); | 228 fColorEffects->setData(fGpu, fUniformManager, colorStages); |
| 229 fCoverageEffects->setData(fGpu, fUniformManager, coverageStages); | 229 fCoverageEffects->setData(fGpu, fUniformManager, coverageStages); |
| 230 | 230 |
| 231 | 231 |
| 232 // TexGen state applies to the the fixed function vertex shader. For custom
shaders, it's | 232 // PathTexGen state applies to the the fixed function vertex shader. For |
| 233 // ignored, so we don't need to change the texgen settings in that case. | 233 // custom shaders, it's ignored, so we don't need to change the texgen |
| 234 // settings in that case. |
| 234 if (!fHasVertexShader) { | 235 if (!fHasVertexShader) { |
| 235 fGpu->flushTexGenSettings(fNumTexCoordSets); | 236 fGpu->flushPathTexGenSettings(fNumTexCoordSets); |
| 236 } | 237 } |
| 237 } | 238 } |
| 238 | 239 |
| 239 void GrGLProgram::setColor(const GrDrawState& drawState, | 240 void GrGLProgram::setColor(const GrDrawState& drawState, |
| 240 GrColor color, | 241 GrColor color, |
| 241 SharedGLState* sharedState) { | 242 SharedGLState* sharedState) { |
| 242 const GrGLProgramDesc::KeyHeader& header = fDesc.getHeader(); | 243 const GrGLProgramDesc::KeyHeader& header = fDesc.getHeader(); |
| 243 if (!drawState.hasColorVertexAttribute()) { | 244 if (!drawState.hasColorVertexAttribute()) { |
| 244 switch (header.fColorInput) { | 245 switch (header.fColorInput) { |
| 245 case GrGLProgramDesc::kAttribute_ColorInput: | 246 case GrGLProgramDesc::kAttribute_ColorInput: |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 337 |
| 337 fMatrixState.fViewMatrix = drawState.getViewMatrix(); | 338 fMatrixState.fViewMatrix = drawState.getViewMatrix(); |
| 338 fMatrixState.fRenderTargetSize = size; | 339 fMatrixState.fRenderTargetSize = size; |
| 339 fMatrixState.fRenderTargetOrigin = rt->origin(); | 340 fMatrixState.fRenderTargetOrigin = rt->origin(); |
| 340 | 341 |
| 341 GrGLfloat viewMatrix[3 * 3]; | 342 GrGLfloat viewMatrix[3 * 3]; |
| 342 fMatrixState.getGLMatrix<3>(viewMatrix); | 343 fMatrixState.getGLMatrix<3>(viewMatrix); |
| 343 fUniformManager.setMatrix3f(fUniformHandles.fViewMatrixUni, viewMatrix); | 344 fUniformManager.setMatrix3f(fUniformHandles.fViewMatrixUni, viewMatrix); |
| 344 } | 345 } |
| 345 } | 346 } |
| OLD | NEW |