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

Unified Diff: src/gpu/GrDrawState.cpp

Issue 15199008: Disable blending when there is an effect that reads the dst and draw state blend is 1,0. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 7 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 | « no previous file | src/gpu/gl/GrGLProgramDesc.cpp » ('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 591e157129af4aa7846cda18bf949ec4f8e04861..a3850b087e7abcabbdcc45ce65c07124a29bc3c2 100644
--- a/src/gpu/GrDrawState.cpp
+++ b/src/gpu/GrDrawState.cpp
@@ -371,6 +371,13 @@ GrDrawState::BlendOptFlags GrDrawState::getBlendOpts(bool forceCoverage,
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 | « no previous file | src/gpu/gl/GrGLProgramDesc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698