Correctly determine whether HW AA lines can be used
Review URL: http://codereview.appspot.com/4937049/
git-svn-id: http://skia.googlecode.com/svn/trunk@2162 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrGpuGL.cpp b/gpu/src/GrGpuGL.cpp
index ba7615d..936ada3 100644
--- a/gpu/src/GrGpuGL.cpp
+++ b/gpu/src/GrGpuGL.cpp
@@ -1813,18 +1813,6 @@
}
}
-bool GrGpuGL::useSmoothLines() {
- // 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.
-
- // TODO: write a smarter line frag shader.
-
- return (kAntialias_StateBit & fCurrDrawState.fFlagBits) &&
- canDisableBlend();
-}
-
void GrGpuGL::flushAAState(GrPrimitiveType type) {
if (kDesktop_GrGLBinding == this->glBinding()) {
// ES doesn't support toggling GL_MULTISAMPLE and doesn't have
@@ -1833,7 +1821,7 @@
// we prefer smooth lines over multisampled lines
// msaa should be disabled if drawing smooth lines.
if (GrIsPrimTypeLines(type)) {
- bool smooth = useSmoothLines();
+ bool smooth = this->willUseHWAALines();
if (!fHWAAState.fSmoothLineEnabled && smooth) {
GL_CALL(Enable(GR_GL_LINE_SMOOTH));
fHWAAState.fSmoothLineEnabled = true;
@@ -1863,7 +1851,7 @@
void GrGpuGL::flushBlend(GrPrimitiveType type,
GrBlendCoeff srcCoeff,
GrBlendCoeff dstCoeff) {
- if (GrIsPrimTypeLines(type) && useSmoothLines()) {
+ if (GrIsPrimTypeLines(type) && this->willUseHWAALines()) {
if (fHWBlendDisabled) {
GL_CALL(Enable(GR_GL_BLEND));
fHWBlendDisabled = false;