| 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 GR_GL_CALL(fGpu->glInterface(), | 226 GR_GL_CALL(fGpu->glInterface(), |
| 227 UniformMatrix4fv(uni.fFSLocation, arrayCount, false, matrices
)); | 227 UniformMatrix4fv(uni.fFSLocation, arrayCount, false, matrices
)); |
| 228 } | 228 } |
| 229 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation)
{ | 229 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation)
{ |
| 230 GR_GL_CALL(fGpu->glInterface(), | 230 GR_GL_CALL(fGpu->glInterface(), |
| 231 UniformMatrix4fv(uni.fVSLocation, arrayCount, false, matrices
)); | 231 UniformMatrix4fv(uni.fVSLocation, arrayCount, false, matrices
)); |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 | 234 |
| 235 void GrGLUniformManager::setSkMatrix(UniformHandle u, const SkMatrix& matrix) co
nst { | 235 void GrGLUniformManager::setSkMatrix(UniformHandle u, const SkMatrix& matrix) co
nst { |
| 236 // GR_STATIC_ASSERT(SK_SCALAR_IS_FLOAT); | |
| 237 GrGLfloat mt[] = { | 236 GrGLfloat mt[] = { |
| 238 matrix.get(SkMatrix::kMScaleX), | 237 matrix.get(SkMatrix::kMScaleX), |
| 239 matrix.get(SkMatrix::kMSkewY), | 238 matrix.get(SkMatrix::kMSkewY), |
| 240 matrix.get(SkMatrix::kMPersp0), | 239 matrix.get(SkMatrix::kMPersp0), |
| 241 matrix.get(SkMatrix::kMSkewX), | 240 matrix.get(SkMatrix::kMSkewX), |
| 242 matrix.get(SkMatrix::kMScaleY), | 241 matrix.get(SkMatrix::kMScaleY), |
| 243 matrix.get(SkMatrix::kMPersp1), | 242 matrix.get(SkMatrix::kMPersp1), |
| 244 matrix.get(SkMatrix::kMTransX), | 243 matrix.get(SkMatrix::kMTransX), |
| 245 matrix.get(SkMatrix::kMTransY), | 244 matrix.get(SkMatrix::kMTransY), |
| 246 matrix.get(SkMatrix::kMPersp2), | 245 matrix.get(SkMatrix::kMPersp2), |
| (...skipping 24 matching lines...) Expand all Loading... |
| 271 if (GrGLShaderBuilder::kFragment_Visibility & uniforms[i].fVisibility) { | 270 if (GrGLShaderBuilder::kFragment_Visibility & uniforms[i].fVisibility) { |
| 272 fUniforms[i].fFSLocation = location; | 271 fUniforms[i].fFSLocation = location; |
| 273 } | 272 } |
| 274 } | 273 } |
| 275 } | 274 } |
| 276 | 275 |
| 277 const GrGLUniformManager::BuilderUniform& | 276 const GrGLUniformManager::BuilderUniform& |
| 278 GrGLUniformManager::getBuilderUniform(const BuilderUniformArray& array, UniformH
andle handle) const { | 277 GrGLUniformManager::getBuilderUniform(const BuilderUniformArray& array, UniformH
andle handle) const { |
| 279 return array[handle.toUniformIndex()]; | 278 return array[handle.toUniformIndex()]; |
| 280 } | 279 } |
| OLD | NEW |