| 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 "GrGLEffectMatrix.h" | 8 #include "GrGLEffectMatrix.h" |
| 9 #include "GrDrawEffect.h" | 9 #include "GrDrawEffect.h" |
| 10 #include "GrTexture.h" | 10 #include "GrTexture.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 } | 182 } |
| 183 if (NULL != vsVaryingType) { | 183 if (NULL != vsVaryingType) { |
| 184 *vsVaryingType = varyingType; | 184 *vsVaryingType = varyingType; |
| 185 } | 185 } |
| 186 } | 186 } |
| 187 | 187 |
| 188 void GrGLEffectMatrix::setData(const GrGLUniformManager& uniformManager, | 188 void GrGLEffectMatrix::setData(const GrGLUniformManager& uniformManager, |
| 189 const SkMatrix& matrix, | 189 const SkMatrix& matrix, |
| 190 const GrDrawEffect& drawEffect, | 190 const GrDrawEffect& drawEffect, |
| 191 const GrTexture* texture) { | 191 const GrTexture* texture) { |
| 192 GrAssert((GrGLUniformManager::kInvalidUniformHandle == fUni) == | 192 GrAssert(fUni.isValid() != (kVoid_GrSLType == fUniType)); |
| 193 (kVoid_GrSLType == fUniType)); | |
| 194 const SkMatrix& coordChangeMatrix = GrEffect::kLocal_CoordsType == fCoordsTy
pe ? | 193 const SkMatrix& coordChangeMatrix = GrEffect::kLocal_CoordsType == fCoordsTy
pe ? |
| 195 drawEffect.getCoordChangeMatrix() : | 194 drawEffect.getCoordChangeMatrix() : |
| 196 SkMatrix::I(); | 195 SkMatrix::I(); |
| 197 switch (fUniType) { | 196 switch (fUniType) { |
| 198 case kVoid_GrSLType: | 197 case kVoid_GrSLType: |
| 199 GrAssert(matrix.isIdentity()); | 198 GrAssert(matrix.isIdentity()); |
| 200 GrAssert(coordChangeMatrix.isIdentity()); | 199 GrAssert(coordChangeMatrix.isIdentity()); |
| 201 GrAssert(NULL == texture || kTopLeft_GrSurfaceOrigin == texture->ori
gin()); | 200 GrAssert(NULL == texture || kTopLeft_GrSurfaceOrigin == texture->ori
gin()); |
| 202 return; | 201 return; |
| 203 case kVec2f_GrSLType: { | 202 case kVec2f_GrSLType: { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 229 if (!fPrevMatrix.cheapEqualTo(combined)) { | 228 if (!fPrevMatrix.cheapEqualTo(combined)) { |
| 230 uniformManager.setSkMatrix(fUni, combined); | 229 uniformManager.setSkMatrix(fUni, combined); |
| 231 fPrevMatrix = combined; | 230 fPrevMatrix = combined; |
| 232 } | 231 } |
| 233 break; | 232 break; |
| 234 } | 233 } |
| 235 default: | 234 default: |
| 236 GrCrash("Unexpected uniform type."); | 235 GrCrash("Unexpected uniform type."); |
| 237 } | 236 } |
| 238 } | 237 } |
| OLD | NEW |