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 #ifndef GrDrawState_DEFINED | 8 #ifndef GrDrawState_DEFINED |
9 #define GrDrawState_DEFINED | 9 #define GrDrawState_DEFINED |
10 | 10 |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 * correct local coordinates. oldToNew gives the transformation from the old
coord system in | 500 * correct local coordinates. oldToNew gives the transformation from the old
coord system in |
501 * which the geometry was specified to the new coordinate system from which
it will be rendered. | 501 * which the geometry was specified to the new coordinate system from which
it will be rendered. |
502 */ | 502 */ |
503 void localCoordChange(const SkMatrix& oldToNew) { | 503 void localCoordChange(const SkMatrix& oldToNew) { |
504 for (int i = 0; i < kNumStages; ++i) { | 504 for (int i = 0; i < kNumStages; ++i) { |
505 if (this->isStageEnabled(i)) { | 505 if (this->isStageEnabled(i)) { |
506 fStages[i].localCoordChange(oldToNew); | 506 fStages[i].localCoordChange(oldToNew); |
507 } | 507 } |
508 } | 508 } |
509 } | 509 } |
| 510 |
| 511 /** |
| 512 * Checks whether any of the effects will read the dst pixel color. |
| 513 */ |
| 514 bool willEffectReadDst() const { |
| 515 for (int s = 0; s < kNumStages; ++s) { |
| 516 if (this->isStageEnabled(s) && (*this->getStage(s).getEffect())->wil
lReadDst()) { |
| 517 return true; |
| 518 } |
| 519 } |
| 520 return false; |
| 521 } |
510 | 522 |
511 /// @} | 523 /// @} |
512 | 524 |
513 /////////////////////////////////////////////////////////////////////////// | 525 /////////////////////////////////////////////////////////////////////////// |
514 /// @name Coverage / Color Stages | 526 /// @name Coverage / Color Stages |
515 //// | 527 //// |
516 | 528 |
517 /** | 529 /** |
518 * A common pattern is to compute a color with the initial stages and then | 530 * A common pattern is to compute a color with the initial stages and then |
519 * modulate that color by a coverage value in later stage(s) (AA, mask- | 531 * modulate that color by a coverage value in later stage(s) (AA, mask- |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1225 int fAttribIndices[kAttribIndexCount]; | 1237 int fAttribIndices[kAttribIndexCount]; |
1226 GrVertexAttribArray<kVertexAttribCnt> fVertexAttribs; | 1238 GrVertexAttribArray<kVertexAttribCnt> fVertexAttribs; |
1227 GrEffectStage fStages[kNumStages]; | 1239 GrEffectStage fStages[kNumStages]; |
1228 | 1240 |
1229 typedef GrRefCnt INHERITED; | 1241 typedef GrRefCnt INHERITED; |
1230 }; | 1242 }; |
1231 | 1243 |
1232 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); | 1244 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); |
1233 | 1245 |
1234 #endif | 1246 #endif |
OLD | NEW |