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 #include "GrDrawState.h" | 8 #include "GrDrawState.h" |
9 | 9 |
10 #include "GrOptDrawState.h" | 10 #include "GrOptDrawState.h" |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 } | 508 } |
509 | 509 |
510 //////////////////////////////////////////////////////////////////////////////// | 510 //////////////////////////////////////////////////////////////////////////////// |
511 | 511 |
512 void GrDrawState::AutoViewMatrixRestore::restore() { | 512 void GrDrawState::AutoViewMatrixRestore::restore() { |
513 if (fDrawState) { | 513 if (fDrawState) { |
514 SkDEBUGCODE(--fDrawState->fBlockEffectRemovalCnt;) | 514 SkDEBUGCODE(--fDrawState->fBlockEffectRemovalCnt;) |
515 fDrawState->fViewMatrix = fViewMatrix; | 515 fDrawState->fViewMatrix = fViewMatrix; |
516 SkASSERT(fDrawState->numColorStages() >= fNumColorStages); | 516 SkASSERT(fDrawState->numColorStages() >= fNumColorStages); |
517 int numCoverageStages = fSavedCoordChanges.count() - fNumColorStages; | 517 int numCoverageStages = fSavedCoordChanges.count() - fNumColorStages; |
| 518 numCoverageStages -= fHasGeometryProcessor ? 1 : 0; |
518 SkASSERT(fDrawState->numCoverageStages() >= numCoverageStages); | 519 SkASSERT(fDrawState->numCoverageStages() >= numCoverageStages); |
519 | 520 |
520 int i = 0; | 521 int i = 0; |
521 if (fHasGeometryProcessor) { | 522 if (fHasGeometryProcessor) { |
522 SkASSERT(fDrawState->hasGeometryProcessor()); | 523 SkASSERT(fDrawState->hasGeometryProcessor()); |
523 fDrawState->fGeometryProcessor->restoreCoordChange(fSavedCoordChange
s[i++]); | 524 fDrawState->fGeometryProcessor->restoreCoordChange(fSavedCoordChange
s[i++]); |
524 } | 525 } |
525 for (int s = 0; s < fNumColorStages; ++s, ++i) { | 526 for (int s = 0; s < fNumColorStages; ++s, ++i) { |
526 fDrawState->fColorStages[s].restoreCoordChange(fSavedCoordChanges[i]
); | 527 fDrawState->fColorStages[s].restoreCoordChange(fSavedCoordChanges[i]
); |
527 } | 528 } |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 } | 778 } |
778 | 779 |
779 // Since the shader will multiply coverage and color, the only way the f
inal A==1 is if | 780 // Since the shader will multiply coverage and color, the only way the f
inal A==1 is if |
780 // coverage and color both have A==1. | 781 // coverage and color both have A==1. |
781 return (inoutColor.isOpaque() && inoutCoverage.isOpaque()); | 782 return (inoutColor.isOpaque() && inoutCoverage.isOpaque()); |
782 } | 783 } |
783 | 784 |
784 return inoutColor.isOpaque(); | 785 return inoutColor.isOpaque(); |
785 } | 786 } |
786 | 787 |
OLD | NEW |