aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2014-11-13 06:19:25 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-11-13 06:19:25 -0800
commitb1cff03325c42bb1cd87204d9b0dd3d6b9678d3e (patch)
tree6ffc643fcd3c16c265c5e3c26d0d509f4a630d6a /src
parentec2d28554ad6c2817306715511136a514c928979 (diff)
Relax constraints on src coeff in GrDrawState::willBlendWithDst.
Allow the srcCoeff to be anything as long as it does not reference the dst. Previous version required srcCoeff to be one. BUG=skia: Review URL: https://codereview.chromium.org/718103003
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrDrawState.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp
index 23ebea6afc..513c3bf9e9 100644
--- a/src/gpu/GrDrawState.cpp
+++ b/src/gpu/GrDrawState.cpp
@@ -7,6 +7,7 @@
#include "GrDrawState.h"
+#include "GrBlend.h"
#include "GrInvariantOutput.h"
#include "GrOptDrawState.h"
#include "GrPaint.h"
@@ -749,15 +750,17 @@ bool GrDrawState::willBlendWithDst() const {
return true;
}
- bool srcAIsOne = this->srcAlphaWillBeOne();
- GrBlendCoeff srcCoeff = this->getSrcBlendCoeff();
- GrBlendCoeff dstCoeff = this->getDstBlendCoeff();
- if (kISA_GrBlendCoeff == dstCoeff && srcAIsOne) {
- dstCoeff = kZero_GrBlendCoeff;
+ if (this->willEffectReadDstColor()) {
+ return true;
+ }
+
+ if (GrBlendCoeffRefsDst(this->getSrcBlendCoeff())) {
+ return true;
}
- if (kOne_GrBlendCoeff != srcCoeff ||
- kZero_GrBlendCoeff != dstCoeff ||
- this->willEffectReadDstColor()) {
+
+ GrBlendCoeff dstCoeff = this->getDstBlendCoeff();
+ if (!(kZero_GrBlendCoeff == dstCoeff ||
+ (kISA_GrBlendCoeff == dstCoeff && this->srcAlphaWillBeOne()))) {
return true;
}