# HG changeset patch # User John W. Eaton # Date 1454627520 18000 # Node ID 1adcdc518d9e339c5061c7867aae21fd80d83c5b # Parent 9a5bb6996b164da0cf2db5a0c472e330fdb6edac provide wrapper for glFinish in opengl_renderer class * gl-render.h, gl-render.cc (opengl_renderer::finish): New function. * gl2ps-renderer.h, gl2ps-renderer.cc, __osmesa_print__.cc: Use it instead of calling glFinish directly. diff -r 9a5bb6996b16 -r 1adcdc518d9e libinterp/corefcn/gl-render.cc --- a/libinterp/corefcn/gl-render.cc Thu Feb 04 17:13:12 2016 -0500 +++ b/libinterp/corefcn/gl-render.cc Thu Feb 04 18:12:00 2016 -0500 @@ -828,6 +828,12 @@ } void +opengl_renderer::finish (void) +{ + glFinish (); +} + +void opengl_renderer::setup_opengl_transformation (const axes::properties& props) { // setup OpenGL transformation diff -r 9a5bb6996b16 -r 1adcdc518d9e libinterp/corefcn/gl-render.h --- a/libinterp/corefcn/gl-render.h Thu Feb 04 17:13:12 2016 -0500 +++ b/libinterp/corefcn/gl-render.h Thu Feb 04 18:12:00 2016 -0500 @@ -63,6 +63,8 @@ virtual void set_viewport (int w, int h); virtual graphics_xform get_transform (void) const { return xform; } + virtual void finish (void); + protected: virtual void draw_figure (const figure::properties& props); virtual void draw_axes (const axes::properties& props); diff -r 9a5bb6996b16 -r 1adcdc518d9e libinterp/corefcn/gl2ps-renderer.cc --- a/libinterp/corefcn/gl2ps-renderer.cc Thu Feb 04 17:13:12 2016 -0500 +++ b/libinterp/corefcn/gl2ps-renderer.cc Thu Feb 04 18:12:00 2016 -0500 @@ -690,7 +690,7 @@ rend.draw (fig, ""); // Make sure buffered commands are finished!!! - glFinish (); + rend.finish (); #else diff -r 9a5bb6996b16 -r 1adcdc518d9e libinterp/corefcn/gl2ps-renderer.h --- a/libinterp/corefcn/gl2ps-renderer.h Thu Feb 04 17:13:12 2016 -0500 +++ b/libinterp/corefcn/gl2ps-renderer.h Thu Feb 04 18:12:00 2016 -0500 @@ -58,10 +58,10 @@ glGetIntegerv (GL_VIEWPORT, vp); gl2psBeginViewport (vp); - // Draw and glFinish () or there may primitives missing in the + // Draw and finish () or there may primitives missing in the // gl2ps output. opengl_renderer::draw_axes (props); - glFinish (); + finish (); // Finalize viewport GLint state = gl2psEndViewport (); diff -r 9a5bb6996b16 -r 1adcdc518d9e libinterp/dldfcn/__osmesa_print__.cc --- a/libinterp/dldfcn/__osmesa_print__.cc Thu Feb 04 17:13:12 2016 -0500 +++ b/libinterp/dldfcn/__osmesa_print__.cc Thu Feb 04 18:12:00 2016 -0500 @@ -160,10 +160,11 @@ { // return RGB image opengl_renderer rend; + + // Draw and finish () or there may primitives missing in the + // output. rend.draw (fobj); - - // Make sure buffered commands are finished!!! - glFinish (); + rend.finish (); dim_vector dv (4, Width, Height);