| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 } | 204 } |
| 205 | 205 |
| 206 } | 206 } |
| 207 | 207 |
| 208 bool GrGLProgram::genProgram(const GrEffectStage* colorStages[], | 208 bool GrGLProgram::genProgram(const GrEffectStage* colorStages[], |
| 209 const GrEffectStage* coverageStages[]) { | 209 const GrEffectStage* coverageStages[]) { |
| 210 SkASSERT(0 == fProgramID); | 210 SkASSERT(0 == fProgramID); |
| 211 | 211 |
| 212 const GrGLProgramDesc::KeyHeader& header = fDesc.getHeader(); | 212 const GrGLProgramDesc::KeyHeader& header = fDesc.getHeader(); |
| 213 | 213 |
| 214 bool needsVertexShader = true; | 214 GrGLFullShaderBuilder builder(fGpu, fUniformManager, fDesc); |
| 215 | 215 fUniformHandles.fViewMatrixUni = builder.getViewMatrixUniform(); |
| 216 GrGLShaderBuilder builder(fGpu, fUniformManager, fDesc, needsVertexShader); | |
| 217 if (GrGLShaderBuilder::VertexBuilder* vertexBuilder = builder.getVertexBuild
er()) { | |
| 218 fUniformHandles.fViewMatrixUni = vertexBuilder->getViewMatrixUniform(); | |
| 219 } | |
| 220 | 216 |
| 221 // incoming color to current stage being processed. | 217 // incoming color to current stage being processed. |
| 222 SkString inColor = builder.getInputColor(); | 218 SkString inColor = builder.getInputColor(); |
| 223 GrSLConstantVec knownColorValue = builder.getKnownColorValue(); | 219 GrSLConstantVec knownColorValue = builder.getKnownColorValue(); |
| 224 | 220 |
| 225 // Get the coeffs for the Mode-based color filter, determine if color is nee
ded. | 221 // Get the coeffs for the Mode-based color filter, determine if color is nee
ded. |
| 226 SkXfermode::Coeff colorCoeff; | 222 SkXfermode::Coeff colorCoeff; |
| 227 SkXfermode::Coeff filterColorCoeff; | 223 SkXfermode::Coeff filterColorCoeff; |
| 228 SkAssertResult( | 224 SkAssertResult( |
| 229 SkXfermode::ModeAsCoeff(header.fColorFilterXfermode, | 225 SkXfermode::ModeAsCoeff(header.fColorFilterXfermode, |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 | 541 |
| 546 fMatrixState.fViewMatrix = drawState.getViewMatrix(); | 542 fMatrixState.fViewMatrix = drawState.getViewMatrix(); |
| 547 fMatrixState.fRenderTargetSize = size; | 543 fMatrixState.fRenderTargetSize = size; |
| 548 fMatrixState.fRenderTargetOrigin = rt->origin(); | 544 fMatrixState.fRenderTargetOrigin = rt->origin(); |
| 549 | 545 |
| 550 GrGLfloat viewMatrix[3 * 3]; | 546 GrGLfloat viewMatrix[3 * 3]; |
| 551 fMatrixState.getGLMatrix<3>(viewMatrix); | 547 fMatrixState.getGLMatrix<3>(viewMatrix); |
| 552 fUniformManager.setMatrix3f(fUniformHandles.fViewMatrixUni, viewMatrix); | 548 fUniformManager.setMatrix3f(fUniformHandles.fViewMatrixUni, viewMatrix); |
| 553 } | 549 } |
| 554 } | 550 } |
| OLD | NEW |