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