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/GrGLPathRendering.h" | 8 #include "gl/GrGLPathRendering.h" |
9 #include "gl/GrGLUniformHandle.h" | 9 #include "gl/GrGLUniformHandle.h" |
10 #include "gl/GrGLGpu.h" | 10 #include "gl/GrGLGpu.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 } | 178 } |
179 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation)
{ | 179 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation)
{ |
180 GR_GL_CALL(fGpu->glInterface(), Uniform4fv(uni.fVSLocation, arrayCount,
v)); | 180 GR_GL_CALL(fGpu->glInterface(), Uniform4fv(uni.fVSLocation, arrayCount,
v)); |
181 } | 181 } |
182 } | 182 } |
183 | 183 |
184 void GrGLProgramDataManager::setMatrix3f(UniformHandle u, const GrGLfloat matrix
[]) const { | 184 void GrGLProgramDataManager::setMatrix3f(UniformHandle u, const GrGLfloat matrix
[]) const { |
185 const Uniform& uni = fUniforms[u.toProgramDataIndex()]; | 185 const Uniform& uni = fUniforms[u.toProgramDataIndex()]; |
186 SkASSERT(uni.fType == kMat33f_GrSLType); | 186 SkASSERT(uni.fType == kMat33f_GrSLType); |
187 SkASSERT(GrGLShaderVar::kNonArray == uni.fArrayCount); | 187 SkASSERT(GrGLShaderVar::kNonArray == uni.fArrayCount); |
188 // TODO: Re-enable this assert once texture matrices aren't forced on all ef
fects | 188 SkASSERT(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLocat
ion); |
189 // SkASSERT(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLo
cation); | |
190 if (kUnusedUniform != uni.fFSLocation) { | 189 if (kUnusedUniform != uni.fFSLocation) { |
191 GR_GL_CALL(fGpu->glInterface(), UniformMatrix3fv(uni.fFSLocation, 1, fal
se, matrix)); | 190 GR_GL_CALL(fGpu->glInterface(), UniformMatrix3fv(uni.fFSLocation, 1, fal
se, matrix)); |
192 } | 191 } |
193 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation)
{ | 192 if (kUnusedUniform != uni.fVSLocation && uni.fVSLocation != uni.fFSLocation)
{ |
194 GR_GL_CALL(fGpu->glInterface(), UniformMatrix3fv(uni.fVSLocation, 1, fal
se, matrix)); | 193 GR_GL_CALL(fGpu->glInterface(), UniformMatrix3fv(uni.fVSLocation, 1, fal
se, matrix)); |
195 } | 194 } |
196 } | 195 } |
197 | 196 |
198 void GrGLProgramDataManager::setMatrix4f(UniformHandle u, const GrGLfloat matrix
[]) const { | 197 void GrGLProgramDataManager::setMatrix4f(UniformHandle u, const GrGLfloat matrix
[]) const { |
199 const Uniform& uni = fUniforms[u.toProgramDataIndex()]; | 198 const Uniform& uni = fUniforms[u.toProgramDataIndex()]; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 matrix.get(SkMatrix::kMPersp0), | 250 matrix.get(SkMatrix::kMPersp0), |
252 matrix.get(SkMatrix::kMSkewX), | 251 matrix.get(SkMatrix::kMSkewX), |
253 matrix.get(SkMatrix::kMScaleY), | 252 matrix.get(SkMatrix::kMScaleY), |
254 matrix.get(SkMatrix::kMPersp1), | 253 matrix.get(SkMatrix::kMPersp1), |
255 matrix.get(SkMatrix::kMTransX), | 254 matrix.get(SkMatrix::kMTransX), |
256 matrix.get(SkMatrix::kMTransY), | 255 matrix.get(SkMatrix::kMTransY), |
257 matrix.get(SkMatrix::kMPersp2), | 256 matrix.get(SkMatrix::kMPersp2), |
258 }; | 257 }; |
259 this->setMatrix3f(u, mt); | 258 this->setMatrix3f(u, mt); |
260 } | 259 } |
OLD | NEW |