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

Unified Diff: src/gpu/GrDrawTarget.cpp

Issue 423943003: Remove gpu support for willUseHWAALines. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Nits 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/GrDrawTarget.h ('k') | src/gpu/gl/GrGpuGL.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawTarget.cpp
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 72204fa14bfecbd81bff6619f709120e96ac4d3d..d44c6991b44eb15e4dee2e712bd2d625558d3de2 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -613,24 +613,16 @@ void GrDrawTarget::removeGpuTraceMarker(const GrGpuTraceMarker* marker) {
////////////////////////////////////////////////////////////////////////////////
-bool GrDrawTarget::willUseHWAALines() const {
- // There is a conflict between using smooth lines and our use of premultiplied alpha. Smooth
- // lines tweak the incoming alpha value but not in a premul-alpha way. So we only use them when
- // our alpha is 0xff and tweaking the color for partial coverage is OK
- if (!this->caps()->hwAALineSupport() ||
- !this->getDrawState().isHWAntialiasState()) {
- return false;
- }
- GrDrawState::BlendOptFlags opts = this->getDrawState().getBlendOpts();
- return (GrDrawState::kDisableBlend_BlendOptFlag & opts) &&
- (GrDrawState::kCoverageAsAlpha_BlendOptFlag & opts);
-}
-
bool GrDrawTarget::canApplyCoverage() const {
// we can correctly apply coverage if a) we have dual source blending
- // or b) one of our blend optimizations applies.
+ // or b) one of our blend optimizations applies
+ // or c) the src/dst coefficients are 1, 0 respectively.
+ GrBlendCoeff srcCoeff;
+ GrBlendCoeff dstCoeff;
return this->caps()->dualSourceBlendingSupport() ||
- GrDrawState::kNone_BlendOpt != this->getDrawState().getBlendOpts(true);
+ GrDrawState::kNone_BlendOpt != this->getDrawState().getBlendOpts(true, &srcCoeff,
+ &dstCoeff) ||
+ (kOne_GrBlendCoeff == srcCoeff && kZero_GrBlendCoeff == dstCoeff);
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | src/gpu/gl/GrGpuGL.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698