[Development] QT_XCB_NATIVE_PAINTING makes worse that without of it
Allan Sandfeld Jensen
kde at carewolf.com
Sun Mar 24 10:41:23 CET 2019
On Sonntag, 24. März 2019 10:07:06 CET Denis Shienkov wrote:
> Allan,
>
> so, do we need in OpenGL support for 2-d acceleration in QtWidget
> applications running via X11? When, e.g. we use QPainter?
>
> I'm already confused... What we need to have to be use the GPU
> acceleration on X11 with QtWidgets?
>
There are currently three ways.
1) Use the old scene-graph and set a QOpenGLWidget as the view of a
QGraphicsView.
2) Create a QOpenGLFrameBufferObject and a QOpenGLPaintDevice, and paint
inside that for offscreen accelerated OpenGL painting inside a QPainter.
3) Use a QOpenGLWindow as the root window
In the widgets/painting examples you can find a pattern that uses the
QOpenGLFrameBufferObject and blitting to have an otherwise rasterized
application switch to opengl acceleration. Though the pattern is still a bit
too Qt4'ish even after I tried cleaning it up last year.
Note though that the recommended way of doing hardware accelerated painting
these days with Qt, is using QML or the QtQuick scenegraph from C++. QPainter
being so sequential and imperative will never be able to take full advantage
of OpenGL because the API wasn't designed for it.
'Allan
More information about the Development
mailing list