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

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

Issue 23471008: Add a requiresVertexShader method to GrGLEffect (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: brace formatting issue Created 7 years, 3 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/GrGLEffect.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 30 matching lines...) Expand all
41 key |= kIdentity_MatrixType; 41 key |= kIdentity_MatrixType;
42 } 42 }
43 return key; 43 return key;
44 } 44 }
45 45
46 GrSLType GrGLEffectMatrix::emitCode(GrGLShaderBuilder* builder, 46 GrSLType GrGLEffectMatrix::emitCode(GrGLShaderBuilder* builder,
47 EffectKey key, 47 EffectKey key,
48 SkString* fsCoordName, 48 SkString* fsCoordName,
49 SkString* vsCoordName, 49 SkString* vsCoordName,
50 const char* suffix) { 50 const char* suffix) {
51 // TODO: Handle vertexless shaders here before we start enabling them.
51 GrGLShaderBuilder::VertexBuilder* vertexBuilder = builder->getVertexBuilder( ); 52 GrGLShaderBuilder::VertexBuilder* vertexBuilder = builder->getVertexBuilder( );
52 SkASSERT(NULL != vertexBuilder); 53 SkASSERT(NULL != vertexBuilder);
53 54
54 GrSLType varyingType = kVoid_GrSLType; 55 GrSLType varyingType = kVoid_GrSLType;
55 const char* uniName; 56 const char* uniName;
56 key &= kKeyMask; 57 key &= kKeyMask;
57 switch (key & kMatrixTypeKeyMask) { 58 switch (key & kMatrixTypeKeyMask) {
58 case kIdentity_MatrixType: 59 case kIdentity_MatrixType:
59 fUniType = kVoid_GrSLType; 60 fUniType = kVoid_GrSLType;
60 varyingType = kVec2f_GrSLType; 61 varyingType = kVec2f_GrSLType;
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 if (!fPrevMatrix.cheapEqualTo(combined)) { 232 if (!fPrevMatrix.cheapEqualTo(combined)) {
232 uniformManager.setSkMatrix(fUni, combined); 233 uniformManager.setSkMatrix(fUni, combined);
233 fPrevMatrix = combined; 234 fPrevMatrix = combined;
234 } 235 }
235 break; 236 break;
236 } 237 }
237 default: 238 default:
238 GrCrash("Unexpected uniform type."); 239 GrCrash("Unexpected uniform type.");
239 } 240 }
240 } 241 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLEffect.h ('k') | src/gpu/gl/GrGLProgram.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698