summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qglxintegration.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make GLX and EGL dynamic dependencies for xcbJørgen Lind2014-12-201-723/+0
| | | | | | | | | | | | [ChangeLog][QPA][Xcb] GLX and EGL code paths are now dynamically resolved, making it possible for one build of a plugin to use both code paths. Default is to use the GLX code path if available. This can be overwritten by specifying QT_XCB_GL_INTEGRATION=xcb_egl as an evnironment variable. Enable qt.xcb.glintegration.debug to get debug log output of what integration is used Change-Id: Ia9fa95fcca3d901b91dadb8c98a695fea0ae3b1e Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-09-231-24/+37
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The isAlwaysAskOption was removed in 38621713150b663355ebeb799a5a50d8e39a3c38 so manually removed code in src/plugins/bearer/connman/qconnmanengine.cpp Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qcollator_macx.cpp src/corelib/tools/qstring.cpp src/gui/kernel/qwindow.cpp src/gui/kernel/qwindow_p.h src/gui/text/qtextengine.cpp src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h src/plugins/platforms/android/qandroidinputcontext.cpp src/plugins/platforms/xcb/qglxintegration.cpp src/plugins/platforms/xcb/qglxintegration.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp src/testlib/qtestlog.cpp src/widgets/dialogs/qfiledialog.cpp src/widgets/kernel/qwindowcontainer.cpp tests/auto/corelib/tools/qcollator/tst_qcollator.cpp tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp Change-Id: Ic5d4187f682257a17509f6cd28d2836c6cfe2fc8
| * QGLXContext survives screen removalShawn Rutledge2014-08-281-25/+36
| | | | | | | | | | | | | | | | | | The screen pointer is usually only used to get the Display, which normally doesn't change anyway. Task-number: QTBUG-39996 Change-Id: Ie35f02fc9330647897a9f081afb8c9ce550eed2a Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Prevent current context from becoming inconsistent upon create()Laszlo Agocs2014-09-011-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Platform plugins have a tendency to make the newly created native context current with a temporary surface. This is usually needed to query some information related to the new context. Afterwards most of them just reset to having nothing current. This has two issues: It unexpectedly changes the current context/surface. A call into QOpenGLContext::create() does not imply that the current context will get changed. This is the minor issue and we could probably live with it (at least if it had been documented). However, the real issue is that QOpenGLContext::currentContext() will become inconsistent: it will still report whatever was current before the create() even though on the EGL/WGL/GLX level that's not the case anymore. To prevent all this confusion the platform plugins can easily be changed to restore whatever context/surface was current before they altered it. Change-Id: I6a5b4597c86571327524ddb13e0d02538593cc7b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | GLX: request up to OpenGL 4.5 / ES 3.1 by defaultGiuseppe D'Angelo2014-08-151-4/+4
| | | | | | | | | | Change-Id: I55fd53a8f7f81708a103e24e35c09894b939f245 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Avoid calling syncWindow with already destroyed platform windowsLaszlo Agocs2014-08-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Issuing a metacall from swapBuffers is dangerous since the window may get destroyed by the time the slot is invoked. This patch changes it to use an event, which is more efficient anyway, that can be invalidated in case the QXcbWindow is destroy()'ed before the event is delivered. Change-Id: I44618ac1cb8b221aecce001ea39702164dcab6a5 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com> Reviewed-by: Uli Schlachter <psychon@znc.in>
* | Add support for querying "glxconfig" from native interfaceAndras Becsi2014-07-071-0/+4
| | | | | | | | | | | | | | | | | | This makes it possible to retrieve the GLXFBConfig used by Qt to create the GLXContext. QtWebEngine on desktop needs this so that Chromium can use the same config as Qt to eliminate BadMatch errors. Change-Id: If18c0937b5af3e457ddbfda035e5d652230211c6 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devJ-P Nurmi2014-06-051-0/+9
|\| | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qt.prf src/plugins/platforms/xcb/qxcbwindow.h src/tools/qdoc/qdocindexfiles.cpp src/widgets/kernel/qwidget_qpa.cpp Change-Id: I214f57b03bc2ff86cf3b7dfe2966168af93a5a67
| * Improve the implementation of the _NET_WM_SYNC_REQUEST protocolMartin Gräßlin2014-05-271-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change improves the synced resizes of xcb windows and adds support for synced resizes of glx windows. The QXcbWindow keeps a better track on whether the window manager expects a sync and can be in one of three states: * no sync required * sync required, but configure notify event not yet received * sync required and configured By tracking this in the QXcbWindow itself the backing store can make use of this information and doesn't need an own heuristic to decide whether a sync is needed. Also this allows to add support for synced resizes of windows with an OpenGLSurface. This is accomplished by checking the sync state after swapping buffers. As the OpenGL context may be bound to a background thread the sync is done using a QueuedConnection to ensure that the sync happens in the thread which created the xcb window. So far this is only added for GLX. This significantly improves the resize experience of QQuickWindow and also the initial mapping with a composited window manager in case the compositor uses the sync protocol to determine whether the window is ready to get painted on screen. Change-Id: Ied0261873043d785dec652d2821fc3638292fa36 Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* | Dummy window for creating GLX context should be override redirectMartin Gräßlin2014-05-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without having the dummy window being override redirect Qt might confuse window managers. Window managers might react on the create notify event, but there is no reason to do anything with the window as it is most likely already destroyed at the time the window manager receives the create notify event. By marking the window as override redirect we indicate to the window manager that they can ignore it. Change-Id: I35259436da4548f4190b92de412fb0de1d2e8077 Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-05-131-1/+1
|\| | | | | | | | | | | | | Manually changed enum to LibGL in src/plugins/platforms/xcb/qglxintegration.cpp Change-Id: If34ee6cce3d1d51fb4bb1fdfa59c30389ea0d207
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-05-061-4/+24
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/qnx-x86-qcc/qplatformdefs.h src/corelib/global/qglobal.h src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/qgl.cpp src/opengl/qglpixelbuffer.cpp src/opengl/qglshaderprogram.cpp tests/auto/opengl/qglthreads/tst_qglthreads.cpp Change-Id: Iaba137884d3526a139000ca26fee02bb27b5cdb5
| * Disable threaded rendering if Mesa is usedUlf Hermann2014-04-141-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | Mesa and xcb show some bad interaction which leads to frequent crashed on multithreaded access. Also, the selective approach to blacklisting only specific chipsets isn't feasible, given the resources available. The client glx vendor string is used to identify mesa instead of the server GL vendor and/or renderer string as that is much more reliable. Task-number: QTBUG-38221 Change-Id: I2d8c037aa4fd9c38eb9537452a5e7e62f72a081d Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Add public and QPA APIs for adapting existing OpenGL contextsLaszlo Agocs2014-04-241-16/+141
|/ | | | | | | | | | | | | For now only xcb on GLX is supported. Other platforms will follow later. Add also some missing documentation for the platform OpenGL context factory functions. [ChangeLog] QOpenGLContext is now able to adopt existing native contexts. Task-number: QTBUG-37552 Change-Id: I5dd959f102df178f646b2df5989203b5dc6de376 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Fix deprecated setOption() usage in GLX integrationLaszlo Agocs2014-03-141-2/+2
| | | | | | | | The correct function is setOptions(). Change-Id: Ife9ff75c409c843b4871804fcfd06b9d2a7733d3 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Use None instead of GLX_NONEAlbert Astals Cid2014-03-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | GLX_NONE is not 0, so it doesn't work as end-of-list marker The documentation explicitly mentions to use None or NULL Fixes valgrind warning ==22686== Conditional jump or move depends on uninitialised value(s) ==22686== at 0x78949AF: glXCreatePbuffer (glx_pbuffer.c:709) ==22686== by 0xDD7F0E1: QGLXPbuffer::QGLXPbuffer(QOffscreenSurface*) (qglxintegration.cpp:515) ==22686== by 0xDD624B0: QXcbIntegration::createPlatformOffscreenSurface(QOffscreenSurface*) const (qxcbintegration.cpp:259) ==22686== by 0x4F1D6A2: QOffscreenSurface::create() (in /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.2.1) ==22686== by 0xDD80248: QGLXContext::queryDummyContext() (qglxintegration.cpp:454) ==22686== by 0xDD803F0: QGLXContext::supportsThreading() (qglxintegration.cpp:488) ==22686== by 0x5BD9927: QSGRenderLoop::instance() (in /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5.2.1) ==22686== by 0x5BF969E: QQuickWindowPrivate::init(QQuickWindow*) (in /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5.2.1) ==22686== by 0x5C97BFC: QQuickView::QQuickView(QWindow*) (in /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5.2.1) ==22686== by 0x40636F: startShell(int, char const**, void*) (main.cpp:91) ==22686== by 0x407125: main (main.cpp:193) Change-Id: Ib4f5ae50f7e31d3fbeb5acf67753e1d8b9e434b0 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Fix potential null pointer access in qglxKai Koehne2014-02-241-10/+12
| | | | | | | | | | | This reportedly does fix crashes when running a Qt Quick 2 application over remote X. Task-number: QTCREATORBUG-11207 Change-Id: I6fa82420f9d12e56e52fa8efd263bf18d868d7d8 Reviewed-by: Ville Nummela <ville.nummela@parker.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Enabling QQuickWidget and QOpenGLWidgetPaul Olav Tvete2014-02-121-1/+1
| | | | | | | | | Enable child widgets (without a native window) that render to an FBO and are composed with the raster backingstore by the platform plugin. A preliminary version of QOpenGLWidget is included as private API. Change-Id: I8f984a4d7db285069ce3d6564707942c823d890d Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-11-261-0/+80
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the conflicts in msvc_nmake.cpp the ifdefs are extended since we need to support windows phone in the target branch while it is not there in the current stable branch (as of Qt 5.2). Conflicts: configure qmake/generators/win32/msvc_nmake.cpp src/3rdparty/angle/src/libEGL/Surface.cpp src/angle/src/common/common.pri src/corelib/global/qglobal.h src/corelib/io/qstandardpaths.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxscreeneventhandler.h src/plugins/platforms/xcb/qglxintegration.h src/widgets/kernel/win.pri tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp tools/configure/configureapp.cpp Change-Id: I00b579eefebaf61d26ab9b00046d2b5bd5958812
| * Disable threaded GL for nouveau drivers.Gunnar Sletta2013-11-221-6/+19
| | | | | | | | | | | | | | Task-number: QTCREATORBUG-10875 Change-Id: I25f3abc6ef15bba78fa9ec27de2c1e5e0bcc7fae Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
| * Avoid using GLX pbuffers on fglrxLaszlo Agocs2013-11-141-3/+16
| | | | | | | | | | | | | | Task-number: QTBUG-34427 Change-Id: Ief4fe2fe2ab099d4ec61b6bfb2272724dfb2a800 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Remove side effects of QGLXContext::queryDummyContext()Sean Harmer2013-11-141-0/+8
| | | | | | | | | | | | | | Task-number: QTBUG-34782 Change-Id: I411c89238b3002a118b1750af0157ccff5c78712 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
| * Disable threaded rendering for Intel HD 3000 cards.Gunnar Sletta2013-11-061-4/+18
| | | | | | | | | | | | Task-number: QTBUG-34492 Change-Id: I1848cde3fb9517679fd54a7170ed5bee40880edc Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| * Don't support threaded GL on chromium (virtual box GL)Gunnar Sletta2013-10-291-0/+32
| | | | | | | | | | Change-Id: I84f89450e3fce1cbbafd19dbf4509b1911e06b19 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* | Add swapInterval to QSurfaceFormatLaszlo Agocs2013-11-131-3/+35
|/ | | | | | | | | | | | | | | Implement swap interval support for EGL, GLX and WGL. The environment variable QT_QPA_EGLFS_SWAPINTERVAL is renamed to QT_QPA_EGL_SWAPINTERVAL and can be used to override the applications' setting of the swap interval. Task-number: QTBUG-31939 Change-Id: I644325d5d3306b7604bffd7efccda3c00ed37d36 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* xcb: every window should have a title in debug modeShawn Rutledge2013-10-091-0/+3
| | | | | | | | | | | | Qt creates various invisible windows for internal purposes. Giving them all titles makes the output of tools like xprop and xwininfo more readable, which makes solving certain bugs (like transient-window bugs) easier. Task-number: QTBUG-33644 Change-Id: I9d37b40d3339fb0f81ffeae64949b88ecb655474 Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* XCB: support creation of OpenGL ES profilesGiuseppe D'Angelo2013-03-121-46/+78
| | | | | | | | | | | | The GLX_EXT_create_context_es2_profile extension allows us to create OpenGL ES profiles even under a desktop OpenGL implementation. Therefore, if a OpenGL ES renderable type is requested, and we have that extension, we can fullfill the request. We also strenghten the renderable types that the XCB plugin supports (default, OpenGL, OpenGL ES). Change-Id: I94ecbbaa910ab4c6d71185a69640e79594cb7bdc Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-03-051-159/+54
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure qmake/generators/mac/pbuilder_pbx.cpp src/corelib/kernel/qtimerinfo_unix.cpp src/plugins/platforms/cocoa/qcocoabackingstore.mm src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/xcb/qglxintegration.cpp Change-Id: I8d125fe498f5304874e6976b53f588d3e98a66ac
| * Fix OpenGL context creation in the XCB pluginFredrik Höglund2013-02-231-159/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make it possible to create a core context with OpenGL implementations that don't implement the compatibility profile or the GL_ARB_compatibility extension. Qt was effectively clamping the OpenGL version to 3.0 by assuming that the highest supported backwards compatible version is also the highest supported core version. Since there is no way to check if the implementation supports a context with a given set of attributes without trying to create the context, we have to try every known OpenGL version until we find one that's supported. Note that this commit does not fix similar breakage on other platforms. Change-Id: I9616762b059db9e6182f853ab7f24ff44dc7d529 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | Pass the surface format to qglx_surfaceFormatFromGLXFBConfigGiuseppe D'Angelo2013-02-231-2/+2
| | | | | | | | | | | | | | | | | | Instead of creating a default-constructed format and filling its field in, pass a pointer to an instance. This way we won't lose the renderable type set on the surface, but just fill in the other parameters. Change-Id: I1fd403671f9c677cc74aaf3c116a05f213d5d556 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | Enforce OpenGL context creation under XCBGiuseppe D'Angelo2013-02-231-3/+8
| | | | | | | | | | | | | | | | | | We don't support other context types, so fail in those cases. Also, return OpenGL as the rendereable type of our surface. Change-Id: Ic7b5ed0ec5eaf5c0f88f50f5bceb697ea414c696 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-181-12/+13
|\| | | | | | | | | | | | | Conflicts: src/widgets/styles/qmacstyle_mac.mm Change-Id: If8326db9e7da3cbf45dbf7475fdff9915c7723b1
| * Fix the GL_CONTEXT_FLAG_DEBUG_BIT checkFredrik Höglund2013-02-151-1/+5
| | | | | | | | | | | | | | | | Use the correct enum. GL_CONTEXT_FLAG_DEBUG_BIT does not have the same value as GLX/WGL_CONTEXT_DEBUG_BIT_ARB. Change-Id: I7d90da54ca1ff526c8b00669b486a68424fc8dfb Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
| * Fix the GL_CONTEXT_PROFILE_MASK checkFredrik Höglund2013-02-131-9/+5
| | | | | | | | | | | | | | | | | | | | | | A bit mask can have more than one bit set, so we can't use a switch statement here. Also use the correct enums, and make sure that the profile is set to QSurfaceFormat::NoProfile when the OpenGL version is less than 3.2. Change-Id: I6d2c4e35d4fb3d87fd47c9724cb415f8619a7b95 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
| * Fix the GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT checkFredrik Höglund2013-02-131-1/+1
| | | | | | | | | | Change-Id: I83dc92085c81b8b0c71502ea71878b5e85cbbacc Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
| * Check for GLX_ARB_create_context_profile before specifying a profileFredrik Höglund2013-02-131-1/+2
| | | | | | | | | | Change-Id: Idc4982c039f8a6a304d9ce5ce6736d518fb0ef00 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | Added QOffscreenSurface class.Yoann Lopes2013-02-181-5/+55
|/ | | | | | | | | | | | Inherits QSurface and allows to use OpenGL from an arbitrary thread. Platform plugins can implement QPlatformOffscreenSurface, otherwise an invisible QWindow is used by QOffscreenSurface. This patch includes an implementation of QOffscreenSurface for XCB and EglFS platform plugins using pbuffers. Change-Id: I57b4fc1db417331f34826dcfa754b7698782fde4 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Don't ignore QSurfaceFormat::Options in the XCB pluginFredrik Höglund2013-02-121-5/+15
| | | | | | | | | | | The XCB plugin requested a forward-compatible context regardless of whether QSurfaceFormat::DeprecatedFunctions was set, and also ignored the QSurfaceFormat::DebugContext option. Change-Id: I81c737447b554b3b6f61c2725bce7583e0e887ab Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Check for GLX_ARB_create_context extension before using it.Allan Sandfeld Jensen2013-01-161-1/+3
| | | | | | | | | | | Mesa has started defining glXCreateContextAttribsARB even when it is not supported as a feature. To be sure it is safe to use, we need to also check if it is supported extension. Change-Id: Ie160dc2b2418a726957b59f47bd290b742562ae3 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* xcb: Fix a colormap leakUli Schlachter2012-11-021-0/+1
| | | | | | | | | The function createDummyWindow() allocated a colormap, but never freed it. Freeing it is safe after the window is created. Change-Id: I4c876568572c9e1e9dde7047850a51917ef3702f Signed-off-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* OpenGL: Don't request a context version higher than is supportedSean Harmer2012-10-031-52/+210
| | | | | | | | | | | | | | | The function wglCreateContextAttribsARB will fail if we request a context version higher than is supported. We therefore upper-bound the requested version by the version of the static context. This results in context creation succeeding and having the closest possible match to the requested format. The xcb qpa plugin is modified to operate similarly to the windows plugin in that it now creates a "static" context which is used to limit the versions of contexts requested by the user. Change-Id: I277ad7cc82edfdf7b9d8502ad921c8175feb1a4a Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* XCB: Correctly report the created OpenGL context version and profileSean Harmer2012-09-261-8/+69
| | | | | | | | | | | | | | | This commit fixes the xcb qpa plugin such that it now correctly reports the version and profile of the created OpenGL context in the QOpenGLSurfaceFormat. To do this we have to create a temporary X window so that we can make our new context current. We also handle the buggy nVidia drivers which incorrectly report 0 for the GL_CONTEXT_PROFILE_MASK query. The reduced format is also copied back from qglx_findVisualInfo. Change-Id: I6f34fe1c6130aebbb6b40c36df4acc216069d2b1 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Use true and false in preference to TRUE and FALSESergio Ahumada2012-09-051-2/+2
| | | | | | | | The TRUE and FALSE macros are obsolete and should be replaced with true and false (all lower case) respectively. Change-Id: Iee352e8173500683e6319be0abbf5bacf29016e0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Only use glXCreateContext if glXCreateContextAttribsARB did not succeed.Zeno Albisser2012-08-071-16/+13
| | | | | | | | | | | | If glXCreateContextAttribsARB does not succeed or is not available, we should fallback to using glXCreateContext. But we should not just create a context with glXCreateContext by default that is being thrown away if glXCreateContextAttribsARB succeeds. Otherwise glXMakeCurrent with context 0 might cause an unexpected context change when dealing with multiple contexts. Change-Id: I7627abbe2500b4006180653a1b3b074fe7aca1d3 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* XCB: Correction to OpenGL version check for profile supportSean Harmer2012-08-041-1/+1
| | | | | Change-Id: I2f2bf877b1e2e628806f22fe66180b05090f4b3e Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* XCB: Record the OpenGL profile in the formatSean Harmer2012-07-231-0/+1
| | | | | Change-Id: I68f9e78e15fc798ec801feed74e0cb900ef577ae Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fix compilation for some glxext.h header versionsGunnar Sletta2012-07-121-0/+13
| | | | | | Change-Id: I62b636d9f884c225e64a653db1a5f5da822d4af2 Reviewed-by: Chris Adams <christopher.adams@nokia.com> Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>