| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 GrGLSL_DEFINED | 8 #ifndef GrGLSL_DEFINED |
| 9 #define GrGLSL_DEFINED | 9 #define GrGLSL_DEFINED |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 return "vec3"; | 63 return "vec3"; |
| 64 case kVec4f_GrSLType: | 64 case kVec4f_GrSLType: |
| 65 return "vec4"; | 65 return "vec4"; |
| 66 case kMat33f_GrSLType: | 66 case kMat33f_GrSLType: |
| 67 return "mat3"; | 67 return "mat3"; |
| 68 case kMat44f_GrSLType: | 68 case kMat44f_GrSLType: |
| 69 return "mat4"; | 69 return "mat4"; |
| 70 case kSampler2D_GrSLType: | 70 case kSampler2D_GrSLType: |
| 71 return "sampler2D"; | 71 return "sampler2D"; |
| 72 default: | 72 default: |
| 73 GrCrash("Unknown shader var type."); | 73 SkFAIL("Unknown shader var type."); |
| 74 return ""; // suppress warning | 74 return ""; // suppress warning |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 | 77 |
| 78 /** A generic base-class representing a GLSL expression. | 78 /** A generic base-class representing a GLSL expression. |
| 79 * The instance can be a variable name, expression or vecN(0) or vecN(1). Does s
imple constant | 79 * The instance can be a variable name, expression or vecN(0) or vecN(1). Does s
imple constant |
| 80 * folding with help of 1 and 0. | 80 * folding with help of 1 and 0. |
| 81 * | 81 * |
| 82 * Clients should not use this class, rather the specific instantiations defined | 82 * Clients should not use this class, rather the specific instantiations defined |
| 83 * later, for example GrGLSLExpr4. | 83 * later, for example GrGLSLExpr4. |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 /** | 311 /** |
| 312 * Does an inplace mul, *=, of vec4VarName by mulFactor. | 312 * Does an inplace mul, *=, of vec4VarName by mulFactor. |
| 313 * A semicolon and newline are added after the assignment. | 313 * A semicolon and newline are added after the assignment. |
| 314 */ | 314 */ |
| 315 void GrGLSLMulVarBy4f(SkString* outAppend, unsigned tabCnt, | 315 void GrGLSLMulVarBy4f(SkString* outAppend, unsigned tabCnt, |
| 316 const char* vec4VarName, const GrGLSLExpr4& mulFactor); | 316 const char* vec4VarName, const GrGLSLExpr4& mulFactor); |
| 317 | 317 |
| 318 #include "GrGLSL_impl.h" | 318 #include "GrGLSL_impl.h" |
| 319 | 319 |
| 320 #endif | 320 #endif |
| OLD | NEW |