Add isUnblended query to GrDrawState.
BUG=skia:
Review URL: https://codereview.chromium.org/715873002
diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp
index dcf8d30..296893c 100644
--- a/src/gpu/GrDrawState.cpp
+++ b/src/gpu/GrDrawState.cpp
@@ -742,3 +742,23 @@
return inoutColor.isOpaque();
}
+bool GrDrawState::willBlendWithDst() const {
+ if (!this->hasSolidCoverage()) {
+ return true;
+ }
+
+ bool srcAIsOne = this->srcAlphaWillBeOne();
+ GrBlendCoeff srcCoeff = this->getSrcBlendCoeff();
+ GrBlendCoeff dstCoeff = this->getDstBlendCoeff();
+ if (kISA_GrBlendCoeff == dstCoeff && srcAIsOne) {
+ dstCoeff = kZero_GrBlendCoeff;
+ }
+ if (kOne_GrBlendCoeff != srcCoeff ||
+ kZero_GrBlendCoeff != dstCoeff ||
+ this->willEffectReadDstColor()) {
+ return true;
+ }
+
+ return false;
+}
+