From d269240b44829442786ec5f2b09b643fd2e1e93b Mon Sep 17 00:00:00 2001
From: Sven Buijssen <sven.buijssen@tu-dortmund.de>
Date: Sun, 15 Aug 2010 11:46:13 +0200
Subject: [PATCH] BUG: Fix for bug 8857 - compile with VTK_USE_GLSL_SHADERS set to either ON or OFF

---
 ...estGenericVertexAttributesGLSLAlphaBlending.cxx |   29 +------------------
 .../Cxx/TestTranslucentLUTDepthPeelingPass.cxx     |   29 ++++++++++++++++++-
 2 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/Rendering/Testing/Cxx/TestGenericVertexAttributesGLSLAlphaBlending.cxx b/Rendering/Testing/Cxx/TestGenericVertexAttributesGLSLAlphaBlending.cxx
index 31f60e6..228bae5 100644
--- a/Rendering/Testing/Cxx/TestGenericVertexAttributesGLSLAlphaBlending.cxx
+++ b/Rendering/Testing/Cxx/TestGenericVertexAttributesGLSLAlphaBlending.cxx
@@ -32,34 +32,9 @@
 #include "vtkTestUtilities.h"
 #include "vtkRegressionTestImage.h"
 
-#include "vtkgl.h"
-
 // Make sure to have a valid OpenGL context current on the calling thread
-// before calling it.
-bool MesaHasVTKBug8135()
-{
-  // GL_VENDOR cannot be used because it can be "Brian Paul" or "Mesa project"
-  // GL_RENDERER cannot be used because it can be "Software Rasterizer" or
-  // "Mesa X11"
-  // GL_VERSION is more robust. It has things like "2.0 Mesa 7.0.4" or
-  // "2.1 Mesa 7.2" or "2.1 Mesa 7.3-devel"
-  
-  bool result=false;
-  const char *gl_version=
-    reinterpret_cast<const char *>(glGetString(GL_VERSION));
-  const char *mesa_version=strstr(gl_version,"Mesa");
-  
-  if(mesa_version!=0)
-    {
-    int mesa_major=0;
-    int mesa_minor=0;
-    if(sscanf(mesa_version,"Mesa %d.%d",&mesa_major, &mesa_minor)>=2)
-      {
-      result=mesa_major<7 || (mesa_major==7 && mesa_minor<3);
-      }
-    }
-  return result;
-}
+// before calling it. Defined in TestTranslucentLUTDepthPeelingPass.cxx.
+bool MesaHasVTKBug8135();
 
 int TestGenericVertexAttributesGLSLAlphaBlending(int argc, char *argv[])
 {
diff --git a/Rendering/Testing/Cxx/TestTranslucentLUTDepthPeelingPass.cxx b/Rendering/Testing/Cxx/TestTranslucentLUTDepthPeelingPass.cxx
index a528f2e..51693fc 100644
--- a/Rendering/Testing/Cxx/TestTranslucentLUTDepthPeelingPass.cxx
+++ b/Rendering/Testing/Cxx/TestTranslucentLUTDepthPeelingPass.cxx
@@ -46,9 +46,34 @@
 #include "vtkOverlayPass.h"
 #include "vtkRenderPassCollection.h"
 
+#include "vtkgl.h"
+
 // Make sure to have a valid OpenGL context current on the calling thread
-// before calling it. Defined in TestGenericVertexAttributesGLSLAlphaBlending.
-bool MesaHasVTKBug8135();
+// before calling it.
+bool MesaHasVTKBug8135()
+{
+  // GL_VENDOR cannot be used because it can be "Brian Paul" or "Mesa project"
+  // GL_RENDERER cannot be used because it can be "Software Rasterizer" or
+  // "Mesa X11"
+  // GL_VERSION is more robust. It has things like "2.0 Mesa 7.0.4" or
+  // "2.1 Mesa 7.2" or "2.1 Mesa 7.3-devel"
+
+  bool result=false;
+  const char *gl_version=
+    reinterpret_cast<const char *>(glGetString(GL_VERSION));
+  const char *mesa_version=strstr(gl_version,"Mesa");
+
+  if(mesa_version!=0)
+    {
+    int mesa_major=0;
+    int mesa_minor=0;
+    if(sscanf(mesa_version,"Mesa %d.%d",&mesa_major, &mesa_minor)>=2)
+      {
+      result=mesa_major<7 || (mesa_major==7 && mesa_minor<3);
+      }
+    }
+  return result;
+}
 
 int TestTranslucentLUTDepthPeelingPass(int argc, char* argv[])
 {
-- 
1.7.2.1

