summaryrefslogtreecommitdiffstats
path: root/tests/auto/opengl
Commit message (Collapse)AuthorAgeFilesLines
* macOS: Skip tst_QGLThreads::renderInThreadTor Arne Vestbø2018-11-091-0/+5
| | | | | | | | | | | | | | | | | | | | | It crashes in the render thread: thread #7, name = 'SceneRenderingThread' frame #0: libsystem_kernel.dylib`__wait4_nocancel + 10 frame #1: libsystem_c.dylib`system + 452 frame #2: QtTest`stackTrace() + 325 frame #3: QtTest`QTest::FatalSignalHandler::signal(int) + 207 frame #4: libsystem_platform.dylib`_sigtramp + 26 frame #5: libsystem_platform.dylib`_platform_bzero$VARIANT$Base + 23 frame #6: GLRendererFloat`gldSetZero + 63 frame #7: GLRendererFloat`gldClearDrawBuffer + 3792 frame #8: GLRendererFloat`gldClearFramebufferData + 49 frame #9: GLEngine`glClear_Exec + 541 frame #10: tst_qglthreads`SceneRenderingThread::run() + 227 Task-number: QTBUG-68524 Change-Id: I6bc67cb342f77dc1a590a25af535f9bb7f0d325a Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Extend tst_QGL::graphicsViewClipping blacklistingTor Arne Vestbø2018-10-031-1/+1
| | | | | | | Change-Id: Ife72db5a0d7cb8abe55c60c519087e2b60f26990 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Blacklist flaky tst_QGL::graphicsViewClipping on RHEL 7.4Tor Arne Vestbø2018-09-131-0/+1
| | | | | | Change-Id: Ic771b263c988525d4b887cb2a1de9f9c7343e49b Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* tst_qglthreads::swapInThread(): Acquire context before resizing widgetTor Arne Vestbø2018-09-061-0/+7
| | | | | | | | Otherwise the QGLWidget's context may be owned by and used by the swap thread when the resize happens on the main thread. Change-Id: Id415747572e6b988924618b1df0efdee5fcb1805 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* tst_QGL: Use qWaitForWindowExposed()Kari Oikarinen2018-04-111-2/+1
| | | | | | | Instead of an unconditional wait. Change-Id: I360cd665c10c3fd4f936c95ef04957ae1c49c0de Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Remove tst_QGLThreads::textureUploadInThreadKari Oikarinen2018-03-022-134/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The test has been crashing flakily recently. 1) It is creating a QGLWidget 2) It is stealing the QGLContext of that widget and moves it into a separate thread. 3) In that secondary thread it makes the context current. 4) Meanwhile the QGLWidget itself may receive for example a resizeEvent or other events and - since it assumes that it owns the context - attempts to make it current. 5) Attempting to call makeCurrent() on a QGLContext that is in a different thread than the current thread (via QObject thread affinity) will result in a call to qFatal() and consequently the test aborts. The conclusion from Simon Hausmann is that this test is testing a pattern from Qt4 times that may or may not have worked back then. Nowadays with the Qt5 QOpenGL* API we do support this properly and there appears little sense testing this. Therefore remove the test altogether. Task-number: QTBUG-66411 Task-number: QTBUG-66216 Change-Id: Ie2d66705bc7c3914ace6abcba9557c7c67ad4db3 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* qtbase: cleanup BLACKLIST filesChristian Ehrlicher2018-02-131-1/+0
| | | | | | | | | | | | | | | | | | Cleanup BLACKLIST files which contain entries for CI-systems which are no longer active: - opensuse-13.1 - opensuse-42.1 - osx-10.8 - osx-10.9 - osx-10.10 - rhel-7.1 - rhel-7.2 - rhel-7.3 - ubuntu-14.04 - windows msvc-2010 Change-Id: I25590b0807a4454f9dc92aa4ea61300f7c9af56b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Change almost all other uses of qrand() to QRandomGeneratorThiago Macieira2017-11-081-10/+10
| | | | | | | | | | | | | | | | | | | The vast majority is actually switched to QRandomGenerator::bounded(), which gives a mostly uniform distribution over the [0, bound) range. There are very few floating point cases left, as many of those that did use floating point did not need to, after all. (I did leave some that were too ugly for me to understand) This commit also found a couple of calls to rand() instead of qrand(). This commit does not include changes to SSL code that continues to use qrand() (job for someone else): src/network/ssl/qsslkey_qt.cpp src/network/ssl/qsslsocket_mac.cpp tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5285d43f4afbf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Ensure result of all QTest::qWaitFor are verifiedTor Arne Vestbø2017-10-052-2/+2
| | | | | | | | | The qWaitFor functions themselves can not trigger a test failure, as that will not result in the test function exiting early, so every single call to qWaitFor needs to be wrapped in a QVERIFY. Change-Id: Id15a1549f31d06cdbf788e1d84ea431c28636ec8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_QGL::graphicsViewClipping: Wait for viewport's window handleTor Arne Vestbø2017-07-171-1/+1
| | | | | | | | | | | | | The QWidget overload of qWaitForWindowExposed waits for the widget's top level QWindow, which for the viewport is the graphics-view. We want to explicitly wait for the viewport to be exposed, as the viewport is covering the whole graphics-view, preventing it from being exposed. See a6991376c. Change-Id: I86df43871126562f09e4ce14931bc6fc7f06263d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Wait for window expose on the viewport widgetMorten Johan Sørvig2017-07-111-1/+1
| | | | | | | | | | | | | The child viewport window covers the entire client area of the parent window, which prevents the parent window from being exposed. This worked by accident until now, and was uncovered by changes to the cocoa platform plugin implementation. Change-Id: I0d62a1a33f125e5a9030c8def452a49886e54956 Task-number: QTBUG-50414 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Switch to RGB(A|X)8888[_Premultiplied] for QOpenGLFBO readbacks on GLESLaszlo Agocs2017-03-281-1/+3
| | | | | | | | | | | | | | | | | Instead of the never-ending blacklisting of "broken" drivers, simply switch to always choosing a byte ordered QImage format with OpenGL ES, and keep on using the (one and only) spec-mandated GL_RGBA/GL_UNSIGNED_BYTE combo. There is nothing broken with not supporting BGRA for glReadPixels even when GL_EXT_read_format_bgra (an out of date, pre-2.0 extension that got folded into the spec to begin with) is present. We do not have a good way to tell if BGRA_EXT is supported for glReadPixels or not, so just skip the whole problem altogether. Task-number: QTBUG-59283 Task-number: QTBUG-59303 Change-Id: I9f0605380923bd3b3ffdeb80f5c172d3e4cc7927 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add support for OpenGL 3.2+ core profile contexts in QPainterJulian Thijssen2017-01-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | This change allows painting via QPainter onto a QOpenGLWindow, QOpenGLWidget or QOpenGLFramebufferObject when an core profile context is in use. This is important on macOS in particular, where compatibility profiles are not available, and so the only way to use modern OpenGL is via a core profile context. Added core profile compatible shaders with moder GLSL keywords. The paint engine binds a VAO and two VBOs from now on, whenever VAOs are supported. Note that this changes behavior also for OpenGL 2.x context that have VAO support via extensions. The Lancelot test suite gains support for core profile contexts. This can be triggered via -coreglbuffer in place of -glbuffer when manually inspecting via 'lance', while tst_lancelot will automatically run core context-based tests whenever supported. Task-number: QTBUG-33535 Change-Id: I6323a7ea2aaa9e111651ebbffd3e40259c8e7a9c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Remove last traces of opengl es 1 supportLars Knoll2016-11-161-4/+2
| | | | | Change-Id: I3f86d4892ec3235003d34fdcf3f093f1513c821f Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Change confusing Q_DEAD_CODE_FROM_QT4_FOO defineTor Arne Vestbø2016-10-141-1/+1
| | | | | | | | | | | | | | | | | | | Commit c5db8fc74 changed all instances of Q_WS_FOO to have the prefix Q_DEAD_CODE_FROM_QT4 instead, to make it clearer when reading the code that the code in question was a left-over from Qt4, when we used Q_WS_ defines instead of Q_OS_ defines. This worked well for cases of #ifdef Q_DEAD_CODE_FROM_QT4, but less so for cases of #ifndef Q_DEAD_CODE_FROM_QT4, where the code was actually unconditionally included. To make this even clearer, the defines have been replaced by checks for 1 or 0, with a comment describing how the code used to look in Qt4. The use of constants in the check also makes it easier for editors to parse the condition and show visually that the code is defined out. Change-Id: I152070d87334df7259b417cd5e17d7b7950379b7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* winrt: Add tests to blacklistMaurice Kalinowski2016-09-071-0/+8
| | | | | | | This synchronizes with windows. Change-Id: I25a7d9969db37d44c2389a7dceb5f7096f658295 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* remove redundant x11 handlingOswald Buddenhagen2016-08-101-7/+0
| | | | | | | | one of the effects of CONFIG+=x11 is LIBS+=$$QMAKE_LIBS_X11, so it's positively pointless for project files to do the same. Change-Id: I4085acd6254401897b34e131c2cb57f1f76a3638 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Blacklisting a flaky tst_QGL::clipTest test on OpenSUSE 13.1Milla Pohjanheimo2016-06-011-0/+1
| | | | | | | | Based on discussion with Laszlo, we are blacklisting this test. Task-number: QTBUG-53133 Change-Id: I08a5192ebcefd7b093c79872e0dfaddb794cab57 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-041-2/+0
|\ | | | | | | Change-Id: I35ca979395620e104e50b06366d0869433a4ffc2
| * Autotest: Remove blacklistingsSimo Fält2016-04-011-2/+0
| | | | | | | | | | | | | | | | | | Removing blacklistings from tests that are now passing. Change-Id: I00aa1ce286d3e7715fb4bee4a36d0d77049a29ae Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-181-0/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also reverts commit 018e670a26ff5a61b949100ae080f5e654e7bee8. The change was introduced in 5.6. After the refactoring, 14960f52, in 5.7 branch and a merge, it is not needed any more. Conflicts: .qmake.conf src/corelib/io/qstandardpaths_mac.mm src/corelib/tools/qsharedpointer_impl.h tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp Change-Id: If4fdff0ebf2b9b5df9f9db93ea0022d5ee3da2a4
| * Autotest: Enable make check on rhel 7.1Simo Fält2016-02-111-0/+2
| | | | | | | | | | | | | | | | Blacklisting all tests, which were failing locally. Task-number: QTQAINFRA-949 Change-Id: I40c25ab0155b8977596d61297ab252a546515f87 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-215-85/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devSimon Hausmann2016-01-121-1/+0
|\| | | | | | | Change-Id: I5839bded07e23af65ced9491c4f50242f964dd31
| * Doc: mention that Qt::AA_X11InitThreads isn't used anymoreDavid Faure2016-01-111-1/+0
| | | | | | | | | | | | | | | | Whether or not to call XInitThreads() doesn't apply since Qt-5.0's switch to XCB. Change-Id: I5f1e5e664a251c98af6357c87fc9a6bb03a46ce3 Reviewed-by: Martin Smith <martin.smith@theqtcompany.com> Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* | Remove insignificant flag for a platform not supportedTony Sarajärvi2015-11-291-2/+0
| | | | | | | | | | | | | | VS2010 is not supported in Qt5.7+ Change-Id: I9961c49750d39dd92b593ae4c29e11d57a3fbbfa Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | Remove insignificant from qglfunctions testTony Sarajärvi2015-11-251-2/+0
| | | | | | | | | | | | | | Task-number: QTBUG-26390 Change-Id: If80bf9d05a16e0d1c5933632ac96fe6c3d3df273 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* | Remove insignificant test flag for unsupported distroTony Sarajärvi2015-11-241-1/+0
| | | | | | | | | | | | | | | | Ubuntu 10.04 is not supported anyways in Qt 5.7+ Task-number: QTBUG-25293 Change-Id: I6420f76b12835aca268455341b46be61e9a2b143 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Autotests: skip three steps from tst_qglthreadsJani Vähäkangas2015-10-072-1/+10
| | | | | | | | | | | | Change-Id: I38fb7ae94585a0d4dc2bd55085812ad200ea6159 Task-number: QTBUG-46446 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
* | Tests: Remove CONFIG += parallel_test.Friedemann Kleint2015-09-052-2/+0
| | | | | | | | | | | | | | The keyword no longer has a meaning for the new CI. Change-Id: Ibcea4c7a82fb7f982cf4569fdff19f82066543d1 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove QT_DISABLE_DEPRECATED_BEFORE=0 from tests not using deprecated API.Friedemann Kleint2015-09-014-4/+0
|/ | | | | Change-Id: I1955320e7639760b4383a53f37a506c8055933ef Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* tests/auto/opengl: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).Friedemann Kleint2015-07-243-65/+65
| | | | | | | | | | | | - Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer). - Replace Q[TRY]_VERIFY(smartPointer == 0) by Q[TRY]_VERIFY(smartPointer.isNull()). - Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and add casts where necessary. The values will then be logged should a test fail. Change-Id: I7add5b7afeba83895acdcbed110e8275dc76864a Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Tests: Do not rely on qCompare(bool, int,...).Friedemann Kleint2015-07-181-6/+6
| | | | | | | | | The overload was added for NokiaX86 and RVCT and is bound for removal. Task-number: QTBUG-47260 Change-Id: Ic67cee8769847956e16cd0470ebcd663a9e98a40 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Blacklist and skip various tests that are flakeySimon Hausmann2015-06-141-0/+16
| | | | | | | | | | They didn't show up in the "old" CI runs because they usually pass the second time they are executed - which the testrunner does. The new CI doesn't do that anymore, instead we now mark those tests explicitly and will track their record of passing and failing in the new metrics database. Change-Id: Id34dd6f792f38995b07b6fec88f833df64de2f8b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update copyright headersJani Heikkinen2015-02-115-35/+35
| | | | | | | | | | | | | | | | | | 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>
* Make it more obvious that Q_WS_ is dead code, and should perhaps be portedTor Arne Vestbø2015-02-031-1/+1
| | | | | | | | | | | | We still have a bunch of Q_WS_ ifdefs in our code, which are easy to mistake for Q_OS_ ifdefs when quickly scanning the code. By renaming the ifdefs we make it clear that the code in question is dead. In incremental follow-ups, we can then selectively either remove, or port, the pieces that are dead code. Change-Id: Ib5ef3e9e0662d321f179f3e25122cacafff0f41f Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Change bugreports.qt-project.org -> bugreports.qt.ioAlex Blasche2014-12-181-1/+1
| | | | | | | The Qt bug tracker URL changes as part of the qt.io transition Change-Id: Icb4ab198943b93639b5e3a8d99262303785c6459 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Fixed QtGui's GL paint engine getting out of sync when using QtOpenGLSamuel Rødal2014-11-111-0/+27
| | | | | | | | | | We need to reset the active_engine belonging to QOpenGLContext whenever we make the QtOpenGL paint engine active, to give the OpenGL paint engine in QtGui a chance to sync its state if we've used the QtOpenGL paint engine inbetween. Change-Id: I445ce2f99bfbacf55650c881c4fdf07f2ff85069 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Fix for current_fbo getting out of sync in QtOpenGLSamuel Rødal2014-11-111-0/+63
| | | | | | | | | | | | | | | When using QGLWidget in combination with QOpenGLFramebufferObject from QtGui, instead of QGLFramebufferObject from QtOpenGL, the current_fbo variable doesn't get updated when framebuffer object bindings change. To ensure that the QGLWidget correctly releases the currently bound framebuffer object when using a QPainter, we keep track of whether QOpenGLFramebufferObject has modified the current FBO binding, and if that's the case we need to read the OpenGL state directly instead of relying on a cached value. Change-Id: If7e0bd936e202cad07365b5ce641ee01d2251930 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-245-95/+55
| | | | | | | | | - 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/stable' into devFrederik Gladhorn2014-05-064-8/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2014-05-013-8/+8
| |\ | | | | | | | | | | | | | | | This merge adds the opengl rename. Change-Id: I84ea0b6abee9780ebb2cf3f64ab9e3fdf2acab3e
| | * Rename new QOpenGLContext APIsLaszlo Agocs2014-04-253-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | isES() becomes isOpenGLES(). The library type enums are changed DesktopGL -> LibGL and GLES2 -> LibGLES. This removes the now unnecessary version number, the confusing "desktop" term and provides better readability. The old function/values are kept until the related qtdeclarative changes are integrated. Task-number: QTBUG-38564 Change-Id: Ibb0a1209985f1ce4bb9451f9b7b093c2b68a6505 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * | QNX: Skip QGLBuffer autotestFabian Bumberger2014-04-141-0/+4
| |/ | | | | | | | | | | | | see QTBUG-38275 Change-Id: If9a329b07f83ace77b05336d16534032310e0f82 Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
* / Remove direct OpenGL calls from QtOpenGLLaszlo Agocs2014-04-283-48/+60
|/ | | | | | Task-number: QTBUG-36483 Change-Id: I96dea5649c0a49a11cd2ff31da659cd2067e769d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QNX: Fix OpenGL autotestFabian Bumberger2014-04-011-1/+29
| | | | | | | | | | | | On QNX grabbing the frame buffer returns the content of the back buffer. In order to execute the OpenGL tests properly a swapBuffers is executed before in order to be able to retrieve the content of the front buffer. The patch also documents this platform behavior. Change-Id: I7a501818ec6eea061f2f54f95854f68cb72e0534 Reviewed-by: James McDonnell <jmcdonnell@qnx.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Resurrect advanced bindTexture() features in QtOpenGLLaszlo Agocs2014-03-201-0/+40
| | | | | | | | | | | | | | During the Qt 4 -> 5 migration the setting of the extension flags in QOpenGLFunctions/Extensions suffered a regression: flags like GenerateMipmap were never set. This led to the unfortunate sitation that features that were tied to these flags, like compressed texture support or mipmap generation, got disabled. This is now corrected by checking for the extensions like Qt 4 did. Task-number: QTBUG-37588 Change-Id: I4a7beb1b435af11e05f5304aa04df2ec63b34c18 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* tst_QGLThreads: Fix errors about makeCurrent() in different thread.Friedemann Kleint2014-03-061-0/+12
| | | | | | | | | | QFATAL : tst_QGLThreads::textureUploadInThread() Cannot make QOpenGLContext current in a different thread QFATAL : tst_QGLThreads::painterOnPboInThread() Cannot make QOpenGLContext current in a different thread Task-number: QTBUG-28264 Change-Id: I281cf0593e01b43456410a9a53746bbb15f34f24 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Dynamic GL: remove exporting symbolsLaszlo Agocs2014-03-043-6/+6
| | | | | | | | | | | | | | | | | | | | | Remove the opengl proxy for now. Later it will either be moved into a separate library or replaced by a QOpenGLFunctions-based approach. This means that the -opengl dynamic configuration is not usable for the time being. The rest of the enablers remain in place. The convenience function QOpenGLFunctions::isES() is now moved to QOpenGLContext and is changed to check the renderable type. This is extremely useful since besides supporting dynamic GL it solves also the problem of GL_ARB_ES2_compatibility (i.e. it triggers the real ES path when creating an ES-compatible context with a desktop OpenGL implementation). Task-number: QTBUG-36483 Task-number: QTBUG-37172 Change-Id: I045be3fc16e9043e1528cf48e6bf0903da4fa7ca Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Dynamic GL switch on WindowsLaszlo Agocs2014-02-143-145/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch introduces a new build configuration on Windows which can be requested by passing -opengl dynamic to configure. Platforms other than Windows (including WinRT) are not affected. The existing Angle and desktop configurations are not affected. These continue to function as before and Angle remains the default. In the future, when all modules have added support for the dynamic path, as described below, the default configuration could be changed to be the dynamic one. This would allow providing a single set of binaries in the official builds instead of the current two. When requesting dynamic GL, Angle is built but QT_OPENGL_ES[_2] are never defined. Instead, the code path that has traditionally been desktop GL only becomes the dynamic path that has to do runtime checks. Qt modules and applications are not linked to opengl32.dll or libegl/glesv2.dll in this case. Instead, QtGui exports all necessary egl/egl/gl functions which will, under the hood, forward all requests to a dynamically loaded EGL/WGL/GL implementation. Porting guide (better said, changes needed to prepare your code to work with dynamic GL builds when the fallback to Angle is utilized): 1. In !QT_OPENGL_ES[_2] code branches use QOpenGLFunctions::isES() to differentiate between desktop and ES where needed. Keep in mind that it is the desktop GL header (plus qopenglext.h) that is included, not the GLES one. QtGui's proxy will handle some differences, for example calling glClearDepth will route to glClearDepthf when needed. The built-in eglGetProcAddress is able to retrieve pointers for standard GLES2 functions too so code resolving OpenGL 2 functions will function in any case. 2. QT_CONFIG will contain "opengl" and "dynamicgl" in dynamic builds, but never "angle" or "opengles2". 3. The preprocessor define QT_OPENGL_DYNAMIC is also available in dynamic builds. The usage of this is strongly discouraged and should not be needed anywhere except for QtGui and the platform plugin. 4. Code in need of the library handle can use QOpenGLFunctions::platformGLHandle(). The decision on which library to load is currently based on a simple test that creates a dummy window/context and tries to resolve an OpenGL 2 function. If this fails, it goes for Angle. This seems to work well on Win7 PCs for example that do not have proper graphics drivers providing OpenGL installed but are D3D9 capable using the default drivers. Setting QT_OPENGL to desktop or angle skips the test and forces usage of the given GL. There are also two new application attributes that could be used for the same purpose. If Angle is requested but the libraries are not present, desktop is tried. If desktop is requested, or if angle is requested but nothing works, the EGL/WGL functions will still be callable but will return 0. This conveniently means that eglInitialize() and such will report a failure. Debug messages can be enabled by setting QT_OPENGLPROXY_DEBUG. This will tell which implementation is chosen. The textures example application is ported to OpenGL 2, the GL 1 code path is removed. [ChangeLog][QtGui] Qt builds on Windows can now be configured for dynamic loading of the OpenGL implementation. This can be requested by passing -opengl dynamic to configure. In this mode no modules will link to opengl32.dll or Angle's libegl/libglesv2. Instead, QtGui will dynamically choose between desktop and Angle during the first GL/EGL/WGL call. This allows deploying applications with a single set of Qt libraries with the ability of transparently falling back to Angle in case the opengl32.dll is not suitable, due to missing graphics drivers for example. Task-number: QTBUG-36483 Change-Id: I716fdebbf60b355b7d9ef57d1e069eef366b4ab9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>