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 | 8 |
9 #ifndef GrGLProgram_DEFINED | 9 #ifndef GrGLProgram_DEFINED |
10 #define GrGLProgram_DEFINED | 10 #define GrGLProgram_DEFINED |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 GrProgramDesc fDesc; | 145 GrProgramDesc fDesc; |
146 GrGLGpu* fGpu; | 146 GrGLGpu* fGpu; |
147 GrGLProgramDataManager fProgramDataManager; | 147 GrGLProgramDataManager fProgramDataManager; |
148 SkTArray<UniformHandle> fSamplerUniforms; | 148 SkTArray<UniformHandle> fSamplerUniforms; |
149 | 149 |
150 friend class GrGLProgramBuilder; | 150 friend class GrGLProgramBuilder; |
151 | 151 |
152 typedef SkRefCnt INHERITED; | 152 typedef SkRefCnt INHERITED; |
153 }; | 153 }; |
154 | 154 |
155 /* | |
156 * Below are slight specializations of the program object for the different type
s of programs | |
157 * The default GrGL programs consist of at the very least a vertex and fragment
shader. | |
158 * Legacy Nvpr only has a fragment shader, 1.3+ Nvpr ignores the vertex shader,
but both require | |
159 * specialized methods for setting transform data. Both types of NVPR also requi
re setting the | |
160 * projection matrix through a special function call | |
161 */ | |
162 class GrGLNvprProgram : public GrGLProgram { | |
163 protected: | |
164 GrGLNvprProgram(GrGLGpu*, | |
165 const GrProgramDesc&, | |
166 const BuiltinUniformHandles&, | |
167 GrGLuint programID, | |
168 const UniformInfoArray&, | |
169 GrGLInstalledGeoProc*, | |
170 GrGLInstalledXferProc* xferProcessor, | |
171 GrGLInstalledFragProcs* fragmentProcessors, | |
172 SkTArray<UniformHandle>* passSamplerUniforms); | |
173 | |
174 private: | |
175 void didSetData() override; | |
176 virtual void setTransformData(const GrPrimitiveProcessor&, | |
177 const GrPendingFragmentStage&, | |
178 int index, | |
179 GrGLInstalledFragProc*) override; | |
180 virtual void onSetRenderTargetState(const GrPrimitiveProcessor&, const GrPip
eline&); | |
181 | |
182 friend class GrGLNvprProgramBuilder; | |
183 | |
184 typedef GrGLProgram INHERITED; | |
185 }; | |
186 | |
187 #endif | 155 #endif |
OLD | NEW |