summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopengltexturehelper_p.h
Commit message (Collapse)AuthorAgeFilesLines
* More nullptr usage in headersKevin Funk2019-03-141-9/+9
| | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.7' into devEdward Welbourne2016-08-011-4/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure 5.7 now supports clang on android; but dev re-worked configure src/gui/kernel/qevent.h One side renamed a parameter of a constructor; the other added an alternate constructor on the next line. Applied the rename to both for consistency. tests/auto/tools/moc/tst_moc.cpp Each side added a new test at the end. .qmake.conf Ignored 5.7's change to MODULE_VERSION. configure.json No conflict noticed by git; but changes in 5.7 were needed for the re-worked configure to accommodate 5.7's stricter handling of C++11. Change-Id: I9cda53836a32d7bf83828212c7ea00b1de3e09d2
| * Merge remote-tracking branch 'origin/5.6' into 5.7Edward Welbourne2016-07-261-4/+12
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qtemporarydir.cpp One side encapsulated a repeated piece of #if-ery in a local define; the other added to the #if-ery. Made its addition to the other's. src/corelib/kernel/qeventdispatcher_unix_p.h One side moved some members into a struct; this collided with a #undef check that neither side now has. Discarded the #undef part. src/gui/opengl/qopengltexturehelper_p.h 5.7 deleted a bunch of methods; not clear why merge got confused. src/tools/moc/moc.cpp One added a name to the copyright header; another changed its URL. Change-Id: I9e9032b819f030d67f1915445acf2793e98713fa
| | * Workaround clang function export bugBogDan Vatra2016-07-201-17/+25
| | | | | | | | | | | | | | | | | | | | | Should be reverted when https://github.com/android-ndk/ndk/issues/142 is fixed. Change-Id: Ie68807062247bee4969bc9aa00b0221c8147fed7 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | | Add qtguiglobal.h and qtguiglobal_p.hLars Knoll2016-07-031-1/+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>
* | Don't resolve GL 1 symbols in the texture helperLars Knoll2016-03-011-121/+19
| | | | | | | | | | | | | | | | | | We already have these symbols resolved in QOpenGLFunctions, so simply use those. Change-Id: I6047181dbe47be9b0a83656af454d0ca1f3df6eb Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Updated license headersJani Heikkinen2016-01-151-13/+19
|/ | | | | | | | | | | 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>
* Make compressed textures work with mutable storageLaszlo Agocs2015-08-081-6/+31
| | | | | | | | | | | | | | | | | | 1. glTexImage*D does not accept compressed formats. 2. Replacing it with glCompressedTexImage*D is not an option as per GLES 2.0 spec since passing null data is not allowed. 3. glCompressedTexSubImage*D must always be preceded by a glCompressedTexImage*d (or glTexStorage*D) call. 4. Therefore the only way is to do nothing in allocateStorage() and switch to glCompressedTexImage*D in setCompressedData() whenever mutable storage is in use. This makes ETC1 textures working on the Beaglebone (and presumably others). Change-Id: I21a040f6ed4aecaa494b6e5a6c6cd75b7389c15c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Update copyright headersJani Heikkinen2015-02-111-6/+6
| | | | | | | | | | | | | | | | | | 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 mipmap levels and texture comparison work with GLES 3.0+Laszlo Agocs2015-02-071-0/+14
| | | | | | | | | | | | | In ES-only builds (-opengl es2) we hit the QT_OPENGL_ES_2 path which disables all this. Not ideal since all the support is present in GLES 3.0. Therefore, stop relying on the ifdef and do runtime checks. This also needs defining the constants manually since they are not available in gl2.h and our own ES2 extension headers provide some of these with silly silly suffixes. Change-Id: I8ad7f5091a371bad1e3c6dc4898342a175016274 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.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>
* Add missing private headers warningSamuel Gaist2014-09-041-0/+11
| | | | | Change-Id: I7a4dd22ea3bcebf4c3ec3ad731628fd8f3c247e0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.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>
* QOpenGLTextureHelper: add a clarifying commentGiuseppe D'Angelo2014-02-071-1/+3
| | | | | | Change-Id: Ia27fd6616b2259b3fbe71ea8737b270c323a1256 Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QOpenGLTextureHelper: de-inline the DSA / DSA emulator wrappersGiuseppe D'Angelo2014-02-061-383/+118
| | | | | | | | | | | | There's no advantage at keeping them inline because we never call them directly: we take pointers to them. This can actually cause multiple copies of the function to be emitted, then the linker may or may not decide to discard N-1 copies. Just avoid this route and deinline them. Change-Id: I5adc704b50ec7f26498846fcbb86cb5b5d016b4b Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QOpenGLTextureHelper: fix the DSA emulationGiuseppe D'Angelo2014-02-031-150/+174
| | | | | | | | | | | | | | | | | | | | | | The DSA emulator functions query which texture is currently bound to a given target, then bind the new one, perform an operation, and bind the old one back. The problem is that in order to query what's currently bound to the GL_TEXTURE_<X> target one needs to call glGetIntegerv passing GL_BINDING_TEXTURE_<X>. Since both GL_TEXTURE_X and GL_BINDING_TEXTURE_X values are completely arbitrary (not contiguous nor related in any way) we need to pass *both* them to the functions. The right GL_BINDING_TEXTURE_X was getting already chosen (and stored) at texture creation time by QOpenGLTexture, so it's just a matter of passing it around. For the "real" DSA functions, the binding target is ignored. Change-Id: Ida823abbfb142d4a22bf9f9a762b160b7e281c6d Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Enable QOpenGLTexture for OpenGL ES 2Jorgen Lind2013-11-141-0/+8
| | | | | Change-Id: I3ec2b7af303070c92e86c0f5ca729eb1a1731682 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Long live QOpenGLTexture!Sean Harmer2013-09-221-0/+1078
Task-number: QTBUG-33274 Change-Id: I9259d947d11f8ba330a2cd7f5620d8f1af0a804b Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>