diff scripts/plot/util/private/__opengl_print__.m @ 30198:a87e5f9d5446

improve graphics toolkit rendering failure error message * __check_rendering_capability__.m: New function. * getframe.m, __opengl_print__.m: Use it. * scripts/plot/util/module.mk: Update.
author John W. Eaton <jwe@octave.org>
date Tue, 21 Sep 2021 12:30:32 -0400
parents 7854d5752dd2
children 1830a8f85476
line wrap: on
line diff
--- a/scripts/plot/util/private/__opengl_print__.m	Fri Sep 17 16:13:16 2021 -0400
+++ b/scripts/plot/util/private/__opengl_print__.m	Tue Sep 21 12:30:32 2021 -0400
@@ -195,18 +195,13 @@
       fprintf ("opengl-pipeline: '%s'\n", pipeline{n});
     endif
 
-    if (strcmp (get (opts.figure, "visible"), "on")
-        || (strcmp (get (opts.figure, "__graphics_toolkit__"), "qt")
-            && (strcmp (get (opts.figure, "__gl_window__"), "on")
-                || __have_feature__ ("QT_OFFSCREEN"))))
-      ## Use toolkits "print_figure" method
-      if (ispc () && ! isunix ())
-        drawnow (gl2ps_device{n}, ['| "' pipeline{n} '"']);
-      else
-        drawnow (gl2ps_device{n}, ["| " pipeline{n}]);
-      endif
+    __check_rendering_capability__ ("print", opts.figure);
+
+    ## Use toolkits "print_figure" method
+    if (ispc () && ! isunix ())
+      drawnow (gl2ps_device{n}, ['| "' pipeline{n} '"']);
     else
-      error ("print: figure must be visible or qt toolkit must be used with __gl_window__ property 'on' or QT_OFFSCREEN feature available");
+      drawnow (gl2ps_device{n}, ["| " pipeline{n}]);
     endif
   endfor