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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 typedef GrGLSLProgramDataManager::UniformHandle UniformHandle; | 101 typedef GrGLSLProgramDataManager::UniformHandle UniformHandle; |
102 typedef GrGLProgramDataManager::UniformInfoArray UniformInfoArray; | 102 typedef GrGLProgramDataManager::UniformInfoArray UniformInfoArray; |
103 typedef GrGLProgramDataManager::VaryingInfoArray VaryingInfoArray; | 103 typedef GrGLProgramDataManager::VaryingInfoArray VaryingInfoArray; |
104 | 104 |
105 GrGLProgram(GrGLGpu*, | 105 GrGLProgram(GrGLGpu*, |
106 const GrProgramDesc&, | 106 const GrProgramDesc&, |
107 const BuiltinUniformHandles&, | 107 const BuiltinUniformHandles&, |
108 GrGLuint programID, | 108 GrGLuint programID, |
109 const UniformInfoArray&, | 109 const UniformInfoArray&, |
110 const VaryingInfoArray&, // used for NVPR only currently | 110 const VaryingInfoArray&, // used for NVPR only currently |
111 GrGLInstalledGeoProc* geometryProcessor, | 111 GrGLSLPrimitiveProcessor* geometryProcessor, |
112 GrGLInstalledXferProc* xferProcessor, | 112 GrGLSLXferProcessor* xferProcessor, |
113 GrGLInstalledFragProcs* fragmentProcessors, | 113 const GrGLSLFragProcs& fragmentProcessors, |
114 SkTArray<UniformHandle>* passSamplerUniforms); | 114 SkTArray<UniformHandle>* passSamplerUniforms); |
115 | 115 |
116 // A templated helper to loop over effects, set the transforms(via subclass)
and bind textures | 116 // A templated helper to loop over effects, set the transforms(via subclass)
and bind textures |
117 void setFragmentData(const GrPrimitiveProcessor&, const GrPipeline&, | 117 void setFragmentData(const GrPrimitiveProcessor&, const GrPipeline&, |
118 SkTArray<const GrTextureAccess*>* textureBindings); | 118 SkTArray<const GrTextureAccess*>* textureBindings); |
119 void setTransformData(const GrPrimitiveProcessor&, | 119 void setTransformData(const GrPrimitiveProcessor&, |
120 const GrFragmentProcessor&, | 120 const GrFragmentProcessor&, |
121 int index, | 121 int index); |
122 GrGLInstalledFragProc*); | |
123 | 122 |
124 // Helper for setData() that sets the view matrix and loads the render targe
t height uniform | 123 // Helper for setData() that sets the view matrix and loads the render targe
t height uniform |
125 void setRenderTargetState(const GrPrimitiveProcessor&, const GrPipeline&); | 124 void setRenderTargetState(const GrPrimitiveProcessor&, const GrPipeline&); |
126 | 125 |
127 // these reflect the current values of uniforms (GL uniform values travel wi
th program) | 126 // these reflect the current values of uniforms (GL uniform values travel wi
th program) |
128 RenderTargetState fRenderTargetState; | 127 RenderTargetState fRenderTargetState; |
129 BuiltinUniformHandles fBuiltinUniformHandles; | 128 BuiltinUniformHandles fBuiltinUniformHandles; |
130 GrGLuint fProgramID; | 129 GrGLuint fProgramID; |
131 | 130 |
132 // the installed effects | 131 // the installed effects |
133 SkAutoTDelete<GrGLInstalledGeoProc> fGeometryProcessor; | 132 SkAutoTDelete<GrGLSLPrimitiveProcessor> fGeometryProcessor; |
134 SkAutoTDelete<GrGLInstalledXferProc> fXferProcessor; | 133 SkAutoTDelete<GrGLSLXferProcessor> fXferProcessor; |
135 SkAutoTUnref<GrGLInstalledFragProcs> fFragmentProcessors; | 134 GrGLSLFragProcs fFragmentProcessors; |
136 | 135 |
137 GrProgramDesc fDesc; | 136 GrProgramDesc fDesc; |
138 GrGLGpu* fGpu; | 137 GrGLGpu* fGpu; |
139 GrGLProgramDataManager fProgramDataManager; | 138 GrGLProgramDataManager fProgramDataManager; |
140 SkTArray<UniformHandle> fSamplerUniforms; | 139 SkTArray<UniformHandle> fSamplerUniforms; |
141 | 140 |
142 friend class GrGLProgramBuilder; | 141 friend class GrGLProgramBuilder; |
143 | 142 |
144 typedef SkRefCnt INHERITED; | 143 typedef SkRefCnt INHERITED; |
145 }; | 144 }; |
146 | 145 |
147 #endif | 146 #endif |
OLD | NEW |