octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #50750] OpenGL: Lines always appear above patc


From: Rik
Subject: [Octave-bug-tracker] [bug #50750] OpenGL: Lines always appear above patches for 2-D plots with zdata == []
Date: Fri, 21 Jul 2017 23:24:46 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0

Follow-up Comment #17, bug #50750 (project octave):

I tried the patch and it works, however it looks like there is a performance
penalty.  The function get_is2D is called from draw_axes which eventually
requires a recursive search through the graphic objects to find any 3-D
objects.  I inserted code to see how often draw_axes is called and it is quite
frequent.  Try this patch


diff -r 560758754c57 libinterp/corefcn/gl-render.cc
--- a/libinterp/corefcn/gl-render.cc    Thu Jul 20 22:59:27 2017 +0200
+++ b/libinterp/corefcn/gl-render.cc    Fri Jul 21 20:22:55 2017 -0700
@@ -2110,6 +2110,9 @@ namespace octave
 
     // For 2D axes with only 2D primitives, draw from back to front without 
     // depth sorting
+    static int num_calls = 0;
+    num_calls++;
+    std::cerr << "draw_axes: " << num_calls << std::endl;
     bool is2D = props.get_is2D (true);
     if (is2D)
       glDisable (GL_DEPTH_TEST);
diff -r 560758754c57 libinterp/corefcn/graphics.cc
--- a/libinterp/corefcn/graphics.cc     Thu Jul 20 22:59:27 2017 +0200
+++ b/libinterp/corefcn/graphics.cc     Fri Jul 21 20:22:55 2017 -0700
@@ -4572,6 +4572,10 @@ has_3D_primitive (const graphics_handle&
   if (! go.valid_object ())
     return retval;
 
+    static int num_calls = 0;
+    num_calls++;
+    std::cerr << "has_3D: " << num_calls << std::endl;
+
   if (go.isa ("figure") || go.isa ("axes") 
       || go.isa ("hggroup") || go.isa ("uipanel"))
     {


After re-compiling try some plot commands and try toggling the grid or panning
the plot.  There are ~2 has_3D_primitive calls for every draw_axes call.



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?50750>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]