OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 GrGLFragmentShaderBuilder_DEFINED | 8 #ifndef GrGLFragmentShaderBuilder_DEFINED |
9 #define GrGLFragmentShaderBuilder_DEFINED | 9 #define GrGLFragmentShaderBuilder_DEFINED |
10 #include "GrGLShaderBuilder.h" | 10 #include "GrGLShaderBuilder.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 /** Returns a variable name that represents the position of the fragment in
the FS. The position | 58 /** Returns a variable name that represents the position of the fragment in
the FS. The position |
59 is in device space (e.g. 0,0 is the top left and pixel centers are at ha
lf-integers). */ | 59 is in device space (e.g. 0,0 is the top left and pixel centers are at ha
lf-integers). */ |
60 const char* fragmentPosition(); | 60 const char* fragmentPosition(); |
61 | 61 |
62 private: | 62 private: |
63 /* | 63 /* |
64 * An internal call for GrGLFullProgramBuilder to use to add varyings to the
vertex shader | 64 * An internal call for GrGLFullProgramBuilder to use to add varyings to the
vertex shader |
65 */ | 65 */ |
66 void addVarying(GrSLType type, | 66 void addVarying(GrSLType type, |
67 const char* name, | 67 const char* name, |
68 const char** fsInName); | 68 const char** fsInName, |
| 69 GrGLShaderVar::Precision fsPrecision = GrGLShaderVar::kDefaul
t_Precision); |
69 | 70 |
70 /* | 71 /* |
71 * Private functions used by GrGLProgramBuilder for compilation | 72 * Private functions used by GrGLProgramBuilder for compilation |
72 */ | 73 */ |
73 void bindProgramLocations(GrGLuint programId); | 74 void bindProgramLocations(GrGLuint programId); |
74 bool compileAndAttachShaders(GrGLuint programId, SkTDArray<GrGLuint>* shader
Ids) const; | 75 bool compileAndAttachShaders(GrGLuint programId, SkTDArray<GrGLuint>* shader
Ids) const; |
75 void emitCodeBeforeEffects(); | 76 void emitCodeBeforeEffects(); |
76 void emitCodeAfterEffects(const GrGLSLExpr4& inputColor, const GrGLSLExpr4&
inputCoverage); | 77 void emitCodeAfterEffects(const GrGLSLExpr4& inputColor, const GrGLSLExpr4&
inputCoverage); |
77 | 78 |
78 /** Enables using the secondary color output and returns the name of the var
in which it is | 79 /** Enables using the secondary color output and returns the name of the var
in which it is |
(...skipping 30 matching lines...) Expand all Loading... |
109 bool fSetupFragPosition; | 110 bool fSetupFragPosition; |
110 bool fTopLeftFragPosRead; | 111 bool fTopLeftFragPosRead; |
111 | 112 |
112 friend class GrGLProgramBuilder; | 113 friend class GrGLProgramBuilder; |
113 friend class GrGLFullProgramBuilder; | 114 friend class GrGLFullProgramBuilder; |
114 | 115 |
115 typedef GrGLShaderBuilder INHERITED; | 116 typedef GrGLShaderBuilder INHERITED; |
116 }; | 117 }; |
117 | 118 |
118 #endif | 119 #endif |
OLD | NEW |