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 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 /** Returns a key for adding code to read the copy-of-dst color in service
of effects that | 75 /** Returns a key for adding code to read the copy-of-dst color in service
of effects that |
76 require reading the dst. It must not return 0 because 0 indicates that t
here is no dst | 76 require reading the dst. It must not return 0 because 0 indicates that t
here is no dst |
77 copy read at all (in which case this function should not be called). */ | 77 copy read at all (in which case this function should not be called). */ |
78 static DstReadKey KeyForDstRead(const GrTexture* dstCopy, const GrGLCaps&); | 78 static DstReadKey KeyForDstRead(const GrTexture* dstCopy, const GrGLCaps&); |
79 | 79 |
80 /** Returns a key for reading the fragment location. This should only be cal
led if there is an | 80 /** Returns a key for reading the fragment location. This should only be cal
led if there is an |
81 effect that will requires the fragment position. If the fragment position
is not required, | 81 effect that will requires the fragment position. If the fragment position
is not required, |
82 the key is 0. */ | 82 the key is 0. */ |
83 static FragPosKey KeyForFragmentPosition(const GrRenderTarget* dst, const Gr
GLCaps&); | 83 static FragPosKey KeyForFragmentPosition(const GrRenderTarget* dst, const Gr
GLCaps&); |
84 | 84 |
85 GrGLFragmentShaderBuilder(GrGLProgramBuilder* program, const GrGLProgramDesc
& desc); | 85 GrGLFragmentShaderBuilder(GrGLProgramBuilder* program, uint8_t fragPosKey); |
86 | 86 |
87 // true public interface, defined explicitly in the abstract interfaces abov
e | 87 // true public interface, defined explicitly in the abstract interfaces abov
e |
88 virtual bool enableFeature(GLSLFeature) SK_OVERRIDE; | 88 virtual bool enableFeature(GLSLFeature) SK_OVERRIDE; |
89 virtual SkString ensureFSCoords2D(const GrGLProcessor::TransformedCoordsArra
y& coords, | 89 virtual SkString ensureFSCoords2D(const GrGLProcessor::TransformedCoordsArra
y& coords, |
90 int index) SK_OVERRIDE; | 90 int index) SK_OVERRIDE; |
91 virtual const char* fragmentPosition() SK_OVERRIDE; | 91 virtual const char* fragmentPosition() SK_OVERRIDE; |
92 virtual const char* dstColor() SK_OVERRIDE; | 92 virtual const char* dstColor() SK_OVERRIDE; |
93 | 93 |
94 // Private public interface, used by GrGLProgramBuilder to build a fragment
shader | 94 // Private public interface, used by GrGLProgramBuilder to build a fragment
shader |
95 void emitCodeToReadDstTexture(); | 95 void emitCodeToReadDstTexture(); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 bool fHasReadDstColor; | 156 bool fHasReadDstColor; |
157 bool fHasReadFragmentPosition; | 157 bool fHasReadFragmentPosition; |
158 | 158 |
159 friend class GrGLNvprProgramBuilder; | 159 friend class GrGLNvprProgramBuilder; |
160 friend class GrGLProgramBuilder; | 160 friend class GrGLProgramBuilder; |
161 | 161 |
162 typedef GrGLFPFragmentBuilder INHERITED; | 162 typedef GrGLFPFragmentBuilder INHERITED; |
163 }; | 163 }; |
164 | 164 |
165 #endif | 165 #endif |
OLD | NEW |