Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: src/gpu/gl/GrGpuGL.cpp

Issue 12938005: Work around MSAA/lines issue on Linux bot. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGpuGL.cpp
===================================================================
--- src/gpu/gl/GrGpuGL.cpp (revision 8236)
+++ src/gpu/gl/GrGpuGL.cpp (working copy)
@@ -1934,6 +1934,14 @@
}
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.
robertphillips 2013/03/19 18:56:05 I think if we leave the #if 0 code we should have
bsalomon 2013/03/19 18:56:46 Will add a comment
+#if 0
+ #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 +1956,7 @@
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 +1969,7 @@
}
}
}
- 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 ||
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698