[Interest] opengl graphics system status in 4.8.x?

Simon St James kdedevel at etotheipiplusone.com
Mon Mar 18 21:07:34 CET 2013

Hi all, 

I am currently working on emscripten-qt 
(http://vps2.etotheipiplusone.com:30176/redmine/projects/emscripten-qt/wiki/Demos/), a project that uses Emscripten 
(https://github.com/kripken/emscripten/wiki) to compile Qt 4.8.x to Javascript 
and run in a browser using an HTML5 canvas for rendering.

Currently, performance is surprisingly good considering we are still using the 
"raster" graphics system where everything is plotted pixel by pixel by Qt and 
then flushed to the canvas after pixel format conversion.   However, we suspect 
that we can get significant gains in rendering speed by writing a Qt graphics 
system that uses HTML5 Canvas drawing primitives.

However however, it has been suggested that maybe using Qt's own "opengl" 
system would be an even more performant approach.  I started investigating 
this by running stock Qt apps with stock Qt packages (on Kubuntu 12.04, Intel 
HD Graphics card) with " -graphicssystem opengl", and every app I tried gave 
only a black window, except for some more visually complex which were mostly 
black with a few coloured rectangles scattered about   When I compiled Qt 
myself and tried with that, I noticed that using KDE's default "Oxygen" style 
with  -graphicssystem opengl actually triggered an assertion within Qt[1], and 
while forcing the style to "plastique" no longer triggered it, I still just 
had a black window.  Other OpenGL apps work fine.

So I was wondering whether using Qt's opengl graphics system is feasible? I 
heard it was "experimental" and "not pixel-perfect", but I've not heard any 
reports that that matched mine, which makes me wonder if I just got very 



#0  0xb7fdd424 in __kernel_vsyscall ()
#1  0xb62b91df in __GI_raise (sig=6) at 
#2  0xb62bc825 in __GI_abort () at abort.c:91
#3  0xb658ddf7 in qt_message_output (msgType=QtFatalMsg, buf=0x818b560 
"ASSERT: \"allWidgets\" in file /home/simon/tmp/DONTSYNC/qt-
normal/src/gui/kernel/qwidget.cpp, line 1284")
    at /home/simon/tmp/DONTSYNC/qt-normal/src/corelib/global/qglobal.cpp:2266
#4  0xb658df96 in qt_message (msgType=QtFatalMsg, msg=0xb674cc48 "ASSERT: 
\"%s\" in file %s, line %d", ap=0xbfffddf4 "\313\335R\267\210\334R\267\004\005")
    at /home/simon/tmp/DONTSYNC/qt-normal/src/corelib/global/qglobal.cpp:2312
#5  0xb658e3c2 in qFatal (msg=0xb674cc48 "ASSERT: \"%s\" in file %s, line %d") 
at /home/simon/tmp/DONTSYNC/qt-normal/src/corelib/global/qglobal.cpp:2495
#6  0xb658d9ae in qt_assert (assertion=0xb752ddcb "allWidgets", file=0xb752dc88 
"/home/simon/tmp/DONTSYNC/qt-normal/src/gui/kernel/qwidget.cpp", line=1284)
    at /home/simon/tmp/DONTSYNC/qt-normal/src/corelib/global/qglobal.cpp:2013
#7  0xb6da3c51 in QWidgetPrivate::init (this=0x8189a18, parentWidget=0x0, 
f=...) at /home/simon/tmp/DONTSYNC/qt-normal/src/gui/kernel/qwidget.cpp:1284
#8  0xb6da3738 in QWidget::QWidget (this=0x818b370, dd=..., parent=0x0, f=...) 
at /home/simon/tmp/DONTSYNC/qt-normal/src/gui/kernel/qwidget.cpp:1205
#9  0xb6e059fb in QDesktopWidget::QDesktopWidget (this=0x818b370) at 
#10 0xb6d5402d in QApplication::desktop () at /home/simon/tmp/DONTSYNC/qt-
#11 0xb36ca77e in QGLPixmapData::createPixmapForImage (this=0x818b290, 
image=..., flags=..., inPlace=false)
    at /home/simon/tmp/DONTSYNC/qt-normal/src/opengl/qpixmapdata_gl.cpp:476
#12 0xb36c9e74 in QGLPixmapData::fromImage (this=0x818b290, image=..., 
flags=...) at /home/simon/tmp/DONTSYNC/qt-
#13 0xb6e6182f in QPixmapData::copy (this=0x818b290, data=0x8188438, rect=...) 
at /home/simon/tmp/DONTSYNC/qt-normal/src/gui/image/qpixmapdata.cpp:156
#14 0xb36caa71 in QGLPixmapData::copy (this=0x818b290, data=0x8188438, 
rect=...) at /home/simon/tmp/DONTSYNC/qt-
#15 0xb6e5943f in QPixmap::copy (this=0xbfffe330, rect=...) at 
#16 0xb2fe7969 in Oxygen::TileSet::initPixmap(QVector<QPixmap>&, QPixmap 
const&, int, int, QRect const&) () from /usr/lib/liboxygenstyle.so.4
#17 0xb2fe7b2f in Oxygen::TileSet::TileSet(QPixmap const&, int, int, int, int, 
int, int, int, int, bool) () from /usr/lib/liboxygenstyle.so.4
#18 0xb2fe43b2 in Oxygen::ShadowCache::tileSet(Oxygen::ShadowCache::Key 
const&) () from /usr/lib/liboxygenstyle.so.4
#19 0xb30397b0 in ?? () from /usr/lib/kde4/plugins/styles/oxygen.so
#20 0xb304f65e in ?? () from /usr/lib/kde4/plugins/styles/oxygen.so
#21 0xb306ac30 in ?? () from /usr/lib/kde4/plugins/styles/oxygen.so
#22 0xb70d0eb0 in QStyleFactory::create (key=...) at 
#23 0xb6d4f318 in QApplication::style () at /home/simon/tmp/DONTSYNC/qt-
#24 0xb6ddef8e in qt_set_x11_resources (font=0x0, fg=0x0, bg=0x0, button=0x0) 
at /home/simon/tmp/DONTSYNC/qt-normal/src/gui/kernel/qapplication_x11.cpp:1290
#25 0xb6de48c3 in qt_init (priv=0x80b2158, display=0x0, visual=0, colormap=0) 
at /home/simon/tmp/DONTSYNC/qt-normal/src/gui/kernel/qapplication_x11.cpp:2401
#26 0xb6d4dd34 in QApplicationPrivate::construct (this=0x80b2158, dpy=0x0, 
visual=0, cmap=0) at /home/simon/tmp/DONTSYNC/qt-
#27 0xb6d4da8d in QApplication::QApplication (this=0xbffff08c, argc=@0xb6b3e1b0: 
1, argv=0x80a8130, GUIenabled=true, _internal=17041410)
    at /home/simon/tmp/DONTSYNC/qt-normal/src/gui/kernel/qapplication.cpp:772
#28 0xb7c58448 in KApplication::KApplication(bool) () from 
#29 0x08054947 in ?? ()
#30 0xb62a44d3 in __libc_start_main (main=0x8054300, argc=3, ubp_av=0xbffff214, 
init=0x807a2b0 <__libc_csu_init>, fini=0x807a320 <__libc_csu_fini>, 
    rtld_fini=0xb7fed270 <_dl_fini>, stack_end=0xbffff20c) at libc-start.c:226
#31 0x08055ad1 in _start ()

More information about the Interest mailing list