| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "gl/GrGLShaderBuilder.h" | 8 #include "gl/GrGLShaderBuilder.h" |
| 9 #include "gl/GrGLProgram.h" | 9 #include "gl/GrGLProgram.h" |
| 10 #include "gl/GrGLUniformHandle.h" | 10 #include "gl/GrGLUniformHandle.h" |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 void GrGLUniformManager::getUniformLocations(GrGLuint programID, const BuilderUn
iformArray& uniforms) { | 252 void GrGLUniformManager::getUniformLocations(GrGLuint programID, const BuilderUn
iformArray& uniforms) { |
| 253 SkASSERT(uniforms.count() == fUniforms.count()); | 253 SkASSERT(uniforms.count() == fUniforms.count()); |
| 254 int count = fUniforms.count(); | 254 int count = fUniforms.count(); |
| 255 for (int i = 0; i < count; ++i) { | 255 for (int i = 0; i < count; ++i) { |
| 256 SkASSERT(uniforms[i].fVariable.getType() == fUniforms[i].fType); | 256 SkASSERT(uniforms[i].fVariable.getType() == fUniforms[i].fType); |
| 257 SkASSERT(uniforms[i].fVariable.getArrayCount() == fUniforms[i].fArrayCou
nt); | 257 SkASSERT(uniforms[i].fVariable.getArrayCount() == fUniforms[i].fArrayCou
nt); |
| 258 GrGLint location; | 258 GrGLint location; |
| 259 // TODO: Move the Xoom uniform array in both FS and VS bug workaround he
re. | 259 // TODO: Move the Xoom uniform array in both FS and VS bug workaround he
re. |
| 260 GR_GL_CALL_RET(fContext.interface(), location, | 260 GR_GL_CALL_RET(fContext.interface(), location, |
| 261 GetUniformLocation(programID, uniforms[i].fVariable.c_str
())); | 261 GetUniformLocation(programID, uniforms[i].fVariable.c_str
())); |
| 262 if (GrGLShaderBuilder::kVertex_ShaderType & uniforms[i].fVisibility) { | 262 if (GrGLShaderBuilder::kVertex_Visibility & uniforms[i].fVisibility) { |
| 263 fUniforms[i].fVSLocation = location; | 263 fUniforms[i].fVSLocation = location; |
| 264 } | 264 } |
| 265 if (GrGLShaderBuilder::kFragment_ShaderType & uniforms[i].fVisibility) { | 265 if (GrGLShaderBuilder::kFragment_Visibility & uniforms[i].fVisibility) { |
| 266 fUniforms[i].fFSLocation = location; | 266 fUniforms[i].fFSLocation = location; |
| 267 } | 267 } |
| 268 } | 268 } |
| 269 } | 269 } |
| 270 | 270 |
| 271 const GrGLUniformManager::BuilderUniform& | 271 const GrGLUniformManager::BuilderUniform& |
| 272 GrGLUniformManager::getBuilderUniform(const BuilderUniformArray& array, UniformH
andle handle) const { | 272 GrGLUniformManager::getBuilderUniform(const BuilderUniformArray& array, UniformH
andle handle) const { |
| 273 return array[handle.toUniformIndex()]; | 273 return array[handle.toUniformIndex()]; |
| 274 } | 274 } |
| OLD | NEW |