| 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 GrGLShaderBuilder_DEFINED | 8 #ifndef GrGLShaderBuilder_DEFINED |
| 9 #define GrGLShaderBuilder_DEFINED | 9 #define GrGLShaderBuilder_DEFINED |
| 10 | 10 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 const GrGLShaderVar& getUniformVariable(GrGLUniformManager::UniformHandle) c
onst; | 140 const GrGLShaderVar& getUniformVariable(GrGLUniformManager::UniformHandle) c
onst; |
| 141 | 141 |
| 142 /** | 142 /** |
| 143 * Shortcut for getUniformVariable(u).c_str() | 143 * Shortcut for getUniformVariable(u).c_str() |
| 144 */ | 144 */ |
| 145 const char* getUniformCStr(GrGLUniformManager::UniformHandle u) const { | 145 const char* getUniformCStr(GrGLUniformManager::UniformHandle u) const { |
| 146 return this->getUniformVariable(u).c_str(); | 146 return this->getUniformVariable(u).c_str(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 /** Add a varying variable to the current program to pass values between ver
tex and fragment | 149 /** Add a vertex attribute to the current program that is passed in from the
vertex data */ |
| 150 void addAttribute(GrSLType type, const char* name); |
| 151 |
| 152 /** Add a varying variable to the current program to pass values between vert
ex and fragment |
| 150 shaders. If the last two parameters are non-NULL, they are filled in wit
h the name | 153 shaders. If the last two parameters are non-NULL, they are filled in wit
h the name |
| 151 generated. */ | 154 generated. */ |
| 152 void addVarying(GrSLType type, | 155 void addVarying(GrSLType type, |
| 153 const char* name, | 156 const char* name, |
| 154 const char** vsOutName = NULL, | 157 const char** vsOutName = NULL, |
| 155 const char** fsInName = NULL); | 158 const char** fsInName = NULL); |
| 156 | 159 |
| 157 /** Returns a variable name that represents the position of the fragment in
the FS. The position | 160 /** Returns a variable name that represents the position of the fragment in
the FS. The position |
| 158 is in device space (e.g. 0,0 is the top left and pixel centers are at ha
lf-integers). */ | 161 is in device space (e.g. 0,0 is the top left and pixel centers are at ha
lf-integers). */ |
| 159 const char* fragmentPosition(); | 162 const char* fragmentPosition(); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 SkString fFSFunctions; | 228 SkString fFSFunctions; |
| 226 SkString fFSHeader; | 229 SkString fFSHeader; |
| 227 | 230 |
| 228 bool fSetupFragPosition; | 231 bool fSetupFragPosition; |
| 229 GrGLUniformManager::UniformHandle fRTHeightUniform; | 232 GrGLUniformManager::UniformHandle fRTHeightUniform; |
| 230 | 233 |
| 231 GrGLShaderVar* fPositionVar; | 234 GrGLShaderVar* fPositionVar; |
| 232 }; | 235 }; |
| 233 | 236 |
| 234 #endif | 237 #endif |
| OLD | NEW |