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

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

Issue 718103003: Relax constraints on src coeff in GrDrawState::willBlendWithDst. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « 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 "GrBlend.h"
10 #include "GrInvariantOutput.h" 11 #include "GrInvariantOutput.h"
11 #include "GrOptDrawState.h" 12 #include "GrOptDrawState.h"
12 #include "GrPaint.h" 13 #include "GrPaint.h"
13 14
14 //////////////////////////////////////////////////////////////////////////////s 15 //////////////////////////////////////////////////////////////////////////////s
15 16
16 bool GrDrawState::isEqual(const GrDrawState& that) const { 17 bool GrDrawState::isEqual(const GrDrawState& that) const {
17 bool usingVertexColors = this->hasColorVertexAttribute(); 18 bool usingVertexColors = this->hasColorVertexAttribute();
18 if (!usingVertexColors && this->fColor != that.fColor) { 19 if (!usingVertexColors && this->fColor != that.fColor) {
19 return false; 20 return false;
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 } 743 }
743 744
744 return inoutColor.isOpaque(); 745 return inoutColor.isOpaque();
745 } 746 }
746 747
747 bool GrDrawState::willBlendWithDst() const { 748 bool GrDrawState::willBlendWithDst() const {
748 if (!this->hasSolidCoverage()) { 749 if (!this->hasSolidCoverage()) {
749 return true; 750 return true;
750 } 751 }
751 752
752 bool srcAIsOne = this->srcAlphaWillBeOne(); 753 if (this->willEffectReadDstColor()) {
753 GrBlendCoeff srcCoeff = this->getSrcBlendCoeff();
754 GrBlendCoeff dstCoeff = this->getDstBlendCoeff();
755 if (kISA_GrBlendCoeff == dstCoeff && srcAIsOne) {
756 dstCoeff = kZero_GrBlendCoeff;
757 }
758 if (kOne_GrBlendCoeff != srcCoeff ||
759 kZero_GrBlendCoeff != dstCoeff ||
760 this->willEffectReadDstColor()) {
761 return true; 754 return true;
762 } 755 }
763 756
757 if (GrBlendCoeffRefsDst(this->getSrcBlendCoeff())) {
758 return true;
759 }
760
761 GrBlendCoeff dstCoeff = this->getDstBlendCoeff();
762 if (!(kZero_GrBlendCoeff == dstCoeff ||
763 (kISA_GrBlendCoeff == dstCoeff && this->srcAlphaWillBeOne()))) {
764 return true;
765 }
766
764 return false; 767 return false;
765 } 768 }
766 769
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