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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 1, // kMat44f_GrSLType | 54 1, // kMat44f_GrSLType |
55 1, // kSampler2D_GrSLType | 55 1, // kSampler2D_GrSLType |
56 }; | 56 }; |
57 GR_STATIC_ASSERT(kGrSLTypeCount == GR_ARRAY_COUNT(kVecLengths)); | 57 GR_STATIC_ASSERT(kGrSLTypeCount == GR_ARRAY_COUNT(kVecLengths)); |
58 return kVecLengths[type]; | 58 return kVecLengths[type]; |
59 } | 59 } |
60 | 60 |
61 static inline const char* GrGLSLOnesVecf(int count) { | 61 static inline const char* GrGLSLOnesVecf(int count) { |
62 static const char* kONESVEC[] = {"ERROR", "1.0", "vec2(1,1)", | 62 static const char* kONESVEC[] = {"ERROR", "1.0", "vec2(1,1)", |
63 "vec3(1,1,1)", "vec4(1,1,1,1)"}; | 63 "vec3(1,1,1)", "vec4(1,1,1,1)"}; |
64 GrAssert(count >= 1 && count < (int)GR_ARRAY_COUNT(kONESVEC)); | 64 SkASSERT(count >= 1 && count < (int)GR_ARRAY_COUNT(kONESVEC)); |
65 return kONESVEC[count]; | 65 return kONESVEC[count]; |
66 } | 66 } |
67 | 67 |
68 static inline const char* GrGLSLZerosVecf(int count) { | 68 static inline const char* GrGLSLZerosVecf(int count) { |
69 static const char* kZEROSVEC[] = {"ERROR", "0.0", "vec2(0,0)", | 69 static const char* kZEROSVEC[] = {"ERROR", "0.0", "vec2(0,0)", |
70 "vec3(0,0,0)", "vec4(0,0,0,0)"}; | 70 "vec3(0,0,0)", "vec4(0,0,0,0)"}; |
71 GrAssert(count >= 1 && count < (int)GR_ARRAY_COUNT(kZEROSVEC)); | 71 SkASSERT(count >= 1 && count < (int)GR_ARRAY_COUNT(kZEROSVEC)); |
72 return kZEROSVEC[count]; | 72 return kZEROSVEC[count]; |
73 } | 73 } |
74 } | 74 } |
75 | 75 |
76 /** | 76 /** |
77 * Gets the most recent GLSL Generation compatible with the OpenGL context. | 77 * Gets the most recent GLSL Generation compatible with the OpenGL context. |
78 */ | 78 */ |
79 GrGLSLGeneration GrGetGLSLGeneration(GrGLBinding binding, | 79 GrGLSLGeneration GrGetGLSLGeneration(GrGLBinding binding, |
80 const GrGLInterface* gl); | 80 const GrGLInterface* gl); |
81 | 81 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 */ | 223 */ |
224 GrSLConstantVec GrGLSLGetComponent4f(SkString* outAppend, | 224 GrSLConstantVec GrGLSLGetComponent4f(SkString* outAppend, |
225 const char* expr, | 225 const char* expr, |
226 GrColorComponentFlags component, | 226 GrColorComponentFlags component, |
227 GrSLConstantVec defaultExpr = kNone_GrSLCon
stantVec, | 227 GrSLConstantVec defaultExpr = kNone_GrSLCon
stantVec, |
228 bool omitIfConst = false); | 228 bool omitIfConst = false); |
229 | 229 |
230 #include "GrGLSL_impl.h" | 230 #include "GrGLSL_impl.h" |
231 | 231 |
232 #endif | 232 #endif |
OLD | NEW |