summaryrefslogtreecommitdiffstats
path: root/src/opengl
Commit message (Collapse)AuthorAgeFilesLines
* Bump Qt version to 5.1.0Frederik Gladhorn2013-01-151-1/+1
| | | | | | Change-Id: I6d372c933e48eeda921fe781b073bf4e05b31585 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: David Faure (KDE) <faure@kde.org>
* Refactor paint/font-engine shouldDrawCachedGlyphs and supportsTransformationsTor Arne Vestbø2013-01-102-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some cruft had built up over time, and this is an attempt at cleaning up the naming and use of these functions, and should not have any behavioral effects. The function supportsTransformations() has been renamed in QPaintEngineEx to reflect its use, which is to decide if QPainter needs to pre-transform the coordinates of the static text before asking the paint-engine to draw it. The new name is requiresPretransformedGlyphPositions(). The OpenGL and CoreGraphics (Mac) paint engines keep their behavior of not needing pre-transformed text, while the raster engine needs this when using cached glyphs. The base-class implementation assumes that all transforms that include a projection will need pre-transform, which is also the case for the raster engine. All decisions in the paint engines about whether or not to use the glyph cache when drawing text are now deferred to the function shouldDrawCachedGlyphs(), which has been refactored for the GL paint engine(s) to share more logic. All implementations call the base class implementation, which ensures that large font sizes will not be cached. The raster engine will in addition ask the font engine whether or not it can produce glyphs for the glyph-cache with the given transform. This is the only remaining instance of the supportsTransformations() function, and will for all font engines except the CoreText engine support affine transformations. The CoreText engine on the other hand only supports translations (for now). Change-Id: I8fb5e43e3de3ef62a526a79a6dfeda7f9546771d Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Fix bug in multisampling handling when converting from surface formatSean Harmer2013-01-021-2/+2
| | | | | | | | | Task-number: QTBUG-28875 Change-Id: If72ce0669de8f344603d2da53eeb5644bd5c4f82 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Jonathan Liu <net147@gmail.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Bump Qt version to 5.0.1Sergio Ahumada2012-12-211-1/+1
| | | | | Change-Id: Ie8f437b8dfe8a67c7b34321439dd988a02612437 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fixed deadlock situation in QtOpenGL's texture management.Samuel Rødal2012-12-141-0/+5
| | | | | | | | | | | | | | | | | | QGLTextureCache::remove(qint64 key) locks the QGLContextGroupList mutex before removing a texture. Removing the texture might cause the QGLShareContextScope construct to be invoked, which calls QGLContext::currentContext(), which will wrap a current QOpenGLContext in a newly created QGLContext. That also triggers the creation of a QGLContextGroup object, which will register itself with the QGLContextGroupList, an operation that again will lock the QGLContextGroupList mutex. To prevent this from deadlocking we make the mutex recursive. The whole QGLShareContextScope approach is really broken and should be replaced, but for now it's what we have in QtOpenGL (QtGui has the replacement QOpenGLSharedResource). Change-Id: Id1ff69035af3f31b690892c03f74748d052a278b Reviewed-by: Zeno Albisser <zeno.albisser@digia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Docs: Fix referencesChristian Stenger2012-12-131-1/+2
| | | | | Change-Id: I48173186afb874d307010f4f303d0e4f97ec0287 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* OpenGL Examples: added example path for QtCreatorChristiaan Janssen2012-12-121-0/+2
| | | | | | | This was introduced in patch 8534bb3d, then overwritten by c85ca8d1. Change-Id: I6b7489e2b2f3311822c282f50c74bd68c787229d Reviewed-by: hjk <qthjk@ovi.com>
* properly syncqt-ize harfbuzz headersOswald Buddenhagen2012-12-041-2/+0
| | | | | | | | | we were already installing them into QtCore/private, so turn them into proper private headers to start with. this cleans up our project files. Change-Id: I0795f79e03b60b5854de9e4dc339e9b5a5e6fd87 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Doc: Edited Qt OpenGL configuration to output correct QCH titles.Jerome Pasion2012-12-031-2/+3
| | | | | | Task-number: QTBUG-28341 Change-Id: I7d990c66a9efe42719165564007fb3bdff2e1279 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Basic high-dpi "retina" support for Qt 5.Morten Johan Sørvig2012-12-012-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Bring Qt 5 on par with Qt 4, prepare for more comprehensive support later on. Introduce device independent pixels (dips), device pixels, and devicePixelRatio. Add high-dpi support to QPainter, QGLWidget, the cocoa platform plugin, mac and fusion styles. Dips are similar to CSS pixels, Apple points and Android density-independent pixels. Device pixels are pixels in the backing store/physical pixels on screen. devicePixelRatio is the ratio between them, which is 1.0 on standard displays and 2.0 on "retina" displays. New API: QImage::devicePixelRatio() and setDevicePixelRatio() QPixmap::devicePixelRatio() and setDevicePixelRatio() QWindow::devicePixelRatio() QScreen::devicePixelRatio() QGuiApplicaiton::devicePixelRatio() Change-Id: If98c3ca9bfdf0e1bdbcf7574cd5b912c9ff63856 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* OpenGL: Remove bogus error in textures example on ES 2 platformsSean Harmer2012-12-011-0/+2
| | | | | | | | | | | | The call to glGetBooleanv(GL_FRAMEBUFFER_SRGB_CAPABLE_EXT) in QGLExtensions::currentContextExtensions() was resulting in an invalid enum on ES 2 systems. This was not being cleared and subsequentally being interpreted as a failed texture upload in the textures example. This enum doesn't exist on ES 2 so don't query it. Change-Id: I84f9c4b0aa8b11b6036eeed1f9378d110d9ea69d Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Fix example documentation for OpenGL module and (widget) Tools.Gunnar Sletta2012-11-302-0/+46
| | | | | Change-Id: Id9dc39752bcae915f618e1a5696115a5e6923251 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Added explicit threading API to QtOpenGL.Samuel Rødal2012-11-308-25/+84
| | | | | | | | | | | | | | | | | | | | | | | | Since QtOpenGL/QGLContext is implemented in terms of QtGui/QOpenGLContext which has stricter requirements about how it's supposed to be used, we need to apply these requirements to QGLContext as well. This change adds QGLContext::moveToThread(QThread *) and documents it as a necessity for making a context current on another thread. Also introduces QGLPixelbuffer::context() to access the QGLContext of a pixelbuffer, and made QGLWidget::context() return a non-const QGLContext, since there's no good reason why it shouldn't, and it leads to less const_cast clutter. We could have introduced a backdoor in QOpenGLContext instead, making it loosen its requirements, but that would have made it harder / impossible to fully support threaded OpenGL in all the platforms. Task-number: QTBUG-22560 Change-Id: Ibb6f65f342e7c963e80cc42ab5664c5f1cab30b0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Fix Qt OpenGL overview.Lars Knoll2012-11-303-33/+118
| | | | | Change-Id: Ib95638a8eb306e5ababa47cc61e1b5db4ae6cb31 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Remove legacy classes from "Painting in 3D" list.Gunnar Sletta2012-11-281-8/+0
| | | | | Change-Id: I099dd940145629a67266d02bde7217ea9fbc9372 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Commented confusing QWriteLocker use in QGLTextureCache::getTexture().Samuel Rødal2012-11-271-0/+1
| | | | | | Task-number: QTBUG-22560 Change-Id: Idd3948455e8415473a407f66b628418c0d87898d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Properly deprecated QGLFramebufferObject and QGLFramebufferObjectFormatSamuel Rødal2012-11-271-1/+5
| | | | | | Change-Id: I9affdcce0988e3538c8a7a696999a7cf8c3448aa Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Improve OpenGL docsJan Arve Saether2012-11-278-2/+15
| | | | | | | | | * Mark all Open GL classes with \inmodule QtOpenGL. Otherwise, they weren't listed in the list of classes. * Remove a reference to Motif Change-Id: I75680712b212cf46b869014d3678b56d022c6323 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Fixed crash in tst_qglthreads.Samuel Rødal2012-11-261-1/+1
| | | | | | | | | | | | QGLTextureCache has a read write locker to protect texture lookups. However, even calling QCache::object() might modify the cache, causing race conditions, since it modifies the priority order of the objects in the cache. Therefore, we need to protect it with a QWriteLocker instead of a QReadLocker. Task-number: QTBUG-22560 Change-Id: I46fffc624ace27e25fb100f865e1df0a19b9093d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Fix example paths in example manifests that are used by Qt Creator.Eike Ziller2012-11-261-0/+2
| | | | | | Task-number: QTBUG-27801 Change-Id: I345c009fc0e4e1c1eabb43ad142e3b474e7a6fee Reviewed-by: hjk <qthjk@ovi.com>
* Get rid of deprecated functionality in QtOpenGL.Samuel Rødal2012-11-224-90/+4
| | | | | | | | | We will in any case not be able to support this in Qt 5, so best to just remove it to not give any false impressions. Change-Id: Ib52e86007b9e6483bd973f13502b078792a9fa40 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Made renderText() work in samplebuffers example.Samuel Rødal2012-11-221-23/+17
| | | | | | | | | | | Since the OpenGL paint engine is now OpenGL 2.0 based, we need to save and restore all GL state to prevent it from being clobbered. Task-number: QTBUG-27020 Change-Id: I39831e074aa818583df34c4a88b13be559d0231b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Properly initialize glViewport() to appropriate value in QGLPixelBuffer.Samuel Rødal2012-11-211-0/+1
| | | | | | | | | | Since we are using a hidden window in order to make the context current, the viewport will end up with an arbitrary value. By setting it explicitly we ensure compatibility with Qt 4. Task-number: QTBUG-28115 Change-Id: I69fb5efda2b274b539c3d3b9fa842a2d32ad70b1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge branch 'newdocs'Eskil Abrahamsen Blomfeldt2012-11-201-14/+8
|\ | | | | | | | | | | | | | | | | | | | | Added prepare_docs to qt_build_config.prf (it was added directly in configure in the source branch) Conflicts: configure tools/configure/configureapp.cpp Change-Id: I1337c69fc62b1c934e3e39b4409e4857440c9db8
| * Doc: Cleaning up QHP information in module configuration files.Jerome Pasion2012-11-071-12/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a common standard among all Qt modules. These changes affect the final .qch file for each module. Changes: 1)URL in qt-project.org is confirmed by DevNet maintainer url = http://qt-project.org/doc/<module> 2)Landing page title mapping indexTitle = landing page 3)"C++ Classes" as a child node. The list of C++ classes and the titles are specified in the wiki. 4)Removed extra subprojects. They are not needed for now. Each module may need additional nodes. Change-Id: I1825476c21fe9aaddc9d6b512ff74229f17271a0 Reviewed-by: Martin Smith <martin.smith@digia.com>
| * Merge branch 'master' of ssh://codereview.qt-project.org/qt/qtbase into newdocsJerome Pasion2012-11-022-3/+2
| |\ | | | | | | | | | Change-Id: I7e6cee190a341901dfbf8effb54ebccb91bf7a17
| * | Doc: Removed the HTML template from the .qdocconf filesJerome Pasion2012-10-261-1/+0
| | | | | | | | | | | | | | | | | | | | | -qt-module-defaults.qdocconf already contains the HTML template. Change-Id: I5757741166f0f688ce0e8a4e77ed45fd4d72f1c7 Reviewed-by: Martin Smith <martin.smith@digia.com>
| * | Merge remote-tracking branch 'gerrit/master' into newdocsTor Arne Vestbø2012-10-262-8/+6
| |\ \ | | | | | | | | | | | | Change-Id: I10cf9f915c602c8e5a0e7d7c9e17b7bc5ca00640
| * \ \ Merge remote-tracking branch 'gerrit/master' into newdocsTor Arne Vestbø2012-10-191-1/+1
| |\ \ \ | | | | | | | | | | | | | | | Change-Id: If7f46d56cf0b0b79f7fc8955a01964121b900d07
| * \ \ \ Merge remote-tracking branch 'gerrit/master' into newdocsTor Arne Vestbø2012-10-161-0/+5
| |\ \ \ \ | | | | | | | | | | | | | | | | | | Change-Id: If2168c519daf45390af04af9ef9722770453a493
| * | | | | doc: Add a bunch of missing dependsTor Arne Vestbø2012-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I32c3730f8181d73a7c8e36ef382c74b8da754269
* | | | | | Fixed memory leak in assign operator of QGLBufferVadim Zakondyrin2012-11-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Icb51dd5a567483b415ab0e8af9eb62221225890d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | | | | | Make QGLWidget::paintGL() call glClear().Morten Johan Sorvig2012-11-031-0/+1
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Creating and displaying a plain QGLWidget on Mac would display "garbage" or previous frame buffer content on screen. This looks broken and raises interesting privacy concerns. Fix by adding a call to glClear(). Change-Id: I507c24275e41fac0be5f518c5a70d151099ae6b8 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | | | | 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>