From 0c89db2929657f06ea7fac886e5f156ba1b37b7e Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Wed, 15 May 2013 17:53:04 +0000 Subject: Disable blending when there is an effect that reads the dst and draw state blend is 1,0. R=robertphillips@google.com Review URL: https://codereview.chromium.org/15199008 git-svn-id: http://skia.googlecode.com/svn/trunk@9147 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/gpu/GrDrawState.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/gpu/GrDrawState.cpp') diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp index 591e157129..a3850b087e 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; } -- cgit v1.2.3