aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawState.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-05-15 17:53:04 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-05-15 17:53:04 +0000
commit0c89db2929657f06ea7fac886e5f156ba1b37b7e (patch)
treeed6b6b4689f064f61d753989da550f300ff280f1 /src/gpu/GrDrawState.cpp
parentd09ab846789a33a969f9ea8428555270fe4de23e (diff)
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
Diffstat (limited to 'src/gpu/GrDrawState.cpp')
-rw-r--r--src/gpu/GrDrawState.cpp7
1 files changed, 7 insertions, 0 deletions
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;
}