bugGNU Octave - Bugs: bug #44416, Qt toolkit OpenGL could possibly...


bug #44416: Qt toolkit OpenGL could possibly have separate painter thread

Submitter:  Dan Sebald <sebald>
Submitted:  Tue 03 Mar 2015 08:58:10 PM UTC
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Wed 04 Mar 2015 01:33:45 AM UTC, comment #2: 

It could, yes.  I mean, I assumed that FLTK is a separate process based upon the dramatic difference in performance, but maybe it is just that Qt is doing something very slow unnecessarily.  I noticed that the GL_MAX_TEXTURE_SIZE kept appearing with redrawing, no less size changes.  If Qt is doing something like re-initializing OpenGL hardware with each refresh, it might have the capacity to run faster. Plus there is that Qt behavior where when printing, the window image on the screen becomes shredded momentarily; the image eventually comes back but the plot window shouldn't do that.

Dan Sebald <sebald>
Tue 03 Mar 2015 10:41:39 PM UTC, comment #1: 

Maybe this should become a bug about Qt performance in general.  For bug #44415 I made a patch that happens to print to stderr whenever the OpenGL context is intialized.  I'm attaching it to this bug report as well.

When a window is moved in Qt it seems that the entire plot is re-initialized every time.  This is incredibly wasteful as dragging a window will cause re-initializations every 10 pixels or so.

I don't see this behavior with FLTK, so it is something about when the Qt toolkit decides that the Canvas needs a refresh.

(file #33239)

Rik <rik5>
Group administrator
Tue 03 Mar 2015 08:58:10 PM UTC, original submission:  

I've noticed that Qt toolkit has OpenGL operating in main thread, as the general rule is that GUI must run in the main thread.  However, the consequence of that is that if large amounts of data are being displayed in a plot, e.g.,

image(32*rand(20, 5000))

that the refresh in that plot window takes a great deal of CPU resources from the rest of the GUI so that the main window is in graphics limbo when that plot may be redrawing.  (Try dragging the main window around on top of the figure and watch.)

The gnuplot toolkit doesn't do this because it is outboard.  The FLTK toolkit, although also using OpenGL, doesn't either.  The GUI main window remains usable regardless of the activity in the plot window.

I'm noting here that Qt developers have recently added a few exceptions to "must be in main thread rule", and that it may be possible to put QPainter in its own thread with Qt 4.8 and greater:


As I understand, that should fix this screen-refresh issue for Qt graphics toolkit.

Dan Sebald <sebald>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #33239:  max_texture_size.diff added by rik5 (532B - application/x-download)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by sebald (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.


    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-03-03 rik5 Attached File- Added max_texture_size.diff, #33239

    Back to the top

    Powered by Savane 3.13-a0c1.
    Corresponding source code