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 GrGLSLFragmentShaderBuilder_DEFINED | 8 #ifndef GrGLSLFragmentShaderBuilder_DEFINED |
9 #define GrGLSLFragmentShaderBuilder_DEFINED | 9 #define GrGLSLFragmentShaderBuilder_DEFINED |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 , fHasSecondaryOutput(false) { | 26 , fHasSecondaryOutput(false) { |
27 fSubstageIndices.push_back(0); | 27 fSubstageIndices.push_back(0); |
28 } | 28 } |
29 virtual ~GrGLSLFragmentBuilder() {} | 29 virtual ~GrGLSLFragmentBuilder() {} |
30 /** | 30 /** |
31 * Use of these features may require a GLSL extension to be enabled. Shaders
may not compile | 31 * Use of these features may require a GLSL extension to be enabled. Shaders
may not compile |
32 * if code is added that uses one of these features without calling enableFe
ature() | 32 * if code is added that uses one of these features without calling enableFe
ature() |
33 */ | 33 */ |
34 enum GLSLFeature { | 34 enum GLSLFeature { |
35 kStandardDerivatives_GLSLFeature = 0, | 35 kStandardDerivatives_GLSLFeature = 0, |
36 kLastGLSLFeature = kStandardDerivatives_GLSLFeature | 36 kPixelLocalStorage_GLSLFeature = 1, |
| 37 kLastGLSLFeature = kPixelLocalStorage_GLSLFeature |
37 }; | 38 }; |
38 | 39 |
39 /** | 40 /** |
40 * If the feature is supported then true is returned and any necessary #exte
nsion declarations | 41 * If the feature is supported then true is returned and any necessary #exte
nsion declarations |
41 * are added to the shaders. If the feature is not supported then false will
be returned. | 42 * are added to the shaders. If the feature is not supported then false will
be returned. |
42 */ | 43 */ |
43 virtual bool enableFeature(GLSLFeature) = 0; | 44 virtual bool enableFeature(GLSLFeature) = 0; |
44 | 45 |
45 /** | 46 /** |
46 * This returns a variable name to access the 2D, perspective correct versio
n of the coords in | 47 * This returns a variable name to access the 2D, perspective correct versio
n of the coords in |
(...skipping 12 matching lines...) Expand all Loading... |
59 * on a child proc. | 60 * on a child proc. |
60 */ | 61 */ |
61 void onBeforeChildProcEmitCode(); | 62 void onBeforeChildProcEmitCode(); |
62 void onAfterChildProcEmitCode(); | 63 void onAfterChildProcEmitCode(); |
63 | 64 |
64 const SkString& getMangleString() const { return fMangleString; } | 65 const SkString& getMangleString() const { return fMangleString; } |
65 | 66 |
66 bool hasCustomColorOutput() const { return fHasCustomColorOutput; } | 67 bool hasCustomColorOutput() const { return fHasCustomColorOutput; } |
67 bool hasSecondaryOutput() const { return fHasSecondaryOutput; } | 68 bool hasSecondaryOutput() const { return fHasSecondaryOutput; } |
68 | 69 |
| 70 void declAppendf(const char* fmt, ...); |
| 71 |
69 protected: | 72 protected: |
70 bool fHasCustomColorOutput; | 73 bool fHasCustomColorOutput; |
71 bool fHasSecondaryOutput; | 74 bool fHasSecondaryOutput; |
72 | 75 |
73 private: | 76 private: |
74 /* | 77 /* |
75 * State that tracks which child proc in the proc tree is currently emitting
code. This is | 78 * State that tracks which child proc in the proc tree is currently emitting
code. This is |
76 * used to update the fMangleString, which is used to mangle the names of un
iforms and functions | 79 * used to update the fMangleString, which is used to mangle the names of un
iforms and functions |
77 * emitted by the proc. fSubstageIndices is a stack: its count indicates ho
w many levels deep | 80 * emitted by the proc. fSubstageIndices is a stack: its count indicates ho
w many levels deep |
78 * we are in the tree, and its second-to-last value is the index of the chil
d proc at that | 81 * we are in the tree, and its second-to-last value is the index of the chil
d proc at that |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 bool fHasReadDstColor; | 197 bool fHasReadDstColor; |
195 bool fHasReadFragmentPosition; | 198 bool fHasReadFragmentPosition; |
196 | 199 |
197 friend class GrGLSLProgramBuilder; | 200 friend class GrGLSLProgramBuilder; |
198 friend class GrGLProgramBuilder; | 201 friend class GrGLProgramBuilder; |
199 | 202 |
200 typedef GrGLSLXPFragmentBuilder INHERITED; | 203 typedef GrGLSLXPFragmentBuilder INHERITED; |
201 }; | 204 }; |
202 | 205 |
203 #endif | 206 #endif |
OLD | NEW |