Mercurial > octave
changeset 21198:1adcdc518d9e
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.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 04 Feb 2016 18:12:00 -0500 |
parents | 9a5bb6996b16 |
children | dd6605e1eaea |
files | libinterp/corefcn/gl-render.cc libinterp/corefcn/gl-render.h libinterp/corefcn/gl2ps-renderer.cc libinterp/corefcn/gl2ps-renderer.h libinterp/dldfcn/__osmesa_print__.cc |
diffstat | 5 files changed, 15 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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);
--- 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
--- 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 ();
--- 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);