summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/glxconvenience
Commit message (Collapse)AuthorAgeFilesLines
* X11: Better support non-32bit visualsLouai Al-Khanji2016-04-092-161/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch improves support for non-32bit screen configurations on X. The patch mostly touches the xcb platform plugin but the changes to the glx convenience functions do affect e.g. the offscreen plugin as well. Since QWindow instances are now by default of type RasterGL instead of Raster the majority of all windows are in fact instances of QXcbGlxWindow. This means that the eventual QSurfaceFormat that we use is chosen based on the available OpenGL configurations. Here the GLX config resolution code did not do a very good job in trying to find the closest match relative to the requested QSurfaceFormat, instead preferring higher bit depths. This is an issue since many configurations support 32-bit windows even if the screen itself has a root window with depth 16. In particular, servers supporting both GLX and Render are very likely to have such visuals. Particularly affected are remote X connections - even if the application itself makes no use of OpenGL at all! The changes introduced by this patch are as follows: 1. Improve the GLX visual selection logic 2. Improve the xcb visual selection logic 3. Remove duplicated visual lookup for OpenGL-enabled windows 4. Configure the default QSurfaceFormat to match the primary screen depth Change-Id: Id1c176359e63a4581410e20350db5ac2c083e1cf Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* EGL/GLX: Resolve depth buffer more intelligentlyLouai Al-Khanji2016-04-011-3/+5
| | | | | | | | | If a depth buffer size >=32 is requested, try 24 bits as a fallback. Task-number: QTBUG-44029 Done-with: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Change-Id: I43157d17c2bfe19b3b4a9139412e4c297e6150b7 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-152-28/+40
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-112-14/+14
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-242-38/+22
| | | | | | | | | - 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-0/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Add missing private headers warningSamuel Gaist2014-09-041-0/+11
| | | | | | | | | | Change-Id: I7a4dd22ea3bcebf4c3ec3ad731628fd8f3c247e0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add public and QPA APIs for adapting existing OpenGL contextsLaszlo Agocs2014-04-242-4/+38
|/ | | | | | | | | | | | | 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>
* glxconvenience: Add a QT_XCB_FORCE_SOFTWARE_OPENGL environment variable.Kevin Kofler2014-02-071-0/+29
| | | | | | | | | | | | | | | | | | | | | The QT_XCB_FORCE_SOFTWARE_OPENGL environment variable is equivalent to LIBGL_ALWAYS_SOFTWARE for Qt 5 applications only. This is most useful with drivers that only support OpenGL 1. We need OpenGL 2, but the user probably doesn't want LIBGL_ALWAYS_SOFTWARE in OpenGL 1 apps. Together with http://pkgs.fedoraproject.org/cgit/qt5-qtbase.git/tree/10-qt5-check-opengl2.sh which goes into /etc/X11/xinit/xinitrc.d, it makes QML 2 just work on old hardware that supports only OpenGL 1.x in hardware. The scriptlet checks the glxinfo output for the OpenGL version and sets QT_XCB_FORCE_SOFTWARE_OPENGL if the major version is < 2. (The scriptlet requires xorg-x11-xinit and glx-utils.) Tested on a Radeon 9200 SE (RV280) that supports only OpenGL 1.3 in hardware. Change-Id: Ief80d283820d6336052b8f390a0030ba9b687492 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* build glxconvenience also without XrenderOswald Buddenhagen2013-09-051-2/+3
| | | | | | | it contains #ifdefs for that, no need to disable it completely. Change-Id: I4a7d03e09fefded966e2c3fec58a470b4f1d3300 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* mark private dependencies as suchOswald Buddenhagen2013-05-201-1/+1
| | | | | | Change-Id: Ic93c8dc5aaad3973e4d4fc6bb3b70ad7c0a632b0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Pass the surface format to qglx_surfaceFormatFromGLXFBConfigGiuseppe D'Angelo2013-02-232-16/+11
| | | | | | | | | 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-0/+2
| | | | | | | | | 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>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-182-2/+2
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fixed qglxconvenience.cpp compile for GLX 1.3.Samuel Rødal2012-10-011-1/+3
| | | | | | | | These defines are new in GLX 1.4, earlier they were ARB extensions. Task-number: QTBUG-27370 Change-Id: I83828067d106e93a3909de46a4051d492e277ba9 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* XCB: Correctly report the created OpenGL context version and profileSean Harmer2012-09-261-0/+2
| | | | | | | | | | | | | | | 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-222-49/+49
| | | | | | | | 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>
* Revert "Remove the LIBS from platformsupport"Samuel Rødal2012-03-201-0/+1
| | | | | | | | | | | | This reverts commit cd6e90c70ac13065257422088ffa01537ed9c685. Prevent symbol lookup error when requesting alpha visuals with GLX in the xcb plugin. This means other plugins will also link against -lXrender, but we need this workaround for now. Change-Id: I2fd2c63bc577c2497060a555c91d72337723b931 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Remove the LIBS from platformsupportJørgen Lind2012-03-021-1/+0
| | | | | | | | | The application / library that uses this should know it needs to link to ie. udev, xrendr etc. Change-Id: I9e3ffd4d98b3bd66abb8e621378b010da7feda7a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
* Properly read back the actual format in xcb and xlib plugins.Samuel Rødal2012-02-102-7/+12
| | | | | Change-Id: Iccef2c4a87863b93914b84edf3a6015dad5e512a Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* More graceful handling of QSurfaceFormat::samples() with GLX.Samuel Rødal2012-02-101-1/+1
| | | | | | | | | | Earlier, if we asked for say 16 and the implementation only handled 4, we defaulted to 0 (no antialiasing). Now, we instead try a progressively lower number until we find a match. Task-number: QTBUG-22669 Change-Id: I3d89f2a302f9c6195e2d43827006fd015d981ce7 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-302-2/+2
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fall back on glXChooseVisual() if glXChooseFBConfig() doesn't work.Samuel Rødal2012-01-271-9/+66
| | | | | | | | | | Some older drivers don't fully support glXChooseFBConfig(). As a bonus, fix some memory leaks here and there. Task-number: QTBUG-21880 Change-Id: Ie306dee27f616927a6aa55fd71601569b828afcc Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-232-2/+2
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Added xrender as a dependency to build glxconvenience.Samuel Rødal2012-01-061-1/+1
| | | | | | | Prevents build errors when xrender is not present. Change-Id: Ib80d52109dd0bcd63ba865c5f6e143961f3c20e6 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-052-2/+2
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Link to X and Xrender libs in glxconvenienceJørgen Lind2011-12-231-0/+1
| | | | | Change-Id: I54b2704be678f2c3b9ab8d24d044977c9c01e98e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* OpenGL API refactor.Samuel Rødal2011-06-212-16/+16
| | | | | | Rename QGuiGLFormat to QSurfaceFormat, and make QWindow sub-class of QSurface and QPlatformWindow sub-class of QPlatformSurface, instead of having QPlatformGLSurface accessor in QWindow.
* QtPlatformSupport: A helper library for platform pluginsJørgen Lind2011-06-103-0/+288
QtPlatformSupport is a static library. Platform plugins are meant to link against this library to pull in dependencies such as fontengines and convenience functions for finding the right GL configs. The linker will only pull in the symbols used, so the size of the library doesn't really matter