summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopenglextensions_p.h
Commit message (Collapse)AuthorAgeFilesLines
* More nullptr usage in headersKevin Funk2019-03-141-1/+1
| | | | | | | | | | | Diff generated by running clang-tidy's modernize-use-nullptr checker on the CMake-based Qt version. Skipping src/3rdparty, examples/, tests/ Change-Id: Ib182074e2e2fd52f63093f73b3e2e4c0cb7af188 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Move texture uploading out of QOpenGLTextureCacheAllan Sandfeld Jensen2018-07-271-1/+2
| | | | | | | | | | | This way the logic can be reused elsewhere. At the same time a standard OpenGL ES/3 way of handling BGRA is added, so we don't depend on extensions, and handling of NPOT and max size which QSGTexture will need. Change-Id: I475bc7127f44be3964fdb482c9e86a20db1fbca5 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add qtguiglobal.h and qtguiglobal_p.hLars Knoll2016-07-031-0/+1
| | | | | | | | | | | | | | | | | | | | The new modular configuration system requires one global header per module, that is included by all other files in this module. A similar scheme and naming convention is already being used for many other modules (e.g. printsupport, qml, quick). That header will later on #include the configuration file for Qt Gui. For now it defines the Q_GUI_EXPORT macro for this library. In addition, add a private global header, qtguiglobal_p.h, that can later on include the private config header for Qt Gui for things we don't want to export to the world. Change-Id: Id9ce2a4f3d2962c3592c35e3d080574789195f24 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Get rid of the gles3helper classLars Knoll2016-03-011-195/+7
| | | | | | | | | Since the backends can now resolve all possible GL functions, there's no need for the special handling for GLES that this class did anymore. Change-Id: Ib48aecc9a892f3c883d76ffc82217f346dbb3adc Reviewed-by: Laszlo Agocs <laszlo.agocs@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>
* Expose GLES 3.0 and 3.1 functionsLaszlo Agocs2015-07-231-76/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the approach we already do for some GLES 3.0 functions we can provide a cross-platform, cross-GL-GLES wrapper for ES 3.0 and 3.1 functions too. Applications only have to take extra care about the version requests (context version and version directives in shader code), the rest of their code can stay the same across desktop/mobile/embedded, even when ES 3 functions are used. The new functions are placed to a new subclass which is placed between QOpenGLFunctions and the internal QOpenGLExtensions. This is necessary because, unlike with QOpenGLFunctions, there is no guarantee that these functions are always available in all configurations. When running on desktop OpenGL, we resolve as usual. If the OpenGL version contains the function in question, either in core or as an extension, it will all just work. This is handy because it does not rely on 4.x extensions like GL_ARB_ESx_compatibility, and so ES 3.0 functions will be functional on OpenGL 3.x systems too by just setting a 3.x version number in the QSurfaceFormat. We will no longer qFatal on broken systems where the driver returns a 3.0 or 3.1 context without the corresponding functions present. Instead, we show a warning and gracefully fall back to resolving as usual, via eglGetProcAddress or similar. For functions that are available in ES2 as an extension this may just work fine. Added also an example that runs identically both with OpenGL and OpenGL ES 3 and utilizes some ES 3.0 features like instanced drawing. [ChangeLog] Added QOpenGLExtraFunctions providing OpenGL ES 3.0 and 3.1 function wrappers in a cross-platform manner. Task-number: QTBUG-46161 Change-Id: I9f929eb61946c35c415b178c4d6ab2c1c958684e Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Do not use 16 bits per color on GLESLaszlo Agocs2015-06-291-1/+2
| | | | | | | unless GL_EXT_texture_norm16 (and so GL_RGBA16) is present. Change-Id: Ic15b81b8134fda147e96301b7f78cabe07a05d9e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Don't try to load opengl extensions or functions without QLibraryUlf Hermann2015-06-121-1/+2
| | | | | Change-Id: If77ca6e04c83d94fd3063b68963b1bcd90980d99 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Fix GLES3 functions on iOSLaszlo Agocs2015-05-181-0/+3
| | | | | | | Task-number: QTBUG-45933 Change-Id: I784e34c1cfee5ea69955c221f0448c1d04e0b6d7 Reviewed-by: jian liang <jianliang79@gmail.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Use glFinish() in QOpenGLWidget unless glFlush() is known to be enoughLaszlo Agocs2015-03-231-0/+5
| | | | | | | | | | | | | | | | | | | | The driver used on the Odroid-XU3 does not like doing just glFlush() before accessing the texture in another context. There is no guarantee that glFlush() is enough to sync access to resources between contexts, so start using glFinish() as the default, except on common desktop hw + iOS where flush is enough and presumably more efficient. To unify the code pathes, remove the separate flushes and do it only once, before the backingstore compositor indicates that it is about to access the textures. This should improve performance a bit, esp. when doing multisampling since we flush only once then. A helper function is added to the internal QOpenGLExtensions because it is highly likely that QQuickWidget will need the same. Task-number: QTBUG-45106 Change-Id: Ifb405c5723f29f2f6c04df8e15fb70280681755e Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Prevent crashing on ES2 SDK - ES3 device scenarios with AndroidLaszlo Agocs2015-02-121-0/+3
| | | | | | | | | | | | | | Making a build with an older NDK having only gl2.h results in crashing QOpenGLTexture on devices that provide ES 3.0 or 3.1. This is because immutable storage is supported (based on runtime checks) but the function pointers are not there (due to ifdef checks). Fix this like we did in other places: get rid of the ifdef and dlsym the ES3-only symbols. Task-number: QTBUG-44397 Change-Id: Ief518ec8c7d532aeea0075ba166baf8d22e66ec5 Reviewed-by: Sean Harmer <sean.harmer@kdab.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-0/+27
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Resolve GLES3 functions from the shared libLaszlo Agocs2015-01-101-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately the few functions that are part of the OpenGL ES 3.0 standard and are used by QtGui have to have special handling after all. Just directly calling the functions causes issues when building on a GLES3 capable system and deploying somewhere where only GLES2 is available. Using eglGetProcAddress and such is not an option because the ES spec does not guarantee that standard functions are resolvable via that mechanism. Task-number: QTBUG-43318 Change-Id: I72f985d75ca669835839016573cbb8e4a3fb41db Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Add GL_EXT_discard_framebuffer to QOpenGLExtensionsJørgen Lind2014-12-111-1/+13
|/ | | | | Change-Id: I57e8dd2ea2e6f018a46eaabed2ca8b6d417358a3 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Pass a sized format when creating multisampled renderbuffers on ESLaszlo Agocs2014-10-031-1/+2
| | | | | | | Task-number: QTBUG-40921 Change-Id: I96b05442dd5928992dab06553b3d41feca89084d Reviewed-by: BogDan Vatra <bogdan@kde.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Remove wrong unneeded definition in qopenglextensions_p.hAllan Sandfeld Jensen2014-10-021-12/+0
| | | | | | | | The types are already defined by qopengl.h, and the GLchar could be incorrectly defined in the Qt namespace for GLES2 namespaced builds. Change-Id: Ia2052599538af51fdadc434935d51bbfe8437453 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Add support for glMapBufferRange in the wrappers and resolversLaszlo Agocs2014-08-081-1/+15
| | | | | | | | | | | | | | QOpenGLBuffer::map() and related helpers are becoming useless in OpenGL ES 3.0 and up: instead of the old GL_OES_map_buffer, glMapBufferRange, but not glMapBuffer, is now part of the standard. On desktop GL_ARB_map_buffer_range is present by default in OpenGL 3.0 and newer. [ChangeLog][QtGui] Added QOpenGLBuffer::mapBufferRange(). Task-number: QTBUG-38168 Change-Id: I4e9bbe8ced9ee4d535ac32849a8c08c26d79cb49 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Remove non-existent function from headerLaszlo Agocs2014-03-211-2/+0
| | | | | | | | This is a leftover from the QGL->QOpenGL migration, the function never existed in the QOpenGL variant of the class. Change-Id: I47bdfb7f65ffc6cdd39b353e3a69900ccf10e4fc Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* OpenGL: Use official glext.h and gl2ext.h headersSean Harmer2012-08-201-478/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Khronos group makes the glext.h (Desktop OpenGL) and gl2ext.h (OpenGL ES2) headers officially available nowadays. Most (all?) Linux systems ship this by default. On Windows platforms the glext.h file needs to be downloaded from http://www.opengl.org/registry/api/glext.h and placed alongside the system OpenGL header. Making use of the official header reduces the maintenance overhead for OpenGL support in Qt by removing the need to copy and paste definitions into the Qt sources. As the Khronos-provided headers are standardised and backwards and forwards compatible we can utilise these for all platforms rather than just for Windows. This means that all definitions required by Qt will be present even if the system ships out-dated equivalents. Mac OS X needs special handling in that we should always use the system-provided headers there. This is because Apple controls the OpenGL driver and the headers that go along with it. As such there is no possibility that the driver exposes additional functionality compared with the system-provided OpenGL headers. Apple has also decided to make different decisions about some OpenGL typedefs compared to other implementations. For example, Apple typdefs GLhandleARB to void* whereas other platforms use unsigned int. The alternative, which is to use the system provided glext.h (or gl2ext.h) header means that Qt code would need to check for the availability of such definitions wherever it is not guaranteed to be provided by core OpenGL/ES just to compile. The proposed approach means that Qt can compile regardless of the system's OpenGL extension support. We just need to be rigourous in runtime checking of support for extensions but that is already a requirement (and is missing in a few places, see TODO's added in this commit). The official Khronos headers are added to Qt as qopenglext.h - Desktop OpenGL qopengles2ext.h - OpenGL ES2 They need to be public but not part of QtGui module include, hence the headers have been modified by adding #if 0 #pragma qt_no_master_include #endif to them. This has been tested on: Gentoo Linux with GCC 4.6.3 Windows 7 with MSVC 2010 Mac OSX 10.8 with Apple clang 4.0 (based on LLVM 3.1svn) QNX with qcc (based on GCC 4.4) A small change is needed to QtDeclarative when building for OpenGL ES 2 after applying this commit. See https://codereview.qt-project.org/#change,31794 Change-Id: I4b3d2b1680baf4c78be9a87b4d8de076d23e8f82 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | 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>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-251-1/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Build on Windows/clean build on Linux.Friedemann Kleint2011-08-291-6/+7
| | | | | | | Change-Id: I26552e85a8e8c63002db93b7d9b645981620f0af Reviewed-on: http://codereview.qt.nokia.com/3738 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Copy core GL functionality to QtGui with QGL -> QOpenGL naming.Samuel Rødal2011-08-291-0/+676
Change-Id: Ibc989afa4a30dd184d41d1a1cd89f97196e48855 Reviewed-on: http://codereview.qt.nokia.com/3710 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>