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 #ifndef GrGLEffectMatrix_DEFINED | 8 #ifndef GrGLEffectMatrix_DEFINED |
9 #define GrGLEffectMatrix_DEFINED | 9 #define GrGLEffectMatrix_DEFINED |
10 | 10 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 CoordsType, | 77 CoordsType, |
78 const GrTexture*); | 78 const GrTexture*); |
79 | 79 |
80 /** | 80 /** |
81 * Emits code to implement the matrix in the VS. A varying is added as an ou
tput of the VS and | 81 * Emits code to implement the matrix in the VS. A varying is added as an ou
tput of the VS and |
82 * input to the FS. The varying may be either a vec2f or vec3f depending upo
n whether | 82 * input to the FS. The varying may be either a vec2f or vec3f depending upo
n whether |
83 * perspective interpolation is required or not. The names of the varying in
the VS and FS are | 83 * perspective interpolation is required or not. The names of the varying in
the VS and FS are |
84 * are returned as output parameters and the type of the varying is the retu
rn value. The suffix | 84 * are returned as output parameters and the type of the varying is the retu
rn value. The suffix |
85 * is an optional parameter that can be used to make all variables emitted b
y the object | 85 * is an optional parameter that can be used to make all variables emitted b
y the object |
86 * unique within a stage. It is only necessary if multiple GrGLEffectMatrix
objects are used by | 86 * unique within a stage. It is only necessary if multiple GrGLEffectMatrix
objects are used by |
87 * a GrGLEffect. | 87 * a single GrGLEffect. |
88 */ | 88 */ |
89 GrSLType emitCode(GrGLShaderBuilder*, | 89 GrSLType emitCode(GrGLShaderBuilder*, |
90 EffectKey, | 90 EffectKey, |
91 const char** fsCoordName, /* optional */ | 91 SkString* fsCoordName, /* optional */ |
92 const char** vsCoordName = NULL, | 92 SkString* vsCoordName = NULL, |
93 const char* suffix = NULL); | 93 const char* suffix = NULL); |
94 | 94 |
95 /** | 95 /** |
96 * This is similar to emitCode except that it performs perspective division
in the FS if the | 96 * This is similar to emitCode except that it performs perspective division
in the FS if the |
97 * texture coordinates have a w coordinate. The fsCoordName always refers to
a vec2f. | 97 * texture coordinates have a w coordinate. The fsCoordName always refers to
a vec2f. |
98 */ | 98 */ |
99 void emitCodeMakeFSCoords2D(GrGLShaderBuilder*, | 99 void emitCodeMakeFSCoords2D(GrGLShaderBuilder*, |
100 EffectKey, | 100 EffectKey, |
101 const char** fsCoordName, /* optional */ | 101 SkString* fsCoordName, /* optional */ |
102 const char** vsVaryingName = NULL, | 102 SkString* vsVaryingName = NULL, |
103 GrSLType* vsVaryingType = NULL, | 103 GrSLType* vsVaryingType = NULL, |
104 const char* suffix = NULL); | 104 const char* suffix = NULL); |
105 /** | 105 /** |
106 * Call from a GrGLEffect's subclass to update the texture matrix. The effec
tMatrix and texture | 106 * Call from a GrGLEffect's subclass to update the texture matrix. The effec
tMatrix and texture |
107 * params should match those used with GenKey. | 107 * params should match those used with GenKey. |
108 */ | 108 */ |
109 void setData(const GrGLUniformManager& uniformManager, | 109 void setData(const GrGLUniformManager& uniformManager, |
110 const SkMatrix& effectMatrix, | 110 const SkMatrix& effectMatrix, |
111 const GrDrawEffect& drawEffect, | 111 const GrDrawEffect& drawEffect, |
112 const GrTexture*); | 112 const GrTexture*); |
113 | 113 |
114 GrGLUniformManager::UniformHandle fUni; | 114 GrGLUniformManager::UniformHandle fUni; |
115 GrSLType fUniType; | 115 GrSLType fUniType; |
116 SkMatrix fPrevMatrix; | 116 SkMatrix fPrevMatrix; |
117 CoordsType fCoordsType; | 117 CoordsType fCoordsType; |
118 }; | 118 }; |
119 | 119 |
120 #endif | 120 #endif |
OLD | NEW |