PDA

View Full Version : QwtPlotGLCanvas for QwtPolar



john_k
11th November 2014, 18:01
I was looking at the refreshtest example in Qt 5 with qwt-6.1.0 installed an I noticed that with 1 000 000 points the performance doubled when OpenGL was turned on, so I was wondering if there is an equivalent to the QwtPlotGLCanvas for the QwtPolarCanvas?

Thanks

Uwe
14th November 2014, 09:42
I noticed that with 1 000 000 points the performance doubled when OpenGL was turned on, so I was wondering if there is an equivalent to the QwtPlotGLCanvas for the QwtPolarCanvas?

No - even if at least something loke the QwtPlotCanvas::OpenGLBuffer mode should be easy to be implemented.
But in most cases reducing what needs to be painted is much more efficient than what you can achieve with hardware accelerated graphics.

Uwe

john_k
14th November 2014, 16:47
True but when you have a graphics card in Qt 5 it would be nice to use it.


I thought the OpenGLBuffer mode and the QwtPlotGLCanvas were two different animals.

\brief Render the canvas via an OpenGL buffer

In OpenGL mode the plot scene will be rendered to a temporary
OpenGL buffer ( pixel buffer with Qt4, frame buffer object for Qt >= 5 ),
that will be translated to a QImage afterwards.
Then this image will be painted to the canvas.

This mode might be useful for "heavy" plots on platforms to achieve
hardware acceleration on platforms, where the raster paint engine
( = software renderer ) ould be used otherwise.
But the penalty of copying out the image makes this mode less optimal for
"normal" plots.

On a hardware accelerated graphics system ( f.e. Qt4/X11 "native" )
using this mode does not make much sense. Unfortunately those systems have
been removed from Qt5.

\note Using QwtPlotGLCanvas is an hardware accelerated alternative without
suffering from the extra roundtrip of the rendered image. But this
type of canvas does not have a backing store, that helps to avoid
replots in combination with of overlay widgets ( f.e the
rubberband of a zoomer ).

\note The OpenGLBuffer mode has no effect, when "QwtOpenGL" has been disabled in
qwtconfig.pri.

\sa QwtPlotGLCanvas
*/

Uwe
14th November 2014, 16:56
I thought the OpenGLBuffer mode and the QwtPlotGLCanvas were two different animals.
Exactly - that's why one of them would be easier to be implemented for the polar plot package than the other one.

Uwe