summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl
Commit message (Collapse)AuthorAgeFilesLines
* Don't include windows.h in the public qopengl.h headerVolker Hilsheimer2024-01-161-11/+30
| | | | | | | | | | | | | | | | | | | | All we need are the APIENTRY and WINGDIAPI macros, as those are used in the gl.h header. Define those locally for the time we need them. Use a QT_APIENTRY macro instead of hijacking APIENTRY for when we declare OpenGL functions with the stdcall calling convention. A few build fixes needed in tests that used Windows types without explicitly including windows.h first, or that (incorrectly) included one of the sub-headers of windows.h (like winuser.h). [ChangeLog][Potentially Source-Incompatible Changes][OpenGL] On Windows, the public qopengl.h header no longer includes windows.h. Pick-to: 6.7 Fixes: QTBUG-120687 Change-Id: I3770ac8eaeee5bcf4e7234e5a2539935a8aa5a7d Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* QOpenGLWidget: use (and prefer) InvalidateFramebufferGiuseppe D'Angelo2023-07-252-10/+22
| | | | | | | | | | | | | | | | | | | | Desktop GL does not have the GL_EXT_discard_framebuffer extension at all. Instead, it may have GL_ARB_invalidate_subdata. Furthermore, GLES >= 3.0 and GL >= 4.3 both support FBO invalidation through glInvalidateFramebuffer. Extend the semantics of OpenGLExtension::DiscardFramebuffer to mean that *any* possibility above is supported, and wrap it in a helper function that calls whatever support is present. (This is all private API anyhow.) Technically speaking glInvalidateFramebuffer supports a superset of what glDiscardFramebufferEXT supports, but we never use such superset, and the two APIs are otherwise identical. Then, make QOpenGLWidget call that wrapper. Change-Id: I64e042daf51493d3834c3ba1b53ae6e224bbc4ed Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* rhi: Introduce multiview starting with OpenGL (ES)Laszlo Agocs2023-06-222-1/+7
| | | | | | Fixes: QTBUG-114770 Change-Id: Ibb1ced7f19d15a5116c60e95fd3e6b86ace63155 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Make it a QPA-style private but semi-public APILaszlo Agocs2023-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qrhi.h, qshader.h, qshaderdescription.h (and qshaderbaker.h from shadertools; done separately) become "RHI APIs", following the concept of QPA APIs. Mirror completely what is done for QPA headers, but using the "rhi" prefix for the headers. This involves updating syncqt to handle the new category of headers. (a note on the regex: matching everything starting with "qrhi" is not acceptable due to incorrectly matching existing and future headers, hence specifying the four header names explicitly) There is going to be one difference to QPA: the documentation for everything RHI is going to be public and part of the regular docs, not hidden with \internal. In addition to the header renaming and adding the comments and documentation notes and warnings, there is one significant change here: there is no longer a need to do API-specific includes, such as qrhid3d11[_p].h, qrhivulkan[_p].h, etc. These are simply merged into a single header that is then included from qrhi.h. This means that users within Qt, and any future applications can just do #include <rhi/qrhi.h> (or rhi/qshader.h if the QRhi stuff is not relevant), no other headers are needed. There are no changes to functionality in this patch. Only the documentation is expanded, quite a lot, to eliminate all qdoc warnings and make the generated API docs complete. An example, with a quite extensive doc page is added as well. Task-number: QTBUG-113331 Change-Id: I91c749826348f14320cb335b1c83e9d1ea2b1d8b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Misc.: Fix some narrowing integral conversion warningsAhmad Samir2023-04-252-5/+6
| | | | | | | Drive-by change: use QByteArrayView instead of allocating a QByteArray. Change-Id: Iaf7acbbdb4efbb101b73b30061ce38dd1fa99ca3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Default NVidia EGL to GLES2Allan Sandfeld Jensen2023-04-121-2/+6
| | | | | | | | | | | | | Found some documentation saying NVidia provided desktop GL for development purposes only, and recommmended against using it. Not sure if that applied to all NVidia drivers, or only that one embedded platform, but since we have multiple bugs about EGL not working on NVidia, default to using GLES2 like it suggested. Change-Id: If8ac8dd61c4ceb88162360f1eaa2a096acefa9c6 Pick-to: 6.5 6.2 Fixes: QTBUG-105921 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* rhi: Add support for half precision vertex atttributesBen Fletcher2023-02-272-2/+6
| | | | | | | | | | | | | | | | | | | Runtime support is indicated via QRhi::Feature::HalfAttributes. OpenGL support is available in OpenGL 3.0+, OpenGL ES 3.0+, and in implementations that support the extension GL_ARB_half_float_vertex. Other RHI backends (Vulkan, Metal, D3D11, and D3D12) all support this feature. Note that D3D does not support the half3 type. D3D backends pass half3 as half4. tst_qrhi auto unit test included. Change-Id: Ide05d7f62f6102ad5cae1b3681fdda98d52bca31 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add QEGLContext::invalidateContextThomas Senyk2023-01-121-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | QEGLContext::invalidateContext will mark that egl context is invalide and trigger SceneGraph to destroy it, create a new one and re-create and re-upload all resources (e.g. textures) associated with the current state of the SceneGraph In addition this change also improves QEglFSWindow::invalidateSurface() and QEglFSContext::eglSurfaceForPlatformSurface(..) Where QEglFSWindow::invalidateSurface() will now destroy the corresponding EGLSurface via eglDestroySurface, including "unbinding" it from the current thread via eglMakeCurrent and un-setting the screen's EGLSurface in case it's the same resource. QEglFSContext::eglSurfaceForPlatformSurface(..) will now call QEglFSWindow::resetSurface() in case of getting a EGL_NO_SURFACE from the QEglFSWindow (which happens if above invalidateSurface() was called before) - therefor re-creating the resource if it was destoyed via QEglFSWindow::invalidateSurface() Pick-to: 6.5 Change-Id: I37badd1fc11e993c395fb1502e9bd27ebe18b821 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Doc: Fix qt_attribution.json files using Path for filesKai Köhne2023-01-101-2/+2
| | | | | | | | | | Since qttools commit 39fdcb8e7a, qtattributionsscanner fails if 'Path' is not a directory. Use the 'Files' attribute instead. Pick-to: 6.4 6.5 Fixes: QTBUG-110002 Change-Id: I65fecdcb852ce9abea55f168cd939804bae9ae80 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* OpenGL: add support for Win11 detectionYuhang Zhao2022-10-301-12/+5
| | | | | | | | The current code can't distinguish between Windows 10 and Windows 11, this patch fixes that. Change-Id: I8269f0544c09205ae9845b7981f4a86c664bee09 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Replace usages of Q_CLANG_QDOC with Q_QDOCLuca Di Sera2022-10-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | To allow the user to customize the C++ code that QDoc sees, so as to be able to work-around some limitations on QDoc itself, QDoc defines two symbols: Q_QDOC and Q_CLANG_QDOC, both of which are "true" during an entire execution of QDoc. At a certain point in time, QDoc allowed the user the choice between a custom C++ parser and a Clang based one. The Q_QDOC symbol would always be defined while the Q_CLANG_QDOC symbol would be defined only when the Clang based parser was chosen. In more recent times, QDoc always uses a Clang based parser, such that both Q_CLANG_QDOC and Q_QDOC are always defined, making them equivalent. To avoid using different symbols, and the possible confusion and fragmentation that derives from it, all usages of Q_CLANG_QDOC are now replaced by the equivalent usages of Q_QDOC. Change-Id: I5810abb9ad1016a4c5bbea99acd03381b8514b3f Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* OpenGL: Remove pre-Win10 leftoversYuhang Zhao2022-09-301-9/+0
| | | | | | | | | | | | Qt6's minimum supported platform is Win10 1809, and all pre-Win10 code have already been removed from QtBase long time ago. These code are trying to support Windows 7 to Windows 8.1, which nowadays become legacy code and should be removed. Pick-to: 6.4 Change-Id: I21a979d32d99977107964bccc06fdec7b38cd727 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* qputenv: port to QByteArrayViewMarc Mutz2022-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | The vast majority of in-tree users pass simple and short C string literals as the value. By porting to QByteArrayView, we document that we'll accept non-NUL-terminated data, and do the NUL-termination internally, using SSO'ed std::string, saving memory allocations in the common case of short strings. I didn't bother to check which direction std::string takes for nullptrs these days (there was a change accepted in that area for C++20 or 23), so play it safe and protect against them. Follow-up to Task-number: QTBUG-105302 Change-Id: I2369acc62f1d5cbc26135396cfe0602d8c75300c Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Make EGL use Qt X connection without xcb_xlib with EGL_EXT_platform_xcbIlya Fedin2022-07-051-0/+4
| | | | | | | | This allows to create EGL context without involving Xlib. This extension was created a year ago and is present in Mesa since 21.0 Change-Id: I7cb0aece1e67b4db59d453cbcfbd317bb5d9c777 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Add a way to declare _exported_ logging categoriesGiuseppe D'Angelo2022-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a library declares a logging category that needs to be used by clients (e.g. via inline methods, macros, etc.), then the logging category function generated by Q_DECLARE_LOGGING_CATEGORY has to be exported. We've seen this problem with Q_NAMESPACE, Q_GADGET, etc.: these macros also declare functions or objects that in some cases need to be exported. And precisely like Q_NAMESPACE, Q_GADGET, etc., people end up relying on the implementation details of Q_DECLARE_LOGGING_CATEGORY (specifically, what does it expand to) in order to place the export directives in the right place. Introduce a more robust solution and apply it around qtbase. Cleanup some minor code as a drive-by (remove `extern` and useless semicolons). [ChangeLog][QtCore][QLoggingCategory] Added the Q_DECLARE_EXPORTED_LOGGING_CATEGORY macro, in order to allow dynamic libraries to declare a logging category that can be then used by client code. Change-Id: I18f40cc937cfe8277b8d62ebc824c27a0773de04 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Port QXlibEglIntegration::getCompatibleVisualId to xcbIlya Fedin2022-06-202-163/+0
| | | | | | | | | | In combination with EGL_EXT_platform_xcb support, this allows xcb_egl to be used without xlib. Without EGL_EXT_platform_xcb support, this still reduces amount of code using xlib. Pick-to: 6.4 Change-Id: I29e2b29f7ef8ea34320887f62697f84232b86fba Reviewed-by: Liang Qi <liang.qi@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-1622-836/+44
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QtGui: replace remaining uses of QLatin1String with QLatin1StringViewSona Kurazyan2022-04-281-1/+1
| | | | | | Task-number: QTBUG-98434 Change-Id: I98c27030c783f968cbf38dc966ce486dc366b302 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QtGui: use _L1 for for creating Latin-1 string literalsSona Kurazyan2022-04-283-28/+32
| | | | | | Task-number: QTBUG-98434 Change-Id: Idcb71c1d27125333a53b6bdd3e1af0d4c66617fa Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* egl: Remove the disabling of surfaceless contexts for MesaLaszlo Agocs2022-04-271-9/+0
| | | | | | | | | The current check is based on the state of things in 2015, we will assume that this is no longer an issue with more modern Mesa versions. Change-Id: I60c4966eea817a6df1a1edf6064a978fbcd44cf7 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QtGui: stop using QLatin1Char constructor for creating char literalsSona Kurazyan2022-04-131-1/+1
| | | | | | | | | Required for porting away from QLatin1Char/QLatin1String in scope of QTBUG-98434. Change-Id: I308d86cefcbfd126929b68f9a853d420840c965f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Make sure all qtbase private headers include at least one otherThiago Macieira2022-02-242-0/+2
| | | | | | | | | | See script in qtbase/util/includeprivate for the rules. Since these files are being touched anyway, I also ran the updatecopyright.pl script too. Change-Id: Ib056b47dde3341ef9a52ffff13ef677e471674b6 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* qopengl.h: Move C header #include(s) out of the QT_NAMESPACEPatrick Stewart2022-01-221-2/+1
| | | | | | | | | | | | | | | | The Clang backend of MSVC declares nullptr_t in namespace std there, then expects to find it under ::std::nullptr_t to define a ::nullptr_t. That breaks with a namespaced build, of course. Fix by moving the QT_BEGIN_NAMESPACE to just before the first typedef that declares a Qt-owned name. Done-with: Marc Mutz <marc.mutz@qt.io> Pick-to: 5.15 6.2 6.3 Fixes: QTBUG-95309 Change-Id: I56f2709c4664a7d0de84918f43b6d53cb3710612 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rhi: gl: Do not just rely on GL_COMPRESSED_TEXTURE_FORMATSLaszlo Agocs2022-01-062-1/+11
| | | | | | | Pick-to: 6.3 6.2 Task-number: QTBUG-98937 Change-Id: I64f2783ae64ad3ef77a389999ded4c9ba2c46ee5 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Revert "Add support for EGL_EXT_platform_xcb"Paul Olav Tvete2021-11-021-4/+0
| | | | | | | | | | | This reverts commit 816c5de460439faac0745cb364c374162b7fc651. Reason for revert: Causes crash on Nvidia when Qt is configured with -opengl es2 Fixes: QTBUG-97738 Change-Id: I9fe43146b922fc770890a144fdb1bd1c564635bb Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* gui: Fix typos in source code commentsJonas Kvinge2021-10-121-1/+1
| | | | | | Pick-to: 5.15 6.2 Change-Id: Ie53e5542a8f93856470982939ecd8ec90b323d69 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* gl: Try the local CacheLocation when the shared one failsLaszlo Agocs2021-10-082-20/+45
| | | | | | | | | | | | | | | | | | | | | | We prefer the shared cache path, because there is no reason to give up benefitting from sharing the content between applications. If that path is not QFileInfo().isWritable(), we fall back to the local cache path. However, there are reportedly systems with security solutions such as AppArmor where the writable check passes and yet attempting to create a file still fails. Then there is no cache in effect, because nothing ever gets written out. Handle this better: if writing the file fails and we still use our first choice, the global cache location, fall back to the secondary choice (the app-local path) and try again. Pick-to: 6.2 6.1 5.15 Fixes: QTBUG-96789 Change-Id: Ifea32e9af0cf85aa70f3069256ed3d6a7e2fbe90 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Dalton Durst <dalton@ubports.com> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add support for EGL_EXT_platform_xcbIlya Fedin2021-10-061-0/+4
| | | | | | | | This allows to create EGL context without involving Xlib. This extension was created a year ago and is present in Mesa since 21.0 Change-Id: Id9bcbffe8c46cb00d9cc0a9a425c1706d1b52b28 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Cater for upstream changes in eglplatform.hLaszlo Agocs2021-09-211-1/+5
| | | | | | | | | | | | | EGL_NO_X11 has been replaced with USE_X11, thus breaking all existing code out there, including Qt: https://github.com/KhronosGroup/EGL-Registry/pull/130 Fix this by defining USE_X11 whenever we do not define EGL_NO_X11. Fixes: QTBUG-96392 Pick-to: 6.2 Change-Id: If8b68caa8c9022477d87169ca2e2a0121a9313e0 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Remove conditioning on Android embeddedEdward Welbourne2021-09-172-4/+4
| | | | | | | | It is no longer handled separately from Android. This effectively reverts commit 6d50f746fe05a7008b63818e77784dd0c99270a1 Change-Id: Ic2d75b8c5a09895810913311ab2fe3355d4d2983 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Expose the config and display for EGL-based QOpenGLContextsLaszlo Agocs2021-09-131-0/+2
| | | | | | | | | | | | | | | | ...in the native interface. Using OpenXR is impossible on some platforms (for example, Android) without knowing all three. The EGLContext alone is not enough, and EGL offers no way to query the EGLConfig a context was created with. https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_KHR_opengl_es_enable Therefore, expose all three so libs/apps can use the new way to query these native resource without resorting to the old-style nativeResourceFor* queries. Change-Id: I7efb0a26b858150da55e711752af99426e744322 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Support EGL protected content extensionElvis Lee2021-03-091-0/+11
| | | | | | | | | | | | | | | | | | | | A protected context is required to allow the GPU to operate on protected resources, including protected surfaces and protected EGLImages. For example, GPU can post-process on protected content like DRM protected content so that complex, nonlinear video effects or mapping onto textures can be used. The surface format option may be relevant for DirectX and Vulkan in the future: https://microsoft.github.io/DirectX-Specs/d3d/ProtectedResources.html https://www.khronos.org/registry/vulkan/specs/1.1-khr-extensions/html/chap12.html#memory-protected-memory Change-Id: I2d155f0e68b830276690b4833b22a2bc452cdcad Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* egl: Add debug option to print all EGLConfigsLaszlo Agocs2021-02-081-0/+15
| | | | | | | | | QT_QPA_EGLFS_DEBUG=1 prints the attributes for the chosen EGLContext. Make QT_QPA_EGLFS_DEBUG=2 print the same for all EGLContexts. Pick-to: 6.1 Change-Id: Id161d04789fbd015e29e5a5a89a0901000096ea3 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-074-62/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Fix links to OpenGL documentationAndreas Buhr2020-12-081-199/+199
| | | | | | | | | | | Some links were broken. Some stated to be pointing to OpenGL ES 2.0 documentation but pointed to OpenGL ES 3.2 documentation. Task-number: QTBUG-88533 Pick-to: 6.0 Change-Id: Iad25d8f709b8fa9421039d5cb51cee21093e3191 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Another round of replacing 0 with nullptrAllan Sandfeld Jensen2020-10-071-1/+1
| | | | | | | | | This time based on grepping to also include documentation, tests and examples previously missed by the automatic tool. Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Rename the new platform APIs from QPlatformInterface to QNativeInterfaceTor Arne Vestbø2020-10-071-1/+1
| | | | | | | | | | | | We were already using the 'native' nomenclature when referring to these kinds of APIs, e.g. when talking about native handles, or the existing QPlatformNativeInterface on a QPA level. Using 'native' for the user facing APIs also distinguishes them from the 'platform' backend layer in QPA and elsewhere. Change-Id: I0f3273265904f0f19c0b6d62471f8820d3c3232e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Switch QSurfaceFormat::colorSpace to a QColorSpaceAllan Sandfeld Jensen2020-09-151-8/+15
| | | | | | | Allows more flexibility in the future. Change-Id: Idcf2d8ddaee268a7b5d55379ccb42dd9b3c33abf Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Do not expose xlib as public dependency of QtGuiJoerg Bornemann2020-09-111-1/+1
| | | | | | | | Consumers of QtGui should link explicitly to xlib if needed. Fixes: QTBUG-86421 Change-Id: Ibc94eb1c1ac405b53749b320c388b037bf693a08 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove deprecated method QOpenGLFunctions::initializeGLFunctions()Marcel Krems2020-09-082-11/+0
| | | | | Change-Id: I0c02b22630f8c9d463f48f6402a1930b60d3f818 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Move eglconvenience to QtGuiFriedemann Kleint2020-07-1313-0/+2667
| | | | | | | Task-number: QTBUG-83255 Change-Id: I8a008d8906308dd73a0793db5b88d3a1b6fdaf5c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Move glxconvenience into QtGuiFriedemann Kleint2020-07-105-0/+569
| | | | | | | | | OpenGL is not quite as dead as initially assumed. Task-number: QTBUG-83255 Change-Id: I953040149812a5258caad5fe6bac0835e1982dd0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix define indentation in qopengl.hTor Arne Vestbø2020-07-011-5/+5
| | | | | Change-Id: I7894fcadf1a0abecbd8206abae1b035c823d52c4 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Use QList instead of QVector in guiJarek Kobus2020-06-291-1/+1
| | | | | | | | Applied to headers only. Source file to be changed separately. Task-number: QTBUG-84469 Change-Id: Ic08a899321eaffc46b8461aaee3dbaa4d2c727a9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add RHI feature check for screen space derivativesEskil Abrahamsen Blomfeldt2020-06-122-1/+8
| | | | | | | | | | | | | | Fragment shader functions like fwidth() are useful for antialiasing distance field text in the case of perspective projections. In order to enable this as an alternative code path, we need to detect support. - OpenGL: Supported with GL_OES_standard_derivatives or GLES3 and up - Direct 3D: Supported for ps_2_x, so always supported on Direct3D 11 - Vulkan/Metal: Always supported Task-number: QTBUG-84695 Change-Id: I5e3fa8014c808a9a2d639305c5e90ec25d44655c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Never include windows.h directly in Qt codeLars Knoll2020-05-271-1/+1
| | | | | | | Please use qt_windows.h instead, so we avoid having min/max defined. Change-Id: Ic1b29666c427bf24556da5494af45ee5953ae827 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Get rid of QT_OPENGL_ES*Eskil Abrahamsen Blomfeldt2020-04-176-160/+160
| | | | | | | | | | | The QT_OPENGL_ES* macros are leftovers from an earlier, ad hoc configuration system, which has since been replaced by QT_CONFIG. To clean things up in Qt 6, we use the new way instead. Task-number: QTBUG-83467 Change-Id: I578dc7695bff9d5ee303b22e44f60fee22fe0c28 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move versioned OpenGL functions from QtGui to QtOpenGLJohan Klokkhammer Helsing2020-04-1661-105288/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The context—which lives in QtGui—now knows nothing about versioned functions. This changes the public API for getting version functions for a context. [ChangeLog][QtGui][OpenGL] QOpenGLContext::versionFunctions() has been removed. QOpenGLVersionFunctionsFactory::get() from the QtOpenGL module should be used instead. Previously one would call context->versionFunctions<QOpenGLFunctions_4_0_Core>(); Which now becomes QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_4_0_Core>(context); The rest of the API should be identical. Since glgen no longer compiles, and the links to its input (gl.spec and gl.tm) are dead, I've edited the previously generated files manually. If glgen is fixed, it should be quite easy to make it generate the new way. Task-number: QTBUG-74409 Change-Id: I800527e0af16a79005b276eeb74417770193c62f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Change qHash() to work with size_t instead of uintLars Knoll2020-04-093-4/+4
| | | | | | | | | | | This is required, so that QHash and QSet can hold more than 2^32 items on 64 bit platforms. The actual hashing functions for strings are still 32bit, this will be changed in a follow-up commit. Change-Id: I4372125252486075ff3a0b45ecfa818359fe103b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-081-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/opengl/doc/src/cube.qdoc src/corelib/global/qlibraryinfo.cpp src/corelib/text/qbytearray_p.h src/corelib/text/qlocale_data_p.h src/corelib/time/qhijricalendar_data_p.h src/corelib/time/qjalalicalendar_data_p.h src/corelib/time/qromancalendar_data_p.h src/network/ssl/qsslcertificate.h src/widgets/doc/src/graphicsview.qdoc src/widgets/widgets/qcombobox.cpp src/widgets/widgets/qcombobox.h tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro tests/manual/diaglib/debugproxystyle.cpp tests/manual/diaglib/qwidgetdump.cpp tests/manual/diaglib/qwindowdump.cpp tests/manual/diaglib/textdump.cpp util/locale_database/cldr2qlocalexml.py util/locale_database/qlocalexml.py util/locale_database/qlocalexml2cpp.py Resolution of util/locale_database/ are based on: https://codereview.qt-project.org/c/qt/qtbase/+/294250 and src/corelib/{text,time}/*_data_p.h were then regenerated by running those scripts. Updated CMakeLists.txt in each of tests/auto/corelib/serialization/qcborstreamreader/ tests/auto/corelib/serialization/qcborvalue/ tests/auto/gui/kernel/ and generated new ones in each of tests/auto/gui/kernel/qaddpostroutine/ tests/auto/gui/kernel/qhighdpiscaling/ tests/libfuzzer/corelib/text/qregularexpression/optimize/ tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/ tests/libfuzzer/gui/text/qtextdocument/sethtml/ tests/libfuzzer/gui/text/qtextdocument/setmarkdown/ tests/libfuzzer/gui/text/qtextlayout/beginlayout/ by running util/cmake/pro2cmake.py on their changed .pro files. Changed target name in tests/auto/gui/kernel/qaction/qaction.pro tests/auto/gui/kernel/qaction/qactiongroup.pro tests/auto/gui/kernel/qshortcut/qshortcut.pro to ensure unique target names for CMake Changed tst_QComboBox::currentIndex to not test the currentIndexChanged(QString), as that one does not exist in Qt 6 anymore. Change-Id: I9a85705484855ae1dc874a81f49d27a50b0dcff7