| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 * are added to the shaders. If the feature is not supported then false will
be returned. | 59 * are added to the shaders. If the feature is not supported then false will
be returned. |
| 60 */ | 60 */ |
| 61 bool enableFeature(GLSLFeature); | 61 bool enableFeature(GLSLFeature); |
| 62 | 62 |
| 63 /** | 63 /** |
| 64 * Called by GrGLEffects to add code the fragment shader. | 64 * Called by GrGLEffects to add code the fragment shader. |
| 65 */ | 65 */ |
| 66 void fsCodeAppendf(const char format[], ...) SK_PRINTF_LIKE(2, 3) { | 66 void fsCodeAppendf(const char format[], ...) SK_PRINTF_LIKE(2, 3) { |
| 67 va_list args; | 67 va_list args; |
| 68 va_start(args, format); | 68 va_start(args, format); |
| 69 fFSCode.appendf(format, args); | 69 fFSCode.appendVAList(format, args); |
| 70 va_end(args); | 70 va_end(args); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void fsCodeAppend(const char* str) { fFSCode.append(str); } | 73 void fsCodeAppend(const char* str) { fFSCode.append(str); } |
| 74 | 74 |
| 75 /** Appends a 2D texture sample with projection if necessary. coordType must
either be Vec2f or | 75 /** Appends a 2D texture sample with projection if necessary. coordType must
either be Vec2f or |
| 76 Vec3f. The latter is interpreted as projective texture coords. The vec l
ength and swizzle | 76 Vec3f. The latter is interpreted as projective texture coords. The vec l
ength and swizzle |
| 77 order of the result depends on the GrTextureAccess associated with the T
extureSampler. */ | 77 order of the result depends on the GrTextureAccess associated with the T
extureSampler. */ |
| 78 void appendTextureLookup(SkString* out, | 78 void appendTextureLookup(SkString* out, |
| 79 const TextureSampler&, | 79 const TextureSampler&, |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 class GrGLFullShaderBuilder : public GrGLShaderBuilder { | 349 class GrGLFullShaderBuilder : public GrGLShaderBuilder { |
| 350 public: | 350 public: |
| 351 GrGLFullShaderBuilder(GrGpuGL*, GrGLUniformManager&, const GrGLProgramDesc&)
; | 351 GrGLFullShaderBuilder(GrGpuGL*, GrGLUniformManager&, const GrGLProgramDesc&)
; |
| 352 | 352 |
| 353 /** | 353 /** |
| 354 * Called by GrGLEffects to add code to one of the shaders. | 354 * Called by GrGLEffects to add code to one of the shaders. |
| 355 */ | 355 */ |
| 356 void vsCodeAppendf(const char format[], ...) SK_PRINTF_LIKE(2, 3) { | 356 void vsCodeAppendf(const char format[], ...) SK_PRINTF_LIKE(2, 3) { |
| 357 va_list args; | 357 va_list args; |
| 358 va_start(args, format); | 358 va_start(args, format); |
| 359 fVSCode.appendf(format, args); | 359 fVSCode.appendVAList(format, args); |
| 360 va_end(args); | 360 va_end(args); |
| 361 } | 361 } |
| 362 | 362 |
| 363 void vsCodeAppend(const char* str) { fVSCode.append(str); } | 363 void vsCodeAppend(const char* str) { fVSCode.append(str); } |
| 364 | 364 |
| 365 /** Add a vertex attribute to the current program that is passed in from the
vertex data. | 365 /** Add a vertex attribute to the current program that is passed in from the
vertex data. |
| 366 Returns false if the attribute was already there, true otherwise. */ | 366 Returns false if the attribute was already there, true otherwise. */ |
| 367 bool addAttribute(GrSLType type, const char* name); | 367 bool addAttribute(GrSLType type, const char* name); |
| 368 | 368 |
| 369 /** Add a varying variable to the current program to pass values between vert
ex and fragment | 369 /** Add a varying variable to the current program to pass values between vert
ex and fragment |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 int effectCnt, | 447 int effectCnt, |
| 448 GrGLSLExpr4* inOutFSColor) SK_OVERRIDE; | 448 GrGLSLExpr4* inOutFSColor) SK_OVERRIDE; |
| 449 | 449 |
| 450 private: | 450 private: |
| 451 int fNumTexCoordSets; | 451 int fNumTexCoordSets; |
| 452 | 452 |
| 453 typedef GrGLShaderBuilder INHERITED; | 453 typedef GrGLShaderBuilder INHERITED; |
| 454 }; | 454 }; |
| 455 | 455 |
| 456 #endif | 456 #endif |
| OLD | NEW |