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

Unified Diff: src/gpu/GrDrawState.cpp

Issue 430493003: Revert of Remove gpu support for willUseHWAALines. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawState.cpp
diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp
index 1b40642251e87219f321d6a3e6aeeb836db6e84c..02c7920f5d07c778870ae7ef972b733316c61c73 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;
}
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698