Commit 7886fe4f authored by Cory Quammen's avatar Cory Quammen

Re-enable some chart tests when OpenGL2 backend is available

The OpenGL2 backend does not define a vtkOpenGL2ContextDevice2D class,
so this test will not run when built with OpenGL2. Change it to run if
OpenGL2 is enabled as the OpenGL2 backend requires higher than OpenGL
version 2 OR if the OpenGL1 backend is enabled but Open GL version 2
is available.

Added alternate baseline for TestScalarsToColors output to
accommodate minor differences in OpenGL2 backend.
parent 8a8c0833
Pipeline #16753 passed with stage
......@@ -29,6 +29,7 @@
#include "vtkPiecewiseControlPointsItem.h"
#include "vtkPiecewiseFunction.h"
#include "vtkPiecewiseFunctionItem.h"
#include "vtkRenderingOpenGLConfigure.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderer.h"
......@@ -152,7 +153,14 @@ int TestMultipleScalarsToColors(int , char * [])
// OpenGL 1.2, but further granularity must be added to the device to detect
// down to there. For now disable is < OpenGL 2, should fix Mesa segfaults.
renwin->Render();
if (actor->GetContext()->GetDevice()->IsA("vtkOpenGL2ContextDevice2D"))
#if defined(VTK_OPENGL2)
bool openGL2Backend = true;
#else
bool openGL2Backend = false;
#endif
if (openGL2Backend || actor->GetContext()->GetDevice()->IsA("vtkOpenGL2ContextDevice2D"))
{
iren->Initialize();
iren->Start();
......
......@@ -24,6 +24,7 @@
#include "vtkLookupTable.h"
#include "vtkPiecewiseControlPointsItem.h"
#include "vtkPiecewiseFunction.h"
#include "vtkRenderingOpenGLConfigure.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderer.h"
......@@ -75,7 +76,14 @@ int TestScalarsToColors(int , char * [])
// Finally render the scene and compare the image to a reference image
view->GetRenderWindow()->SetMultiSamples(1);
if (view->GetContext()->GetDevice()->IsA("vtkOpenGL2ContextDevice2D"))
#if defined(VTK_OPENGL2)
bool openGL2Backend = true;
#else
bool openGL2Backend = false;
#endif
if (openGL2Backend || view->GetContext()->GetDevice()->IsA("vtkOpenGL2ContextDevice2D"))
{
view->GetInteractor()->Initialize();
view->GetInteractor()->Start();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment