Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/gpu/gl/GrGLEffectMatrix.cpp

Issue 22340010: Refactor GrGLUniformManager::UniformHandle to initialize itself by default (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: description Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/gpu/gl/GrGLEffectMatrix.h ('k') | src/gpu/gl/GrGLProgram.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLEffectMatrix.h ('k') | src/gpu/gl/GrGLProgram.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698