Revert of Remove gpu support for willUseHWAALines. (https://codereview.chromium.org/423943003/)
Reason for revert:
Breaking windows 7 compare gm's
Original issue's description:
> Remove gpu support for willUseHWAALines.
>
> By removing willUseHWAALines, we also no long reference the blend opt flag kDisableBlend so it has been removed
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/e6dfba868c19b00562f8c733b9bf37dd4ec9e68c
R=bsalomon@google.com
TBR=bsalomon@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Author: egdaniel@google.com
Review URL: https://codereview.chromium.org/430493003
diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp
index 1b40642..02c7920 100644
--- a/src/gpu/GrDrawState.cpp
+++ b/src/gpu/GrDrawState.cpp
@@ -339,7 +339,8 @@
// (0,1). The same applies when coverage is known to be 0.
if ((kZero_GrBlendCoeff == *srcCoeff && dstCoeffIsOne) || covIsZero) {
if (this->getStencil().doesWrite()) {
- return kEmitCoverage_BlendOptFlag;
+ return kDisableBlend_BlendOptFlag |
+ kEmitCoverage_BlendOptFlag;
} else {
return kSkipDraw_BlendOptFlag;
}
@@ -358,14 +359,13 @@
if (kOne_GrBlendCoeff == *srcCoeff) {
// if there is no coverage and coeffs are (1,0) then we
// won't need to read the dst at all, it gets replaced by src
- *dstCoeff = kZero_GrBlendCoeff;
- return kNone_BlendOpt;
+ return kDisableBlend_BlendOptFlag;
} else if (kZero_GrBlendCoeff == *srcCoeff) {
// if the op is "clear" then we don't need to emit a color
// or blend, just write transparent black into the dst.
*srcCoeff = kOne_GrBlendCoeff;
*dstCoeff = kZero_GrBlendCoeff;
- return kEmitTransBlack_BlendOptFlag;
+ return kDisableBlend_BlendOptFlag | kEmitTransBlack_BlendOptFlag;
}
}
} else if (this->isCoverageDrawing()) {
@@ -399,7 +399,13 @@
return kCoverageAsAlpha_BlendOptFlag;
}
}
-
+ if (kOne_GrBlendCoeff == *srcCoeff &&
+ kZero_GrBlendCoeff == *dstCoeff &&
+ this->willEffectReadDstColor()) {
+ // In this case the shader will fully resolve the color, coverage, and dst and we don't
+ // need blending.
+ return kDisableBlend_BlendOptFlag;
+ }
return kNone_BlendOpt;
}