Gpu blend optimizations, handle more xfer modes with fractional pixel coverage
Review URL: http://codereview.appspot.com/5237062/
git-svn-id: http://skia.googlecode.com/svn/trunk@2464 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrGpuGL.cpp b/gpu/src/GrGpuGL.cpp
index ffbb557..b27815b 100644
--- a/gpu/src/GrGpuGL.cpp
+++ b/gpu/src/GrGpuGL.cpp
@@ -1811,8 +1811,8 @@
}
}
-void GrGpuGL::flushBlend(GrPrimitiveType type,
- GrBlendCoeff srcCoeff,
+void GrGpuGL::flushBlend(GrPrimitiveType type,
+ GrBlendCoeff srcCoeff,
GrBlendCoeff dstCoeff) {
if (GrIsPrimTypeLines(type) && this->willUseHWAALines()) {
if (fHWBlendDisabled) {
@@ -1827,7 +1827,11 @@
fHWDrawState.fDstBlend = kISA_BlendCoeff;
}
} else {
- bool blendOff = canDisableBlend();
+ // any optimization to disable blending should
+ // have already been applied and tweaked the coeffs
+ // to (1, 0).
+ bool blendOff = kOne_BlendCoeff == srcCoeff &&
+ kZero_BlendCoeff == dstCoeff;
if (fHWBlendDisabled != blendOff) {
if (blendOff) {
GL_CALL(Disable(GR_GL_BLEND));