OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #ifndef GrGLVertexShader_DEFINED | 8 #ifndef GrGLVertexShader_DEFINED |
9 #define GrGLVertexShader_DEFINED | 9 #define GrGLVertexShader_DEFINED |
10 #include "GrGLShaderBuilder.h" | 10 #include "GrGLShaderBuilder.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 /* | 47 /* |
48 * Internal call for GrGLFullProgramBuilder.addVarying | 48 * Internal call for GrGLFullProgramBuilder.addVarying |
49 */ | 49 */ |
50 void addVarying(GrSLType type, | 50 void addVarying(GrSLType type, |
51 const char* name, | 51 const char* name, |
52 const char** vsOutName); | 52 const char** vsOutName); |
53 | 53 |
54 /* | 54 /* |
55 * private helpers for compilation by GrGLProgramBuilder | 55 * private helpers for compilation by GrGLProgramBuilder |
56 */ | 56 */ |
57 void bindProgramLocations(GrGLuint programId); | 57 void bindProgramLocations(const GrOptDrawState&, GrGLuint programId); |
58 bool compileAndAttachShaders(GrGLuint programId, SkTDArray<GrGLuint>* shader
Ids) const; | 58 bool compileAndAttachShaders(GrGLuint programId, SkTDArray<GrGLuint>* shader
Ids) const; |
59 void emitCodeBeforeEffects(GrGLSLExpr4* color, GrGLSLExpr4* coverage); | 59 void emitCodeBeforeEffects(GrGLSLExpr4* color, GrGLSLExpr4* coverage); |
60 void emitCodeAfterEffects(); | 60 void emitCodeAfterEffects(); |
61 | 61 |
62 struct AttributePair { | 62 struct AttributePair { |
63 void set(int index, const SkString& name) { | 63 void set(int index, const SkString& name) { |
64 fIndex = index; fName = name; | 64 fIndex = index; fName = name; |
65 } | 65 } |
66 int fIndex; | 66 int fIndex; |
67 SkString fName; | 67 SkString fName; |
68 }; | 68 }; |
69 | 69 |
70 GrGLShaderVar* fPositionVar; | 70 GrGLShaderVar* fPositionVar; |
71 GrGLShaderVar* fLocalCoordsVar; | 71 GrGLShaderVar* fLocalCoordsVar; |
72 int fEffectAttribOffset; | 72 int fEffectAttribOffset; |
73 | 73 |
74 friend class GrGLFullProgramBuilder; | 74 friend class GrGLFullProgramBuilder; |
75 | 75 |
76 typedef GrGLFullShaderBuilder INHERITED; | 76 typedef GrGLFullShaderBuilder INHERITED; |
77 }; | 77 }; |
78 | 78 |
79 #endif | 79 #endif |
OLD | NEW |