summaryrefslogtreecommitdiffstats
path: root/src/opengl
Commit message (Collapse)AuthorAgeFilesLines
* Drop the unused qt_gl_convertToGLFormat functionGiuseppe D'Angelo2013-01-291-5/+0
| | | | | | Change-Id: Ie621f562401b703077a2b304ad6d8445efc76642 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Drop the unused QGLContextPrivate::convertToGLFormat functionGiuseppe D'Angelo2013-01-292-13/+0
| | | | | | Change-Id: Iaa176fc6152162c91a3e3bd373a235883001975c Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2013-01-293-3/+3
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-283-3/+3
| |\ | | | | | | | | | Change-Id: I12b4d8b99bdccae53b1a978cd6eb8f4ac6fb3c76
| | * Doc: Fix module name formatSze Howe Koh2013-01-253-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation QtCore -> Qt Core QtDBus -> Qt D-Bus QtDesigner -> Qt Designer QtGui -> Qt GUI QtImageFormats -> Qt Image Formats QtNetwork -> Qt Network QtPrintSupport -> Qt Print Support QtScript -> Qt Script QtSql -> Qt SQL QtSvg -> Qt SVG QtTest -> Qt Test QtWebKit -> Qt WebKit QtWidgets -> Qt Widgets QtXml -> Qt XML QtConcurrent -> Qt Concurrent (partial) QtQuick -> Qt Quick (partial) Also, distinguish between "module" and "library" Change-Id: Icb8aa695ae60b0e45920b0c8fce4dc763a12b0cd Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | | Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-2914-55/+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>
* | Don't assume m11/m22 represents the scale of a QTransformTor Arne Vestbø2013-01-241-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | We can still assume it when pulling out the scale of the glyph cache, since we limit it to scaling, but when computing the scale from the current matrix we have to decompose it. We always use a positive scale in the glyph-cache, and let the drawing code take care of any flipping of the coordinates. Change-Id: Ie3c4f2d91008a9be8f89bef29c15d80b23fb8a82 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-2247-47/+47
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-1847-47/+47
| | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Add support for retina glyph-based text drawing in the GL paint-engineTor Arne Vestbø2013-01-212-9/+26
| | | | | | | | | | | | | | | | | | | | Instead of always using a non-transformed glyph-cache we now allow a scaled glyph-cache so that retina-screens can take advantage of this. We take the cache's scale into account when positioning and drawing the glyphs so that the scale is not applied twice. Change-Id: Ia927656f0070df61e78da76e97d2c49de4d856d9 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | 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>