[Development] iMX6 EGLGS 2D (QtWidgets) painting acceleration

Uwe Rathmann Uwe.Rathmann at tigertal.de
Tue Sep 4 14:31:26 CEST 2018


On Tue, 04 Sep 2018 14:38:47 +0300, Denis Shienkov wrote:

> How I can do it for Qt4?  Do you mean, I need to specify an appropriate
> '-platform' option before starting of my application on Qt4?

https://doc.qt.io/archives/qt-4.8/qapplication.html#setGraphicsSystem

You can even run opengl as backend for all widgets this way, what might 
be an option for non X11 platforms. I should pay more attention to this 
option for future Qwt releases.

The vertical lines of the rubberbands are clipped away because of the 1 
pixel left shift of the OpenGL paint engine, but the ticks of the axes 
and the grid lines of the canvas are correctly aligned - in opposite to 
the Qt5/QOpenGLWidget combination.

But please allow me to repeat the hint about trying the 
QwtPlotCanvas::OpenGLBuffer option. It introduces some overhead, but at 
least avoids doing the rasterization of the vector data with the CPU. It 
works with Qt5 ( even with EGLFS ) without having to fiddle around with 
QOpenGLWidget.

All you need to do is to add one line to your code:

    plot->canvas()->setPaintAttribute( QwtPlotCanvas::OpenGLBuffer );

Uwe

PS: this starts to become too offtopic for this list




More information about the Development mailing list