summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopengltexture.h
Commit message (Collapse)AuthorAgeFilesLines
* QOpenGLTexture::setData add overloads to allow specifying sub imagesPaul Lemire2019-02-271-0/+26
| | | | | | | | | | All current setData implementation only allow to specify a full size sub image for a given mip level. In some cases, we might only want to update a small region on an image, in which cases being able to specify the x, y, z offsets as well as the dimensions is required. Change-Id: I880cfcc67a814733e8ab880aa8766c87b7bc7e45 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Replace Q_NULLPTR with nullptr where possibleKevin Funk2017-09-191-18/+18
| | | | | | | | | | | | | Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Add debug operator for QOpenGLTextureFriedemann Kleint2017-05-111-0/+9
| | | | | Change-Id: If87730725d9eba8d4c1e0158056cdeaa7c1bc12f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add new APIs which is useful to upload more than one layer at onceBogDan Vatra2017-01-041-0/+6
| | | | | | | | | It's useful to upload textures storred in .KTX files without dividing the layers. It's also more efficient than uploading layer by layer. Change-Id: I92d93c57514e2a3637d1202cb83bd72b8d277edf Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Add ASTC compressionBogDan Vatra2016-12-031-0/+28
| | | | | Change-Id: I7ae3b02579eb844f109c25a0dd5467748813a558 Reviewed-by: Laszlo Agocs <laszlo.agocs@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>
* Make QOpenGLTexture a Q_GADGETPaul Lemire2016-03-181-0/+17
| | | | | | | | | | Allows to register the enums as Q_ENUM which in turn will allow Qt3D and future other modules to access these enums from QML if QOpenGLTexture is registered as an uncreatable type Task-number: QTBUG-51491 Change-Id: I037a4585cd44c7429b63f06b704f0386df842777 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>
* Add ETC1 to QOpenGLTexture formatsLaszlo Agocs2015-08-061-0/+1
| | | | | | | | | | | | | On mobile and embedded ETC1 (via GL_OES_compressed_ETC1_RGB8_texture) is still the most common (and sometimes the only) option for compressed textures, at least until GLES3 (with ETC2) becomes widely available. Note that we treat this format as unsized to prevent going on the immutable storage path as there is no word on glTexStorage and friends in the extension so that may just fail as well. Change-Id: Icbc3c6f62f314d63c4df289ef456f047c5e84cf3 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QtGui: Use Q_NULLPTR instead of 0 in all public headersMarc Mutz2015-07-191-16/+16
| | | | | | | | | This is in preparation of adding -Wzero-as-null-pointer-constant (or similar) to the headers check. Task-number: QTBUG-45291 Change-Id: I72ab40b21a9499b53a639564fa45884de17b6c98 Reviewed-by: Thiago Macieira <thiago.macieira@intel.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-1/+2
| | | | | | | | | | | | | 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>
* QOpenGLTexture: introduce texture comparison supportGiuseppe D'Angelo2015-01-171-1/+24
| | | | | | | | Shadow sampling is an old OpenGL feature (hello, OpenGL 1.3!), which was missing from QOpenGLTexture. This commit adds the relevant support. Change-Id: I9f6b552d806a356d24ee08121af6bc9ce684f2b5 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-11-271-0/+4
|\ | | | | | | Change-Id: Id20053d261b4fbbcc0ac8ba49dd3ef2253fa4b95
| * Deprecate implementations of functions deprecated in headersShawn Rutledge2014-11-271-0/+4
| | | | | | | | | | | | | | | | | | If you build with configure -DQT_NO_DEPRECATED this will avoid some build errors. Change-Id: If2b2e57b6919091f3f077ebc2aeca0c3fd2421aa Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | QOpenGLTexture: move the Feature enum on top of the headerGiuseppe D'Angelo2014-11-141-22/+22
| | | | | | | | | | Change-Id: I08f5f3b2856edbdd8c88e65d5af75d760a39facb Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | QOpenGLTexture: introduce support for Ericsson compressed formatsGiuseppe D'Angelo2014-11-141-0/+10
| | | | | | | | | | | | | | | | | | | | OpenGL 4.3 and OpenGL ES 3.0 have support for these formats out of the box. See http://en.wikipedia.org/wiki/Ericsson_Texture_Compression Change-Id: I661f05b9872f3aa128e39cec64df094a79736555 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | QOpenGLTexture: fix storage allocationGiuseppe D'Angelo2014-11-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Storage allocation was quite wrong in the general case. 1) We can't pass unsized texture formats to immutable storage allocations, so we need to check for that. 2) Second, when allocating mutable storage on GLES, apparently the driver is allowed to peek at the external pixel type. The texture can then only get data in the pixel type passed at storage allocation time. (I guess that, for the sake of simplicity, the drivers are allowed not to perform any pixel conversions.) I'm still not convinced about the wording in the GLES2/3 specifications, but apparently ANGLE behaves this way, so we need to fix this kind of allocation. Unfortunately the only way is to ask, at storage allocation time, what's the external pixel format/type, so we need to introduce an allocateStorage overload taking those as arguments and using them for the glTexImage* calls. Task-number: QTBUG-41822 Task-number: QTBUG-42623 Change-Id: Idf745d549f01c5db3e56e86cf9b1f53a77cfccc6 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | QOpenGLTexture: move all the enums at the beginning of the classGiuseppe D'Angelo2014-11-131-78/+78
|/ | | | | | | | It makes more sense to put them all together, and actually the next patches will require the enums to be moved anyhow. Change-Id: Ieb897e9ea2bfef66426c72f935504a92323e2a00 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 8_8_8_8 pixel types to QOpenGLTextureSean Harmer2014-07-241-0/+2
| | | | | | | Task-number: QTBUG-36843 Change-Id: Ief4ab9b00b075abe2e04c6d29c8d1279406b5033 Reviewed-by: Liang Qi <liang.qi@digia.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Fix support for depth/stencil textures in QOpenGLTextureGiuseppe D'Angelo2014-05-261-1/+5
| | | | | | | | | | | | | | | When allocating (mutable) storage for a texture, OpenGL mandates that the client-side format and pixel type "match" the internal format. That needs to happen even if we are not actually uploading anything (because we're passing NULL as the data parameter and no PBO is bound). This means that we need to pick a compatible format/type and not just pass GL_RGBA / GL_UNSIGNED_INT. In turn, it implies adding new enum values to the various format/type enums. Change-Id: If40c63b1d44764b3be131dd1b41d13983a19ae45 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Introduce QOpenGLTexture::target()Giuseppe D'Angelo2014-05-241-0/+2
| | | | | | | | | | To extract the target of a given texture object. Somehow this accessor was missing. Change-Id: Ie43366bed3627a20204600e68e426b55abf37af6 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Expose multisample settings on QOpenGLTextureSean Harmer2014-05-161-0/+4
| | | | | | Change-Id: I877f4139aed8bb03b798818a3fac00dab1523ce1 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* QOpenGLTexture: fix support for 1D texturesGiuseppe D'Angelo2014-02-071-1/+2
| | | | | | | | | OpenGL ES 2 doesn't support 1D textures. So introduce a proper feature flag and warn if we try to allocate one there. Change-Id: I73cf58c1f257d2472564f45bff222231e39aca52 Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QOpenGLTexture: Introduce const void * image upload methodsGiuseppe D'Angelo2014-01-311-8/+33
| | | | | | | | | | An API oversight caused the image upload methods to take a "void *", which is not necessary at all. The underlying texture uploading calls (i.e. the gl(Compressed)Tex(Sub)Image<N>D family) all take a "const void *". The methods taking a "void *" get deprecated. Change-Id: Idfda58d4d7d0af1f335e5cbad7d700f4ccad652c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Enable QOpenGLTexture for OpenGL ES 2Jorgen Lind2013-11-141-2/+15
| | | | | Change-Id: I3ec2b7af303070c92e86c0f5ca729eb1a1731682 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QOpenGLTexture: mark (QImage) ctor explicitMarc Mutz2013-11-141-1/+1
| | | | | | | Disables implicit conversions from QImage to QOpenGLTexture. Change-Id: I09b4d236dde8eae5258e6a954f4e02b4451990bd Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QOpenGLTexture: mark (Target) ctor explicitMarc Mutz2013-11-141-1/+1
| | | | | | | Disables implicit conversions from Target to QOpenGLTexture. Change-Id: I2edd2dc4528a311577f0b7df4f6ce22696336a88 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Long live QOpenGLTexture!Sean Harmer2013-09-221-0/+488
Task-number: QTBUG-33274 Change-Id: I9259d947d11f8ba330a2cd7f5620d8f1af0a804b Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>