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

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

Issue 715873002: Add isUnblended query to GrDrawState. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Nit Created 6 years, 1 month 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 | « src/gpu/GrDrawState.h ('k') | 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 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 } 735 }
736 736
737 // Since the shader will multiply coverage and color, the only way the f inal A==1 is if 737 // Since the shader will multiply coverage and color, the only way the f inal A==1 is if
738 // coverage and color both have A==1. 738 // coverage and color both have A==1.
739 return (inoutColor.isOpaque() && inoutCoverage.isOpaque()); 739 return (inoutColor.isOpaque() && inoutCoverage.isOpaque());
740 } 740 }
741 741
742 return inoutColor.isOpaque(); 742 return inoutColor.isOpaque();
743 } 743 }
744 744
745 bool GrDrawState::willBlendWithDst() const {
746 if (!this->hasSolidCoverage()) {
747 return true;
748 }
749
750 bool srcAIsOne = this->srcAlphaWillBeOne();
751 GrBlendCoeff srcCoeff = this->getSrcBlendCoeff();
752 GrBlendCoeff dstCoeff = this->getDstBlendCoeff();
753 if (kISA_GrBlendCoeff == dstCoeff && srcAIsOne) {
754 dstCoeff = kZero_GrBlendCoeff;
755 }
756 if (kOne_GrBlendCoeff != srcCoeff ||
757 kZero_GrBlendCoeff != dstCoeff ||
758 this->willEffectReadDstColor()) {
759 return true;
760 }
761
762 return false;
763 }
764
OLDNEW
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698