Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(842)

Side by Side Diff: src/gpu/GrDrawState.cpp

Issue 638173003: Fix restore in AVMR to have correct coverage count. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698