summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowseglcontext.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Windows QPA plugin: Use member initializationFriedemann Kleint2016-11-301-2/+0
| | | | | | | | Use C++ 11 member initialization in value-type structs. Task-number: QTBUG-51673 Change-Id: I668389b4a0ad1d862a505b740d67357cb9c2a3dc Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Merge remote-tracking branch 'origin/5.7' into devEdward Welbourne2016-07-191-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/library/qmakebuiltins.cpp qmake/library/qmakeevaluator.cpp qmake/library/qmakeevaluator.h qmake/project.h QMakeEvaluator: * evaluateConditional(): one side changed return type, the other changed a parameter type. * split_value_list(): one side changed a parameter adjacent to where ... * expandVariableReferences(): ... the other killed one overload and changed the survivor src/corelib/io/qlockfile_unix.cpp One side changed a #if condition, the other moved NETBSD's part of what it controlled. src/corelib/tools/qdatetime.cpp One side fixed a reachable Q_UNREACHABLE in toMSecsSinceEpoch(), the other moved it from the private class to the public one, in the midst of the "short date-time" optimization, which confused diff entirely. One side changed a QStringLiteral to QLatin1String, the other rewrote adjoining code. src/network/kernel/qauthenticator.cpp Both rewrote a line, equivalently; kept the dev version. src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h One side changed #if-ery that the other removed. tools/configure/configureapp.cpp One side added a check to -target parsing; the other killed -target. tests/auto/testlib/selftests/expected_cmptest.lightxml tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/testlib/selftests/expected_cmptest.xml tests/auto/testlib/selftests/expected_cmptest.xunitxml Regenerated using generate_expected_output.py I note that quite a few other expected_* come out changed, now. There was no git-conflict in src/widgets/kernel/qformlayout.cpp but it didn't compile; one side removed some unused methods; the other found uses for one of them. Put FixedColumnMatrix<>::removeRow(int) back for its new user. Change-Id: I8cc2a71add48c0a848e13cfc47b5a7754e8ca584
| * Merge remote-tracking branch 'origin/5.6' into 5.7Edward Welbourne2016-07-041-1/+1
| |\ | | | | | | | | | Change-Id: Ibd81cd1df4a0650d93fcb556a57be90be2e1f569
| | * Fix URL to ANGLEFriedemann Kleint2016-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Point to the README.md of the project; the old URL http://code.google.com/p/angleproject is now redirected to the bugtracker. Change-Id: I293fc150d5b6c08f16effe8921010050faa264b5 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-131-24/+43
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config_help.txt configure mkspecs/features/uikit/sdk.prf src/corelib/global/qhooks.cpp src/corelib/io/qfilesystemwatcher.cpp src/corelib/io/qlockfile_unix.cpp src/corelib/tools/qalgorithms.h src/gui/kernel/qwindowsysteminterface.h src/gui/text/qtextdocument_p.cpp src/network/access/access.pri src/network/access/qnetworkaccessmanager.cpp src/network/access/qnetworkreplynsurlconnectionimpl.mm src/src.pro src/testlib/qtestcase.cpp src/widgets/kernel/qwidgetbackingstore_p.h src/widgets/styles/qwindowscestyle.cpp src/widgets/styles/qwindowsmobilestyle.cpp tests/auto/corelib/io/qdiriterator/qdiriterator.pro tests/auto/corelib/io/qfileinfo/qfileinfo.pro tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp tools/configure/configureapp.cpp Change-Id: Ibf7fb9c8cf263a810ade82f821345d0725c57c67
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-061-24/+43
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf config.tests/unix/nis/nis.cpp mkspecs/unsupported/freebsd-g++/qplatformdefs.h src/corelib/tools/qdatetime.cpp src/corelib/tools/qsimd.cpp src/corelib/tools/qsimd_p.h src/network/access/access.pri src/network/access/qnetworkreplynsurlconnectionimpl.mm src/network/access/qnetworkreplynsurlconnectionimpl_p.h src/plugins/platforms/cocoa/qnsview.mm src/plugins/printsupport/windows/qwindowsprintdevice.cpp tests/auto/corelib/kernel/qobject/tst_qobject.cpp tests/auto/network/access/qnetworkreply/BLACKLIST tests/auto/widgets/widgets/qopenglwidget/BLACKLIST Change-Id: I4b32055bbf922392ef0264fd403405416fffee57
| | * windows: Fall back to D3D9 when 11 failsLaszlo Agocs2016-05-231-24/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is assumed that this happens automatically but that is not always the case. Do not become stuck with a non-functional D3D11-backed EGL environment. Instead, try again as if QT_ANGLE_PLATFORM=d3d9 was requested. Task-number: QTBUG-52056 Change-Id: I12ac6ca5f1d06f9504d05120d8e1053e97edfab3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-121-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config_help.txt configure src/corelib/io/qprocess_wince.cpp src/plugins/platforms/windows/qwindowstheme.cpp src/plugins/platforms/xcb/qxcbbackingstore.cpp tests/auto/corelib/tools/qtimezone/BLACKLIST tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp Change-Id: I26644d1cb3b78412c8ff285e2a55bea1bd641c01
| * | compile fix for static qt with dynamic openglTim Blechmann2016-05-061-1/+1
| | | | | | | | | | | | | | | | | | Change-Id: If78f6afeeeda5ea46a2ed17c6938fa25be9802fe Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Windows QPA: Remove Windows CE.Friedemann Kleint2016-03-291-8/+4
|/ / | | | | | | | | | | Task-number: QTBUG-51673 Change-Id: I5b58a7d1651fce7f868a4d3fdd8fa46f35e67695 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | Restore multisampled FBOs on ANGLELaszlo Agocs2016-03-021-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function resolving changes remove the special treatment for ES 3.0+ contexts, meaning that now all functions get resolved in the same way irrespective of the current context. For blitFramebuffer and renderbufferStorageMultisample this presented an issue with ANGLE. There these functions are available both as an ANGLE extension and as standard ES 3.0 functions. The latter are not functional however in 2.0 contexts. We expect multisampled FBOs to work in 2.0 contexts too by prefering the ANGLE extension with 2.0 contexts. Change-Id: I0a4b70e6d39c84d4b1f61f8fd0655d7326419a2a Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Clean up resolving of OpenGL functions on WindowsLars Knoll2016-03-021-309/+167
| | | | | | | | | | | | | | | | | | | | | | | | Always try both e/wglGetProcAddress and ::GetProcAddress to resolve the methods. Like this QOpengGLContext::getProcAddress is able to return any OpenGL entry point, and we can both simplify the code we have in the QPA backend as well as get rid of windows specific code paths in Qt Gui. Task-number: QTBUG-39531 Change-Id: I1ddf1b0974f69b56b219a619655b723eb0134b14 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Avoid repeated QByteArray creation when resolving opengl functionsLars Knoll2016-03-011-4/+4
| | | | | | | | | | | | | | | | | | | | Add an getProcAddress(const char *) overload to QOpenGLContext, and refactor the QPA interface to take a const char *. Like this we can avoid lots of mallocs when resoving GL methods. Change-Id: Ic45b985fbaa0da8d32ba3e3b485351173352ca6f Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-241-6/+6
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java src/plugins/platforms/windows/qwindowsfontengine.cpp src/plugins/platforms/windows/qwindowsnativeimage.cpp tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I649b32b260ce0ed2d6a5089021daa0d6a8db85f7
| * Windows QPA: Fix warnings as shown by Qt Creator's Clang based code model.Friedemann Kleint2016-02-191-6/+6
| | | | | | | | | | | | | | | | Code except font, accessibility and file qwindowswindow.cpp. Task-number: QTBUG-50804 Change-Id: I40848264f9fa16eea00cf70d7be009c484c49e92 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-181-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Windows QPA: Prefer const-versions of API where applicable.Friedemann Kleint2016-02-121-1/+1
| | | | | | | | | | | | | | | | Ensure no detaching occurs by using Container::constFirst() and QImage::constScanLine(). Change-Id: Ie197d795d9329de8be76ed388ba2c71ccf201f5c Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-02-111-3/+3
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qfilesystemwatcher_win.cpp src/corelib/plugin/plugin.pri src/plugins/platforms/cocoa/qcocoaaccessibility.mm tests/auto/corelib/tools/qlocale/tst_qlocale.cpp Change-Id: Id6824631252609a75eff8b68792e4d10095c8fc1
| * Windows QPA: Remove dead code as detected by Clang.Friedemann Kleint2016-02-051-3/+3
| | | | | | | | | | | | | | | | Task-number: QTBUG-50804 Change-Id: Id87ca4ac98eb17b1e743a10080554da38d609588 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
|/ | | | | | | | | | | 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>
* Rename ANGLE libs in order to not conflict with other ANGLE libsJan Arve Saether2015-12-011-8/+9
| | | | | | | | | | | | | | | | This is needed to be able to use Qt (with dynamic ANGLE) in a plugin while the host runs a different version of Qt (and ANGLE). In addition to changing the LIBEGL_NAME and LIBGLESV2_NAME variables you also need to update the value of the LIBRARY definition in the .def files for ANGLE: qtbase/src/3rdparty/angle/src/libGLESv2/libGLESv2[d?].def qtbase/src/3rdparty/angle/src/libGLESv2/libEGL[d?].def Task-number: QTBUG-48431 Change-Id: Idd00d039ba3e20cc0ec7496bee36ed1c90383b0d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* QWindowsEGLContext: Fix overly specific EGL include path.Friedemann Kleint2015-11-051-1/+1
| | | | | | | Allow for using other EGL implementations besides ANGLE. Change-Id: I64ceca477912150425e4a9328001cc911bd351bf Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-021-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/src/qmake-manual.qdoc src/corelib/tools/qstring.h src/gui/image/qimagereader.cpp src/network/access/qnetworkaccessmanager.cpp src/tools/qdoc/doc/examples/examples.qdoc src/widgets/accessible/qaccessiblewidgetfactory_p.h src/widgets/doc/qtwidgets.qdocconf Change-Id: I8fae62283aebefe24e5ca4b4abd97386560c0fcb
| * windows: Avoid __eglMustCast... in EGLLaszlo Agocs2015-08-271-1/+1
| | | | | | | | | | | | | | | | | | WinCE headers do not have this type. Task-number: QTBUG-47964 Change-Id: I5573eaf754b825774576c55b7cb4acfbd9e8d8dd Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | windows: Improve error handling with EGLLaszlo Agocs2015-09-231-12/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When disabling the graphics adapter, things start failing with context lost and then bad_alloc and bad_access failures when creating contexts/window surfaces. Swap buffers now handles context loss. This makes it possible for Qt Quick to act when the graphics adapter goes away. Similarly, the window surface creation failure EGL_BAD_ACCESS is treated the same way as context loss. Note that this will not really help the main issue, because rendering is not possible without a GPU (reinit attempts will fail either at context creation or window surface creation), but proper logging and context loss reporting improves the situation somewhat. Also unify and prettyify the warning and debug prints. This makes it easier to understand what is going on. Change-Id: Iec3a9b54f1134e78e87eefcf938525283ec9412a Task-number: QTBUG-48095 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | Revert "Handle context loss in window surface creation too"Laszlo Agocs2015-06-231-2/+1
| | | | | | | | | | | | | | | | | | | | This reverts commit e4f5278a4f308297bdcf12c04c8b4600a1294ef7. Revert this for now until we figure out what exactly is needed for the Windows 7 CI virtual machines. Change-Id: Ibd5578eac1d172785fac5e94c4c5c7508f8ddb79 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Handle context loss in window surface creation tooLaszlo Agocs2015-06-221-1/+2
|/ | | | | | | | | | While this is not what the EGL spec says, we can get EGL_CONTEXT_LOST in eglCreateWindowSurface too with ANGLE. Handle it the same way like we do for eglMakeCurrent and eglSwapBuffers (no warning, just return the error code silently since we may recover from this). Change-Id: I6b6c57ffd4fca23e1a14a90ef7b18b33f4c96fd2 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* windows: Use EGL extensions as they ought to be usedLaszlo Agocs2015-05-281-5/+11
| | | | | | | | | | | | | | | | | | | We take some shortcuts still because we know that with ANGLE the header with the extension constants is always available. A proper implementation would not rely on the constants being available and would dynamically check for the extension and would take care of defining the constants if not available. However, just getting the extension list to check if the functions needed to get the display are available is already a chicken-egg problem so we won't go there. Using eglGetProcAddress properly solves the issues with static builds too since this always works. Task-number: QTBUG-46284 Change-Id: Iff23669ebacaffa0c5f76fd2c928af689307874f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Gunnar Roth Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* windows: Fix platform plugin compilation with new angleAndrew Knight2015-04-091-1/+2
| | | | | | | | | The identifiers for configuring a software renderer changed. Change-Id: I739cedbb0a00bc6be94df716d66cd1520d4f7c9d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Enhance EGL_CONTEXT_LOST checksLaszlo Agocs2015-03-111-8/+25
| | | | | | | | | Apparently failures can occur not just when doing eglMakeCurrent() but also when creating window surfaces. Change-Id: Ife1210293d5120fd41352164d9c89e83fb5ce468 Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-02-101-19/+24
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro src/gui/image/qimage_conversions.cpp src/gui/opengl/qopenglextensions_p.h src/gui/text/qtextengine.cpp src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/eglfs/qeglfshooks_stub.cpp src/plugins/platforms/eglfs/qeglfsscreen.cpp src/plugins/platforms/eglfs/qeglfswindow.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp src/plugins/platforms/windows/qwindowsnativeinterface.cpp src/plugins/platforms/windows/qwindowsscreen.cpp src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/windows/qwindowswindow.h src/plugins/platforms/xcb/qxcbdrag.h src/widgets/itemviews/qabstractitemview.cpp src/widgets/kernel/qwidget.cpp src/widgets/util/qsystemtrayicon_p.h tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp Thanks to Friedemann Kleint for resolving the qwindowsfontdatabase.cpp conflicts. Change-Id: I937232c30523d5121c195d947d92aec6f129b03e
| * Merge remote-tracking branch 'origin/5.4.1' into 5.4Frederik Gladhorn2015-01-291-14/+18
| |\ | | | | | | | | | Change-Id: Idadb5639da6e55e7ac8cc30eedf76d147d8d5d23
| | * Windows/ANGLE: Fix initialization of contexts.Friedemann Kleint2015-01-281-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Immediately try to initialize a context obtained by eglGetPlatformDisplayEXT() and clear display in case it fails, falling back to eglGetDisplay(). Change-Id: Ia6c1c6da4daff6651153c854eda4fb8749bdc526 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| | * Windows: Add infrastructure to be able to a GL renderer based on GPU.Friedemann Kleint2015-01-151-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce flags for the renderer type and move code to qwindowsopengltester. Introduce QWindowsOpenGLTester::supportedGlesRenderers() where type-dependent checking can be added. Change-Id: I4bbffaf861cb0fdbea0919e081e3626fb5a872de Task-number: QTBUG-43263 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| * | Make -static -opengl dynamic builds succeedLaszlo Agocs2015-01-191-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now it breaks in qwindowseglcontext due to its ifdefs for static ANGLE-only builds. The checks for QT_STATIC should be extended with QT_OPENGL_DYNAMIC so that it continues to resolve functions dynamically in -opengl dynamic builds even when combined with -static. Task-number: QTBUG-43993 Change-Id: Iac6d0353ef16a32a22ab1db0a833fbb0165f328c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| * | Windows: make TranslucentBackground functional alwaysLaszlo Agocs2015-01-191-0/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QOpenGLWidget and QQuickWidget was not functional when WA_TranslucentBackground was set. This is due to the static "isGL" type of checks that are not suitable since 5.3 due to RasterGLSurface windows which may or may not be OpenGL windows, depending on their content. To handle this, we have to do some check on every makeCurrent and perform the necessary calls (most importantly SetLayeredWindowAttributes). Task-number: QTBUG-43854 Change-Id: If19c79482ec4f0a8b795ee710d52ed7e08b52563 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* / Expose context lossLaszlo Agocs2015-01-221-1/+11
|/ | | | | | | | | | | | | | | | | On platforms like Windows (and presumably on mobile devices too) the loss of the context (e.g. the underlying D3D device in case of ANGLE) is an event that can happen randomly and needs sufficient handling. Enhance QOpenGLContext::isValid() with the purpose of indicating context loss. Currently only the Windows EGL backend (ANGLE) has support for it. Other platforms may be added later. Task-number: QTBUG-43263 Change-Id: I8177694c1ee7cebbd5d330e34757fd94c563e6d6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* windows: fix platform compilation after ANGLE upgradeAndrew Knight2014-11-141-2/+2
| | | | | | | | | Upstream changed how WARP is meant to interact with EGL, and so the enum names changed. Change-Id: I10d4bcac71b75a1223ea8af4d3fcf584f5685a02 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Define EGL_EGLEXT_PROTOTYPES for ANGLEv5.4.0-alpha1Laszlo Agocs2014-09-061-0/+1
| | | | | | | | | Otherwise the protos are not pulled in so the ANGLE-only build cannot suceed (unless the flag is defined from somewhere else). Task-number: QTBUG-41164 Change-Id: I959d154da88f7ccc8159ec7e810ffdba0e7f50ea Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* windows: Fix dynamic opengl buildLaszlo Agocs2014-09-031-4/+4
| | | | | | | Cannot call WGL or EGL functions directly anymore. Change-Id: I0d5c6217679d87a2092c945a9b841dfd7b6c299a Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* Enable QT_ANGLE_PLATFORM selection in dynamic buildsLaszlo Agocs2014-09-031-1/+1
| | | | | Change-Id: I8ebe62ec1e024e8a0a0f9e8aeac6fb81b1095e72 Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* windows: Allow selection of ANGLE's rendererAndrew Knight2014-09-021-1/+30
| | | | | | | | | | | | The default behavior of ANGLE is to use D3D11 before falling back to D3D9. This change improves flexibility the platform plugin to explicitly create a D3D11, D3D9, or D3D11 software (WARP) context by setting the QT_ANGLE_PLATFORM to "d3d11", "d3d9", or "warp", respectively. Task-number: QTBUG-41031 Change-Id: Ie1d399c1cb0e360e5b3a6d9f2a4b28745d86cc71 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Prevent current context from becoming inconsistent upon create()Laszlo Agocs2014-09-011-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Do not show warning on null result in getProcAddressLaszlo Agocs2014-07-291-1/+1
| | | | | | | | | Other platforms do not do this either. What is more, some of the extension handling code will try to resolve functions that are not necessiarly present, and this is not an error. Change-Id: I39dad8f8d89fc45de3ea83f04727a8e38b6a3387 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* windows: Fix ANGLE function resolution in static buildsAndrew Knight2014-07-151-165/+180
| | | | | | | | | The EGL/GLES functions are now resolved statically when needed. Task-number: QTBUG-40199 Change-Id: I58c675b1c410708237475e1e5d6609ca7d6713f1 Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Load winsys and gl dynamically in the windows pluginLaszlo Agocs2014-05-221-28/+786
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dynamic builds (-opengl dynamic) are now functional on Windows. In such a build no components in Qt link to any OpenGL libraries directly and qmake will not automatically add any such libraries to the applications' makefiles. Instead, the libraries are chosen and loaded during runtime and applications are expected to use QOpenGLFunctions instead of direct OpenGLfunction calls. Set the environment variable QT_OPENGL to desktop or angle to skip testing and force the given implementation. The application attributes (AA_UseOpenGLES and such) are also taken into account. The testing logic is same as before: We try to load opengl32 and resolve a shader related function. If this fails, ANGLE is chosen. This allows utilizing full desktop OpenGL on systems that have proper drivers, while a transparent fallback to ANGLE will be done automatically for systems that don't. The latter includes also remote desktop connections. Software rendering via Mesa llvmpipe is supported too. The fallback is automatic on systems where the desktop test fails and ANGLE fails to load or initialize (e.g. due to missing libs like d3dcompiler), as long as a suitable patched build of Mesa is available. [ChangeLog][QtGui] Dynamic OpenGL implementation loading is now supported on Windows. This requires Qt to be configured with -opengl dynamic. Task-number: QTBUG-36483 Change-Id: Ie8bb25a6d55b3a1609b00150aeccd909aec27313 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Remove unused parameter from QEGLPlatformContext constructorLaszlo Agocs2014-03-101-1/+1
| | | | | | | | The API is chosen via QSurfaceFormat, the constructor argument is ignored. Remove this historical artifact. Change-Id: I4a5c1e12cb297de22f239ad0a6747c1c36168eed Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Dynamic GL switch on WindowsLaszlo Agocs2014-02-141-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>