diff options
author | 2013-03-19 18:58:08 +0000 | |
---|---|---|
committer | 2013-03-19 18:58:08 +0000 | |
commit | 202d139452bed846a81cd89bbb3808ded0b3d64f (patch) | |
tree | f6d134a09d4cf5d4f490139fbd9f071158a83d67 | |
parent | 65eb4d5a210884cc92c43a8582cbd1ccbddcab57 (diff) |
Work around MSAA/lines issue on Linux bot.
Review URL: https://codereview.chromium.org/12938005
git-svn-id: http://skia.googlecode.com/svn/trunk@8239 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | src/gpu/gl/GrGpuGL.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index 33e3d6173b..8882934459 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -1934,6 +1934,15 @@ void GrGpuGL::flushStencil(DrawType type) { } void GrGpuGL::flushAAState(DrawType type) { +// At least some ATI linux drivers will render GL_LINES incorrectly when MSAA state is enabled but +// the target is not multisampled. Single pixel wide lines are rendered thicker than 1 pixel wide. +#if 0 + // Replace RT_HAS_MSAA with this definition once this driver bug is no longer a relevant concern + #define RT_HAS_MSAA rt->isMultisampled() +#else + #define RT_HAS_MSAA (rt->isMultisampled() || kDrawLines_DrawType == type) +#endif + const GrRenderTarget* rt = this->getDrawState().getRenderTarget(); if (kDesktop_GrGLBinding == this->glBinding()) { // ES doesn't support toggling GL_MULTISAMPLE and doesn't have @@ -1948,7 +1957,7 @@ void GrGpuGL::flushAAState(DrawType type) { GL_CALL(Enable(GR_GL_LINE_SMOOTH)); fHWAAState.fSmoothLineEnabled = kYes_TriState; // must disable msaa to use line smoothing - if (rt->isMultisampled() && + if (RT_HAS_MSAA && kNo_TriState != fHWAAState.fMSAAEnabled) { GL_CALL(Disable(GR_GL_MULTISAMPLE)); fHWAAState.fMSAAEnabled = kNo_TriState; @@ -1961,7 +1970,7 @@ void GrGpuGL::flushAAState(DrawType type) { } } } - if (!smoothLines && rt->isMultisampled()) { + if (!smoothLines && RT_HAS_MSAA) { // FIXME: GL_NV_pr doesn't seem to like MSAA disabled. The paths // convex hulls of each segment appear to get filled. bool enableMSAA = kStencilPath_DrawType == type || |