summaryrefslogtreecommitdiffstats
path: root/src/opengl
Commit message (Collapse)AuthorAgeFilesLines
* Remove some dead code in switch statementsSergio Ahumada2012-10-291-1/+0
| | | | | | | | | | Following the Code Style described in http://qt-project.org/wiki/Qt_Coding_Style#e289ee44592e9c32d4212069f0806daf There is no need for a 'break' after a 'return'. Change-Id: I1eca350391a7e4e14e504d60b24b69982cc5ac47 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QGLTextureGlyphCache: Fix text rendering artifacts on NVIDIAJonathan Liu2012-10-261-2/+2
| | | | | | | | | | Check GL_VENDOR to test whether using NVIDIA graphics. On Linux, GL_VERSION and GL_VENDOR contains "NVIDIA". On Windows, only GL_VENDOR contains "NVIDIA". Task-number: QTBUG-27658 Change-Id: I5e74d07ecb9522d1a86ac2953415a51bbdbe8c49 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Revert hacks in text rendering code pathEskil Abrahamsen Blomfeldt2012-10-251-1/+1
| | | | | | | | | | | | | | There are a lot of hacks here and there in Qt trying to align the text in a correct way which caused regressions to appear once the default coordinate system changed. We need to remove these hacks to get a more consistent and maintainable base. This also fixes the regression introduced by changing the aliased coordinate system. Task-number: QTBUG-27667 Change-Id: I620db2ca23b7ff6c912f3a51e86e7e36bbef81f0 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Make QPen default to 1-width non-cosmetic.Samuel Rødal2012-10-221-5/+5
| | | | | | | | | | | Use the Qt4CompatiblePainting render hint when painting with QPainter to treat default constructed QPens as cosmetic still. The NonCosmeticDefaultPen render hint gets documented as obsolete, since it was in any case not respected by the raster nor OpenGL paint engine. Change-Id: I04d910e9700baf7f13a8aac07a3633014bb9283e Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* remove explicit load(qt_build_config)s from the librariesOswald Buddenhagen2012-10-191-2/+0
| | | | | | | .qmake.conf (and previously .qmake.cache) already does that for us. Change-Id: I06cc01fa45921d7bd66dda7a0f88729faeff37bd Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Change the default major version of QGLFormat to 2.Jason Barron2012-10-191-1/+1
| | | | | | | | | | | | | | | This is being changed because: - The OpenGL paint engine in Qt only supports GL2 - QML2 only supports GL2 - QSurfaceFormat has a default value of 2 Applications that want to use GL1 on a QGLWidget will have to explicitly request this format using QGLFormat::setVersion. Task-number: QTBUG-27589 Change-Id: Ieb283ef7d6e15a29ec28ce7e4363dbf477decaa7 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Ensure QOPENGLF_APIENTRY and QGLF_APIENTRY are set correctly.Jason Barron2012-10-161-0/+2
| | | | | | | | | | | | gl2ext.h only defines GL_APIENTRY and not APIENTRY so we should use this macro if it is available. Without it, code that uses QOPENGLF_APIENTRY and QGLF_APIENTRY might experience compile errors due to the differing signatures. Task-number: QTBUG-27313 Change-Id: Id79d934825928d9913138edc6e8f1b00edc89a8d Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* OpenGL: Add missing WINAPI calling convention for QGL functionsSean Harmer2012-10-131-0/+3
| | | | | | | | | | | | | | This is the QGL equivalent of commit 602cab9bb2072c5564bbb43c4125e04f98266043 Without this QGLExtensionMatcher causes stack corruption when using a core profile GL context due to the call to glGetStringi() with an incorrect calling convention. Change-Id: Ibd86645e04df8c650c182fecfc8c481dae8a75b2 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Modularize documenation buildTor Arne Vestbø2012-10-102-6/+4
| | | | | | | | | | qdocconf files can now reference $QT_INSTALL_DOCS to pick up e.g. global includes, instead of using relative paths. Qt modules will automatically get a doc target that builds and installs into the right place (including supporting shadow-builds) if they set QMAKE_DOCS before loading(qt_module). Change-Id: Ia408385199e56e3ead0afa45645a059d1a8b0d48 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* OpenGL: Don't request a context version higher than is supportedSean Harmer2012-10-031-0/+8
| | | | | | | | | | | | | | | The function wglCreateContextAttribsARB will fail if we request a context version higher than is supported. We therefore upper-bound the requested version by the version of the static context. This results in context creation succeeding and having the closest possible match to the requested format. The xcb qpa plugin is modified to operate similarly to the windows plugin in that it now creates a "static" context which is used to limit the versions of contexts requested by the user. Change-Id: I277ad7cc82edfdf7b9d8502ad921c8175feb1a4a Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* OpenGL: Propagate version and profile from QSurfaceFormat to QGLFormatSean Harmer2012-10-021-0/+2
| | | | | Change-Id: I386ec75c429f58309527532bb160679ea51e6ccc Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Fixed text drawing in OpenGL 2 paint engine.Samuel Rødal2012-10-021-2/+2
| | | | | | | | | Regressions introduced in 8d762c9caea4f8b9ff589b6c23564f4e37242745 and f4c1c2f939e1cd6e08197284edb84b202cd6749e. Task-number: QTBUG-24453 Change-Id: Ib1cb05693cde2d6066476a350eb95eaa503ee53c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Added QGLPixelBuffer implementation using framebuffer objects.Samuel Rødal2012-09-274-99/+112
| | | | | | | | | | | Instead of having QGLPixelBuffer be a unusable stub implementation we deprecate it and implement it in terms of QOpenGLFramebufferObject. Framebuffer objects are anyway the recommended replacement for pixelbuffers in modern OpenGL, as the context switching overhead is avoided. Change-Id: Ia220c358ee92813e87981d297c51d84525010322 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* OpenGL: Fix QGLFormat::openGLVersionFlags() on OS XSean Harmer2012-09-261-0/+9
| | | | | | | | | | | OS X is limited to OpenGL 3.2 and we have to explicitly request a Core profile context to get the full set of available versions as OS X does not implement the Compatibility profile. Change-Id: I8c2a6dc272416cbaf8fee44adbc4471417bf4510 Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2247-1027/+1027
| | | | | | | | 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>
* Move opengl/wid/net example docs to proper folders.Frederik Gladhorn2012-09-211-4/+4
| | | | | | Change-Id: I846439a9cf7ad965ed27a00f98dbc4ff97abe73b Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* Fixed potential use of uninitialized variable in qgl.cppSamuel Rødal2012-09-191-1/+1
| | | | | | | | If glGetBooleanv fails this variable is left uninitialized. Task-number: QTBUG-26952 Change-Id: Idb42833f2907bb66fd87c5cdb39753fca04e7438 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* OpenGL: Make use of the requested version and profile in QGLWidgetSean Harmer2012-09-191-0/+3
| | | | | | | | | | When instatiating a QGLWidget in Qt5 at present it ignores the version and profile information in the QGLFormat meaning that we always end up with an OpenGL 2.x profile rather than what we asked for. This commit properly takes the version and profile into account. Change-Id: I097f10e397c23f5d97c5fcd8d5354667da286896 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* OpenGL: Add flags and logic for newer versions of OpenGL in QGLFormatSean Harmer2012-09-192-2/+29
| | | | | Change-Id: Iad57286c36c7fd205f06abc40cca5f568d572e81 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* OpenGL: Request latest GL version when using QGLTemporaryContextSean Harmer2012-09-191-0/+7
| | | | | | | | | | | This is necessary so that QGLFormat::openGLVersionFlags() returns the complete set of versions. Without this patch the temporary context ends up obtaining an OpenGL 2.x context as the QPA plugins now prefer to use the ARB {wgl,glx}CreateContextAttribsARB function which creates contexts of the specified version (2.0 for a default QSurfaceFormat). Change-Id: I2c3e02c9d7b77d4ee0484f9e8786f41675f8a439 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* gui/opengl: Fix missing or improper include guard in headersSergio Ahumada2012-09-152-3/+7
| | | | | | | | Use an include guard in headers to ensure the header is not included more than once. Make the header guard match its file name. Change-Id: I29b41e9d33e4ea17165f44c49de0a963574dd809 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Mark (non-public API's) ctor's as explicitSergio Ahumada2012-09-141-2/+2
| | | | | | | | | Make C++ class constructors that can be used with only one required argument 'explicit' to minimize wrong use of the class. Change-Id: I12ad5b6eb1794108c6b7464a2573e84068733b03 Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Documented QtOpenGL classes that have better replacements as obsolete.Samuel Rødal2012-09-146-0/+19
| | | | | | | These have new replacements in QtGui since Qt 5.0. Change-Id: I20e8fdd4e9c14d8c626eda3072217af1858bf492 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Do not include /examples in qdocconfs.Frederik Gladhorn2012-09-111-1/+1
| | | | | Change-Id: I84a925a8be4964fae667f5a2500157283a8057d2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Doc: Centralize more common settings in 1 global qdocconf.Casper van Donderen2012-09-111-36/+1
| | | | | | | | | | All qdocconf settings that should be used by all Qt modules are now in qt-module-defaults.qdocconf. Change-Id: I2a0315a55db3fcbb0160c4392d2da98611043d83 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com> Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Removing duplicate includesSergio Ahumada2012-09-091-1/+0
| | | | | | | Do not include a header more than once Change-Id: Ia2e5d66e72988ad833cf5177a3f8aa988bf510e9 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* don't use QT_{BEGIN,END}_INCLUDE_NAMESPACE needlesslyOswald Buddenhagen2012-09-083-13/+4
| | | | | | | | these macros behave counter-intuitively, so don't use them unless the code structure really suggests their use. Change-Id: I58213b39f8a98e4368901217fac14ca49c28b8cf Reviewed-by: hjk <qthjk@ovi.com>
* Make gui/math3d classes use float rather than qrealSean Harmer2012-09-071-67/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This corrects the mismatch between using floats for internal storage and qreal in the API of QVector*D which leads to lots of implicit casts between double and float. This change also stops users from being surprised by the loss of precision when using these classes on desktop platforms and removes the need for the private constructors taking a dummy int as the final argument. The QMatrix4x4 and QQuaternion classes have been changed to use float for their internal storage since these are meant to be used in conjunction with the QVector*D classes. This is to prevent unexpected loss of precision and to improve performance. The on-disk format has also been changed from double to float thereby reducing the storage required when streaming vectors and matrices. This is potentially a large saving when working with complex 3D meshes etc. This also has a significant performance improvement when passing matrices to QOpenGLShaderProgram (and QGLShaderProgram) as we no longer have to iterate and convert the data to floats. This is an operation that could easily be needed many times per frame. This change also opens the door for further optimisations of these classes to be implemented by using SIMD intrinsics. This needs to be applied in conjunction with https://codereview.qt-project.org/#change,33548 Task-number: QTBUG-21035 Task-number: QTBUG-20661 Change-Id: I9321b06040ffb93ae1cbd72fd2013267ac901b2e Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Doc: Fix docbuild when not using -developer-build.Casper van Donderen2012-09-011-2/+2
| | | | | | | | https://codereview.qt-project.org/#change,33974 only works in the case of a developer build. Not in a normal prefix build. Change-Id: I3a3e5029cefaa9f83c5deb71665f0efa9d812819 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Doc: Simplify qtbase qdocconfs.Casper van Donderen2012-08-311-15/+2
| | | | | | | | | | We should be using the global qdocconf for the common variables. This change also allows you to just specify -installdir without using a templatedir. Change-Id: I207d279d9b5199212e896fc5ccab5c212b1896c6 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* MSVC/OpenGL: Fix warnings about macro redefinition..Friedemann Kleint2012-08-301-8/+0
| | | | | | | | Introduced by fc41ee4c92ce703f3e4374bf493505a1d847a657 . Change-Id: I4c924b0b0a38401ab02c3cc4edb7d78dbd9ef356 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Exclude the examples/widgets/doc dir for all but widgets.Frederik Gladhorn2012-08-291-0/+2
| | | | | | | | There are too many references to the QWidget lib documentation in there. On the other hand this keeps snippets working. Change-Id: I7dd63b7fba1758accea2663f7b427940a8857e32 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* Fix doc: qglcolormap is not the opengl moduleFrederik Gladhorn2012-08-241-1/+1
| | | | | Change-Id: I134aeafbabc62e36da20e0a6df667b6c1aa0c477 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* OpenGL: Use official glext.h and gl2ext.h headersSean Harmer2012-08-207-344/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* rename qt_module_config.prf => qt_module.prfOswald Buddenhagen2012-08-081-1/+1
| | | | | | | this is more logical, following the qt_plugin and qt_tool scheme. Change-Id: Ib3b2abec6728cdab260e15128b1cd78e8e6f5d6a Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* QtOpenGL: use nullary version of qRegisterMetaType<T>("T")Marc Mutz2012-07-251-1/+5
| | | | | | | | | | | Using the nullary version has the advantage that multiple calls during a program run are much more efficient, since an inlined atomic is used to store the result. For this, it requires Q_DECLARE_METATYPE(T), so add, too. Change-Id: Ic9a9013aa13ff9d8f917f9df033dd2197944f84a Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix some spelling errorsSergio Ahumada2012-07-111-1/+1
| | | | | | Change-Id: I19d3b2e9a5180b13deb828b55195404ef20be295 Reviewed-by: Daniel Teske <daniel.teske@nokia.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Remove duplicate triangulating stroker implementation.Kim Motoyoshi Kalland2012-07-064-745/+0
| | | | | Change-Id: I9d8f609c9ecb02dd25e588313bc98db4b9325974 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Clean up the EXPORT macros in qglobal.h.Thiago Macieira2012-06-294-1/+68
| | | | | | | | | | | | | | | | | | | | QtPlatformSupport is a static library. It should never export anything, so Q_PLATFORMSUPPORT_EXPORT is unnecessary. QtSql, QtXml, QtDBus, QtOpenGL and QtPrintSupport now have the macros on their own source trees. It's possible these modules might be separated out from qtbase in the future. For QtDBus, the macros are moving back to where they used to be. This also leaves qglobal.h only creating the macros for QtCore, QtGui, QtWidgets and QtNetwork, the core libraries. Q_CANVAS_EXPORT, Q_OPENVG_EXPORT and Q_COMPAT_EXPORT aren't used anywhere in the Qt sources, so simply delete them. And the Q_QUICK1_EXPORT macro in the static section was wrong, so remove it too. Change-Id: I50bdf86e783338f814903b25979721f788a7becf Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fix setMouseTracking on QGLWidgetLaszlo Agocs2012-06-232-7/+0
| | | | | | | | | Remove the function altogether. Alternatively we could call the base class implementation but there is no reason to keep this confusing, non-virtual override. Change-Id: Ie8724f7bbc6666fdace7ff777bcde99f3d8a9561 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* fix misnomer: qt_module.prf => qt_build_config.prfOswald Buddenhagen2012-06-191-1/+1
| | | | | | qt_module suggests to be congruent to qt_plugin. Change-Id: I629530bcbe2ba6c0adbdc11a275119c8aff0c953
* automatically add QT_BUILD_FOO_LIB to DEFINESOswald Buddenhagen2012-06-191-1/+0
| | | | | Change-Id: I35d9861e48469eb5cc8824e361450684047e6559 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* clean up projects from QPRO_PWD nonsense, etc.Oswald Buddenhagen2012-06-191-1/+0
| | | | | Change-Id: I4c41aedf5bfb37e31ad202cacd2312b0bdb168e2 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* auto-generate QMAKE_PKGCONFIG_REQUIRES and QMAKE_PKGCONFIG_DESCRIPTIONOswald Buddenhagen2012-06-191-2/+0
| | | | | | | less boilerplate, more accuracy Change-Id: I6cc2abd50eafb4901d987c122f10a62ec9ea9da3 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* auto-generate module prisOswald Buddenhagen2012-06-191-2/+0
| | | | | Change-Id: I654428771034221ccf424be34d5d9c7764daf3b4 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* automatically add the version header to HEADERSOswald Buddenhagen2012-06-191-2/+0
| | | | | Change-Id: I7c2e1d852ebdbc5cca7a3a31ab2b4c9ab9faffd9 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* make qt_module_config.prf install the module pri fileOswald Buddenhagen2012-06-191-1/+0
| | | | | | | | | absorb module.prf into qt_installs.prf, as that's where it belongs. add qt_install_module option and automatically set it in qt_module_config. make qt_installs use that option. Change-Id: I860616f3a29a456f7b88ddaffa09375400c8911e Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Remove unused isGLWidget variable.Kim Motoyoshi Kalland2012-06-011-1/+0
| | | | | Change-Id: I9d1a0edfce3d13ed56916b7301098aa5fbe0bc40 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Windows: Add ANGLE support.Friedemann Kleint2012-05-311-1/+2
| | | | | | | | | | | | | | | | | | - Add QWindowsEGLContext usable for ANGLE and Windows CE. - Add QWindowsEGLStaticContext containing the display for resource cleanup. - Add EGLSurface to QWindowsWindow. - Add a -angle option specifying the path to the external ANGLE installation to configure, add libraries to the mkspecs. Initial-patch-by: Jabot Corentin <corentinjabot@gmail.com> Task-number: QTBUG-24207 Change-Id: I5f80b1efb6996da7c5d70aa3720f7801c9e4c6af Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* QtOpenGL: remove \link usagesGiuseppe D'Angelo2012-05-292-62/+61
| | | | | Change-Id: I34509eaf87a91bf31a78b08c91d9a57e704d8989 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>