firas
27th March 2008, 22:09
greetings trollers,
Abstract
I have problem with QGLWidget and its Event loop or related (QEventDispatcherGlib::processEvents).
Introduction
I am sub-classing QGLWidget (class ImgFrame) and use that class (ImgFrame) to paint a QImage. The problem is: although I use separate thread object for manipulating a temporary image prior to copying it to the image of ImgFrame, the main thread uses a lot of CPU time for dispatching internal events not related to my code.
As a proof of this issue I sub-classed ImgFrame from QWidget instead and the processing speed became 50 folds faster.
Why Use QGLWidget?
Well, Intend to use this application mainly for real-time multi-threaded video processing and when painting in 30 frames per sec, drawing on QGLWidget has better performane than QWidget (see the 2dpainting example that comes with QT4.3)
Attachments
I attached the source code (Kdevelop project) and Valgrind performance analysis snapshot for further clearance.
thank you,
firas
Abstract
I have problem with QGLWidget and its Event loop or related (QEventDispatcherGlib::processEvents).
Introduction
I am sub-classing QGLWidget (class ImgFrame) and use that class (ImgFrame) to paint a QImage. The problem is: although I use separate thread object for manipulating a temporary image prior to copying it to the image of ImgFrame, the main thread uses a lot of CPU time for dispatching internal events not related to my code.
As a proof of this issue I sub-classed ImgFrame from QWidget instead and the processing speed became 50 folds faster.
Why Use QGLWidget?
Well, Intend to use this application mainly for real-time multi-threaded video processing and when painting in 30 frames per sec, drawing on QGLWidget has better performane than QWidget (see the 2dpainting example that comes with QT4.3)
Attachments
I attached the source code (Kdevelop project) and Valgrind performance analysis snapshot for further clearance.
thank you,
firas