# HG changeset patch # User Pantxo Diribarne # Date 1520197260 -3600 # Node ID ae6679369a80fc73efe06c64bd4ff89b744232f4 # Parent fd3edb183ee202be6796ff7d05501e805919b37b Rely on QOffscreenSurface functionality rather than its presence (bug #53278) * acinclude.m4: Define HAVE_QT_OFFSCREEN if QOffscreenSurface is functional * getframe.m: rely on HAVE_QT_OFFSCREEN rather than HAVE_QOFFSCREENSURFACE * __opengl_print__.m: Ditto * GLCanvas.h/cc: Ditto diff -r fd3edb183ee2 -r ae6679369a80 libgui/graphics/GLCanvas.cc --- a/libgui/graphics/GLCanvas.cc Mon Mar 05 20:29:24 2018 +0100 +++ b/libgui/graphics/GLCanvas.cc Sun Mar 04 22:01:00 2018 +0100 @@ -283,7 +283,7 @@ if (! isValid ()) { -# if defined (HAVE_QOFFSCREENSURFACE) +# if defined (HAVE_QT_OFFSCREEN) static bool os_ctx_ok = true; if (os_ctx_ok && ! m_os_context.isValid ()) { diff -r fd3edb183ee2 -r ae6679369a80 libgui/graphics/GLCanvas.h --- a/libgui/graphics/GLCanvas.h Mon Mar 05 20:29:24 2018 +0100 +++ b/libgui/graphics/GLCanvas.h Sun Mar 04 22:01:00 2018 +0100 @@ -28,7 +28,7 @@ # define OCTAVE_QT_OPENGL_WIDGET QOpenGLWidget # include # define OCTAVE_QT_OPENGL_FBO QOpenGLFramebufferObject -# if defined (HAVE_QOFFSCREENSURFACE) +# if defined (HAVE_QT_OFFSCREEN) # include # include # endif @@ -80,7 +80,7 @@ bool begin_rendering (void); void end_rendering (void); -# if defined (HAVE_QOFFSCREENSURFACE) +# if defined (HAVE_QT_OFFSCREEN) QOpenGLContext m_os_context; QOffscreenSurface m_os_surface; # endif diff -r fd3edb183ee2 -r ae6679369a80 m4/acinclude.m4 --- a/m4/acinclude.m4 Mon Mar 05 20:29:24 2018 +0100 +++ b/m4/acinclude.m4 Sun Mar 04 22:01:00 2018 +0100 @@ -2016,8 +2016,11 @@ [warn_qt_opengl="Qt does not work with the OpenGL libs (GL and GLU); disabling OpenGL graphics with Qt GUI"]) if test $build_qt_graphics = yes; then + AC_DEFINE(HAVE_QT_GRAPHICS, 1, [Define to 1 if Qt works with OpenGL libs (GL and GLU)]) OCTAVE_CHECK_QT_OPENGL_OFFSCREEN_OK([have_qt_opengl_offscreen=yes]) - AC_DEFINE(HAVE_QT_GRAPHICS, 1, [Define to 1 if Qt works with OpenGL libs (GL and GLU)]) + if test $have_qt_opengl_offscreen = yes; then + AC_DEFINE(HAVE_QT_OFFSCREEN, 1, [Define to 1 if Qt handles offscreen OpenGL rendering]) + fi fi fi diff -r fd3edb183ee2 -r ae6679369a80 scripts/image/getframe.m --- a/scripts/image/getframe.m Mon Mar 05 20:29:24 2018 +0100 +++ b/scripts/image/getframe.m Sun Mar 04 22:01:00 2018 +0100 @@ -98,7 +98,7 @@ if (strcmp (get (hf, "visible"), "on") || (strcmp (get (hf, "__graphics_toolkit__"), "qt") && (strcmp (get (hf, "__gl_window__"), "on") - || __have_feature__ ("QOFFSCREENSURFACE")))) + || __have_feature__ ("QT_OFFSCREEN")))) cdata = __get_frame__ (hf); else ## Use OpenGL offscreen rendering with OSMesa for non-visible figures @@ -162,7 +162,7 @@ %! image (frame.cdata); %! title ("Lower left hand corner"); -%!testif HAVE_QOFFSCREENSURFACE +%!testif HAVE_QT_OFFSCREEN %! hf = figure ("visible", "off"); %! unwind_protect %! pos = get (hf, "position"); @@ -171,7 +171,7 @@ %! close (hf); %! end_unwind_protect -%!testif HAVE_QOFFSCREENSURFACE +%!testif HAVE_QT_OFFSCREEN %! hf = figure ("visible", "off"); %! unwind_protect %! hax = axes ("visible", "off", "position", [0 0 1 1]); diff -r fd3edb183ee2 -r ae6679369a80 scripts/plot/util/private/__opengl_print__.m --- a/scripts/plot/util/private/__opengl_print__.m Mon Mar 05 20:29:24 2018 +0100 +++ b/scripts/plot/util/private/__opengl_print__.m Sun Mar 04 22:01:00 2018 +0100 @@ -153,7 +153,7 @@ if (strcmp (get (opts.figure, "visible"), "on") || (strcmp (get (opts.figure, "__graphics_toolkit__"), "qt") && (strcmp (get (opts.figure, "__gl_window__"), "on") - || __have_feature__ ("QOFFSCREENSURFACE")))) + || __have_feature__ ("QT_OFFSCREEN")))) ## Use toolkits "print_figure" method drawnow (gl2ps_device{n}, ['|' pipeline{n}]); else