OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 GrGLShaderBuilder_DEFINED | 8 #ifndef GrGLShaderBuilder_DEFINED |
9 #define GrGLShaderBuilder_DEFINED | 9 #define GrGLShaderBuilder_DEFINED |
10 | 10 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 231 |
232 /** Returns the color of the destination pixel. This may be NULL if no effec
t advertised | 232 /** Returns the color of the destination pixel. This may be NULL if no effec
t advertised |
233 that it will read the destination. */ | 233 that it will read the destination. */ |
234 const char* dstColor(); | 234 const char* dstColor(); |
235 | 235 |
236 /** | 236 /** |
237 * Interfaces used by GrGLProgram. | 237 * Interfaces used by GrGLProgram. |
238 * TODO: These are used by GrGLProgram to insert a mode color filter. Remove
these when the | 238 * TODO: These are used by GrGLProgram to insert a mode color filter. Remove
these when the |
239 * color filter is expressed as a GrEffect. | 239 * color filter is expressed as a GrEffect. |
240 */ | 240 */ |
241 const SkString& getInputColor() const { return fInputColor; } | 241 const GrGLSLExpr<4>& getInputColor() const { return fInputColor; } |
242 GrSLConstantVec getKnownColorValue() const { return fKnownColorValue; } | 242 const GrGLSLExpr<4>& getInputCoverage() const { return fInputCoverage; } |
243 const SkString& getInputCoverage() const { return fInputCoverage; } | |
244 GrSLConstantVec getKnownCoverageValue() const { return fKnownCoverageValue;
} | |
245 | 243 |
246 /** | 244 /** |
247 * Adds code for effects. effectStages contains the effects to add. effectKe
ys[i] is the key | 245 * Adds code for effects. effectStages contains the effects to add. effectKe
ys[i] is the key |
248 * generated from effectStages[i]. An entry in effectStages can be NULL, in
which case it is | 246 * generated from effectStages[i]. An entry in effectStages can be NULL, in
which case it is |
249 * skipped. Moreover, if the corresponding key is GrGLEffect::NoEffectKey th
en it is skipped. | 247 * skipped. Moreover, if the corresponding key is GrGLEffect::NoEffectKey th
en it is skipped. |
250 * inOutFSColor specifies the input color to the first stage and is updated
to be the | 248 * inOutFSColor specifies the input color to the first stage and is updated
to be the |
251 * output color of the last stage. fsInOutColorKnownValue specifies whether
the input color | 249 * output color of the last stage. |
252 * has a known constant value and is updated to refer to the status of the o
utput color. | |
253 * The handles to texture samplers for effectStage[i] are added to effectSam
plerHandles[i]. The | 250 * The handles to texture samplers for effectStage[i] are added to effectSam
plerHandles[i]. The |
254 * glEffects array is updated to contain the GrGLEffect generated for each e
ntry in | 251 * glEffects array is updated to contain the GrGLEffect generated for each e
ntry in |
255 * effectStages. | 252 * effectStages. |
256 */ | 253 */ |
257 void emitEffects(const GrEffectStage* effectStages[], | 254 void emitEffects(const GrEffectStage* effectStages[], |
258 const GrBackendEffectFactory::EffectKey effectKeys[], | 255 const GrBackendEffectFactory::EffectKey effectKeys[], |
259 int effectCnt, | 256 int effectCnt, |
260 SkString* inOutFSColor, | 257 GrGLSLExpr<4>* inOutFSColor, |
261 GrSLConstantVec* fsInOutColorKnownValue, | |
262 SkTArray<GrGLUniformManager::UniformHandle, true>* effectSa
mplerHandles[], | 258 SkTArray<GrGLUniformManager::UniformHandle, true>* effectSa
mplerHandles[], |
263 GrGLEffect* glEffects[]); | 259 GrGLEffect* glEffects[]); |
264 | 260 |
265 const char* getColorOutputName() const; | 261 const char* getColorOutputName() const; |
266 const char* enableSecondaryOutput(); | 262 const char* enableSecondaryOutput(); |
267 | 263 |
268 GrGLUniformManager::UniformHandle getRTHeightUniform() const { return fRTHei
ghtUniform; } | 264 GrGLUniformManager::UniformHandle getRTHeightUniform() const { return fRTHei
ghtUniform; } |
269 GrGLUniformManager::UniformHandle getDstCopyTopLeftUniform() const { | 265 GrGLUniformManager::UniformHandle getDstCopyTopLeftUniform() const { |
270 return fDstCopyTopLeftUniform; | 266 return fDstCopyTopLeftUniform; |
271 } | 267 } |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 SkString fFSFunctions; | 465 SkString fFSFunctions; |
470 SkString fFSExtensions; | 466 SkString fFSExtensions; |
471 VarArray fFSInputs; | 467 VarArray fFSInputs; |
472 VarArray fFSOutputs; | 468 VarArray fFSOutputs; |
473 | 469 |
474 SkString fFSCode; | 470 SkString fFSCode; |
475 | 471 |
476 bool fSetupFragPosition; | 472 bool fSetupFragPosition; |
477 TextureSampler fDstCopySampler; | 473 TextureSampler fDstCopySampler; |
478 | 474 |
479 SkString fInputColor; | 475 GrGLSLExpr<4> fInputColor; |
480 GrSLConstantVec fKnownColorValue; | 476 GrGLSLExpr<4> fInputCoverage; |
481 SkString fInputCoverage; | |
482 GrSLConstantVec fKnownCoverageValue; | |
483 | 477 |
484 bool fHasCustomColorOutput; | 478 bool fHasCustomColorOutput; |
485 bool fHasSecondaryOutput; | 479 bool fHasSecondaryOutput; |
486 | 480 |
487 GrGLUniformManager::UniformHandle fRTHeightUniform; | 481 GrGLUniformManager::UniformHandle fRTHeightUniform; |
488 GrGLUniformManager::UniformHandle fDstCopyTopLeftUniform; | 482 GrGLUniformManager::UniformHandle fDstCopyTopLeftUniform; |
489 GrGLUniformManager::UniformHandle fDstCopyScaleUniform; | 483 GrGLUniformManager::UniformHandle fDstCopyScaleUniform; |
490 GrGLUniformManager::UniformHandle fColorUniform; | 484 GrGLUniformManager::UniformHandle fColorUniform; |
491 GrGLUniformManager::UniformHandle fCoverageUniform; | 485 GrGLUniformManager::UniformHandle fCoverageUniform; |
492 | 486 |
493 bool fTopLeftFragPosRead; | 487 bool fTopLeftFragPosRead; |
494 | 488 |
495 SkAutoTDelete<VertexBuilder> fVertexBuilder; | 489 SkAutoTDelete<VertexBuilder> fVertexBuilder; |
496 }; | 490 }; |
497 | 491 |
498 #endif | 492 #endif |
OLD | NEW |