| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 GrGLProgramEffects_DEFINED | 8 #ifndef GrGLProgramEffects_DEFINED |
| 9 #define GrGLProgramEffects_DEFINED | 9 #define GrGLProgramEffects_DEFINED |
| 10 | 10 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 SkTArray<GrGLEffect*> fGLEffects; | 123 SkTArray<GrGLEffect*> fGLEffects; |
| 124 SkTArray<SkSTArray<4, Sampler, true> > fSamplers; | 124 SkTArray<SkSTArray<4, Sampler, true> > fSamplers; |
| 125 }; | 125 }; |
| 126 | 126 |
| 127 /** | 127 /** |
| 128 * This is an abstract base class for constructing different types of GrGLProgra
mEffects objects. | 128 * This is an abstract base class for constructing different types of GrGLProgra
mEffects objects. |
| 129 */ | 129 */ |
| 130 class GrGLProgramEffectsBuilder { | 130 class GrGLProgramEffectsBuilder { |
| 131 public: | 131 public: |
| 132 virtual ~GrGLProgramEffectsBuilder() { } |
| 133 |
| 132 /** | 134 /** |
| 133 * Emits the effect's shader code, and stores the necessary uniforms interna
lly. | 135 * Emits the effect's shader code, and stores the necessary uniforms interna
lly. |
| 134 */ | 136 */ |
| 135 virtual void emitEffect(const GrEffectStage&, | 137 virtual void emitEffect(const GrEffectStage&, |
| 136 GrGLProgramEffects::EffectKey, | 138 GrGLProgramEffects::EffectKey, |
| 137 const char* outColor, | 139 const char* outColor, |
| 138 const char* inColor, | 140 const char* inColor, |
| 139 int stageIndex) = 0; | 141 int stageIndex) = 0; |
| 140 }; | 142 }; |
| 141 | 143 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 206 |
| 205 typedef GrGLProgramEffects INHERITED; | 207 typedef GrGLProgramEffects INHERITED; |
| 206 }; | 208 }; |
| 207 | 209 |
| 208 /** | 210 /** |
| 209 * This class is used to construct a GrGLVertexProgramEffects* object. | 211 * This class is used to construct a GrGLVertexProgramEffects* object. |
| 210 */ | 212 */ |
| 211 class GrGLVertexProgramEffectsBuilder : public GrGLProgramEffectsBuilder { | 213 class GrGLVertexProgramEffectsBuilder : public GrGLProgramEffectsBuilder { |
| 212 public: | 214 public: |
| 213 GrGLVertexProgramEffectsBuilder(GrGLFullShaderBuilder*, int reserveCount); | 215 GrGLVertexProgramEffectsBuilder(GrGLFullShaderBuilder*, int reserveCount); |
| 216 virtual ~GrGLVertexProgramEffectsBuilder() { } |
| 214 | 217 |
| 215 virtual void emitEffect(const GrEffectStage&, | 218 virtual void emitEffect(const GrEffectStage&, |
| 216 GrGLProgramEffects::EffectKey, | 219 GrGLProgramEffects::EffectKey, |
| 217 const char* outColor, | 220 const char* outColor, |
| 218 const char* inColor, | 221 const char* inColor, |
| 219 int stageIndex) SK_OVERRIDE; | 222 int stageIndex) SK_OVERRIDE; |
| 220 | 223 |
| 221 /** | 224 /** |
| 222 * Finalizes the building process and returns the effect array. After this c
all, the builder | 225 * Finalizes the building process and returns the effect array. After this c
all, the builder |
| 223 * becomes invalid. | 226 * becomes invalid. |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 | 294 |
| 292 typedef GrGLProgramEffects INHERITED; | 295 typedef GrGLProgramEffects INHERITED; |
| 293 }; | 296 }; |
| 294 | 297 |
| 295 /** | 298 /** |
| 296 * This class is used to construct a GrGLTexGenProgramEffects* object. | 299 * This class is used to construct a GrGLTexGenProgramEffects* object. |
| 297 */ | 300 */ |
| 298 class GrGLTexGenProgramEffectsBuilder : public GrGLProgramEffectsBuilder { | 301 class GrGLTexGenProgramEffectsBuilder : public GrGLProgramEffectsBuilder { |
| 299 public: | 302 public: |
| 300 GrGLTexGenProgramEffectsBuilder(GrGLFragmentOnlyShaderBuilder*, int reserveC
ount); | 303 GrGLTexGenProgramEffectsBuilder(GrGLFragmentOnlyShaderBuilder*, int reserveC
ount); |
| 304 virtual ~GrGLTexGenProgramEffectsBuilder() { } |
| 301 | 305 |
| 302 virtual void emitEffect(const GrEffectStage&, | 306 virtual void emitEffect(const GrEffectStage&, |
| 303 GrGLProgramEffects::EffectKey, | 307 GrGLProgramEffects::EffectKey, |
| 304 const char* outColor, | 308 const char* outColor, |
| 305 const char* inColor, | 309 const char* inColor, |
| 306 int stageIndex) SK_OVERRIDE; | 310 int stageIndex) SK_OVERRIDE; |
| 307 | 311 |
| 308 /** | 312 /** |
| 309 * Finalizes the building process and returns the effect array. After this c
all, the builder | 313 * Finalizes the building process and returns the effect array. After this c
all, the builder |
| 310 * becomes invalid. | 314 * becomes invalid. |
| 311 */ | 315 */ |
| 312 GrGLProgramEffects* finish() { return fProgramEffects.detach(); } | 316 GrGLProgramEffects* finish() { return fProgramEffects.detach(); } |
| 313 | 317 |
| 314 private: | 318 private: |
| 315 GrGLFragmentOnlyShaderBuilder* fBuilder; | 319 GrGLFragmentOnlyShaderBuilder* fBuilder; |
| 316 SkAutoTDelete<GrGLTexGenProgramEffects> fProgramEffects; | 320 SkAutoTDelete<GrGLTexGenProgramEffects> fProgramEffects; |
| 317 | 321 |
| 318 typedef GrGLProgramEffectsBuilder INHERITED; | 322 typedef GrGLProgramEffectsBuilder INHERITED; |
| 319 }; | 323 }; |
| 320 | 324 |
| 321 #endif | 325 #endif |
| OLD | NEW |