summaryrefslogtreecommitdiffstats
path: root/src/opengl
Commit message (Collapse)AuthorAgeFilesLines
* QGLWidget: Support retina framebuffer grabbingGabriel de Dietrich2013-05-231-3/+4
| | | | | | | | | And update the opengl/grabber example. Task-number: QTBUG-31173 Change-Id: If09f1f3634b353d034f51240fc68be6ee7aabb48 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Fixed crash associated with reparenting a QGLWidgetSamuel Rødal2013-05-222-1/+12
| | | | | | | | | | | | | | | We need to make sure that we don't reset() the context when the QGLWidget is being reparented, as that will lead to the QOpenGLContext being destroyed and not recreated, leading to a crash in makeCurrent(). Also, don't destroy() the widget if it has not yet been created, as in that case there's no ParentAboutToChange event sent. Task-number: QTBUG-31016 Change-Id: I409fff94456802a80bd72b470a6fbaee87505baa Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Doc: Fix invalid exampledirs in qtopengl.qdocconfTopi Reinio2013-05-101-2/+0
| | | | | | | | | Remove redundant and invalid exampledirs definition from .qdocconf for Qt Open GL module. Change-Id: I5a725bf57d78b2fd35aa4dbd24e8cb3881499ed3 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: Give C++ class lists consistent titlesSze Howe Koh2013-04-292-2/+2
| | | | | | | | | | | | | The majority format is "<Qt Module> C++ Classes" (see http://qt-project.org/doc/qt-5.0/qtdoc/modules-cpp.html) Also, fix a broken link (Qt Network C++ Classes) "<Qt Module> C++ API" is perhaps the more correct format, but that's part of a much bigger cleanup: QTBUG-30556 Change-Id: I753365e2bec8d85d9a5f686b4aa35c9eeeaf0871 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: Fix module name in .qdocconfTopi Reinio2013-04-261-11/+11
| | | | | | | | | Use CamelCase for module name(s) used in in .qdocconf - this is required as qdoc will generate visible output (tags in example manifest files) based on these names. Change-Id: Ie246e740203ee0b996fea5dee612bf7f61638991 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Fixed QGLWidget not being able to be made current with a context.Samuel Rødal2013-04-231-4/+9
| | | | | | | | | | | If the QGLWidget's creation is triggered by a sibling or similar being created it would end up without the surface type OpenGLSurface. We need to make sure the QWindow has the correct surface type to prevent QOpenGLContext::makeCurrent() from failing. Task-number: QTBUG-30811 Change-Id: Ifc85f9120d89bd0bed4a3911233799830cb3a0f3 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Make QGLPaintEngine work on retina displays.Morten Johan Sørvig2013-04-151-0/+6
| | | | | | | | | | | | | | QGLWidgetGLPaintDevice::size now returns the size in device pixels. This fixes the QPainter "overpainting" and GraphicsView with a QGLWidget viewport use cases. Task-number: QTBUG-30217 Change-Id: I01998d39d7b4d755cf8b7b3fab5f75cd0d899ccf Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Add devicePixelRatio metric to QPaintDevice.Morten Johan Sørvig2013-04-153-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously QPainter computed the devicePixelRatio based on the physical and logical dpi, and expected that the ratio between them would be either 1x or 2x. This was problematic for paint devices like printers where the physical dpi can be much higher than the logical dpi, and also for QScreen where the physical dpi would have to be defined as a multiple of the logical dpi. Add QPaintDevice::PdmDevicePixelRatio and QPaintDevice:: devicePixelRatio() getter and implement it for the QPaintDevice subclasses. Use it when calculating the highdpi scale transform in qpainter.cpp and when scaling the clip rect in qwidget.cpp. Remove physical dpi scaling for QImage, QPixmap and QOpenGLPaintDevice, reverting to the old behavior. Change-Id: I6c97510613196d4536ff39d08e9750b8782283d4 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Remove unused private membersThiago Macieira2013-03-231-1/+0
| | | | | | | | | | | | | These members are in private classe, so we can safely remove them. qpathclipper.cpp:762:9: error: private field 'm_point' is not used [-Werror,-Wunused-private-field] qsimpledrag_p.h:100:20: error: private field 'm_cursor_drop_action' is not used etc. Change-Id: I35ed486eb959c49bb971700500a66411308ee7bc Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Merge branch 'dev' into stableOswald Buddenhagen2013-03-2030-1703/+415
|\ | | | | | | | | | | | | | | | | | | | | | | This starts Qt 5.1 release cycle Conflicts: src/gui/text/qfontdatabase.cpp src/gui/text/qharfbuzz_copy_p.h src/widgets/kernel/qapplication.cpp src/widgets/kernel/qcoreapplication.cpp Change-Id: I72fbf83ab3c2206aeea1b089428b0fc2a89bd62b
| * Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-162-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove all trailing whitespace from the following list of files: *.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README excluding 3rdparty, test-data and auto generated code. Note A): the only non 3rdparty c++-files that still have trailing whitespace after this change are: * src/corelib/codecs/cp949codetbl_p.h * src/corelib/codecs/qjpunicode.cpp * src/corelib/codecs/qbig5codec.cpp * src/corelib/xml/qxmlstream_p.h * src/tools/qdoc/qmlparser/qqmljsgrammar.cpp * src/tools/uic/ui4.cpp * tests/auto/other/qtokenautomaton/tokenizers/* * tests/benchmarks/corelib/tools/qstring/data.cpp * util/lexgen/tokenizer.cpp Note B): in about 30 files some overlapping 'leading tab' and 'TAB character in non-leading whitespace' issues have been fixed to make the sanity bot happy. Plus some general ws-fixes here and there as asked for during review. Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
| * Introducing the Qt Android portPaul Olav Tvete2013-03-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on the Necessitas project by Bogdan Vatra. Contributors to the Qt5 project: BogDan Vatra <bogdan@kde.org> Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> hjk <hjk121@nokiamail.com> Oswald Buddenhagen <oswald.buddenhagen@digia.com> Paul Olav Tvete <paul.tvete@digia.com> Robin Burchell <robin+qt@viroteck.net> Samuel Rødal <samuel.rodal@digia.com> Yoann Lopes <yoann.lopes@digia.com> The full history of the Qt5 port can be found in refs/old-heads/android, SHA-1 249ca9ca2c7d876b91b31df9434dde47f9065d0d Change-Id: Iff1a7b2dbb707c986f2639e65e39ed8f22430120 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-181-2/+2
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/styles/qmacstyle_mac.mm Change-Id: If8326db9e7da3cbf45dbf7475fdff9915c7723b1
| * \ Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Giuseppe D'Angelo2013-02-176-35/+10
| |\ \ | | | | | | | | | | | | refs/staging/dev
| | * \ Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-146-35/+10
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/concurrent/doc/qtconcurrent.qdocconf src/corelib/doc/qtcore.qdocconf src/corelib/global/qglobal.h src/dbus/doc/qtdbus.qdocconf src/dbus/qdbusmessage.h src/gui/doc/qtgui.qdocconf src/gui/image/qimagereader.cpp src/network/doc/qtnetwork.qdocconf src/opengl/doc/qtopengl.qdocconf src/opengl/qgl.h src/plugins/platforms/windows/qwindowswindow.cpp src/printsupport/doc/qtprintsupport.qdocconf src/sql/doc/qtsql.qdocconf src/testlib/doc/qttestlib.qdocconf src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf src/widgets/doc/qtwidgets.qdocconf src/xml/doc/qtxml.qdocconf Change-Id: Ie9a1fa2cc44bec22a0b942e817a1095ca3414629
| * | | | Remove duplicated code for handling OpenGL extensions in QtOpenGLTor Arne Vestbø2013-02-1715-1606/+365
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now re-use QOpenGLExtensions/Functions from QtGui in the same way as QtGui uses these classes. There is still some duplicated logic in qglfunctions.cpp, but this code now at least uses the shared QOpenGLExtensionMatcher class. Change-Id: Ie04008c43d430ae805e6ec1c45e7e363deeb3b8f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
| * | | Use QPaintEngineEx to decide if font is too big for using the glyph cacheTor Arne Vestbø2013-02-071-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of having separate logic in the OpenGL paint engine. Change-Id: I9854328f784864e52ba1bbaafe5e1c5dda976231 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
| * | | Fix change-of-sign warning found by ICCThiago Macieira2013-02-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qdbusintegrator_p.h(119): error #68: integer conversion resulted in a change of sign : QMetaCallEvent(0, -1, 0, sender, -1, 0, 0, 0, s), connection(c), node(n), ^ qpaintengineex_opengl2_p.h(193): error #68: integer conversion resulted in a change of sign void updateTextureFilter(GLenum target, GLenum wrapMode, bool smoothPixmapTransform, GLuint id = -1); ^ Change-Id: I7de381ea9ff348878ee99e5a18525352a779b31e Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| * | | 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
| * | | | | 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
| * | | | | 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>
* | | | | | Make sure QGLWidget::setContext() is correctly documented as obsolete.Samuel Rødal2013-03-151-1/+7
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-30017 Change-Id: Idf3c943d7aaad294cbf6858cca1c01e841e94b7d Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | | | | Fixed error in QGLFramebufferObject and QOpenGLFramebufferObject docs.Samuel Rødal2013-02-151-2/+2
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | It's the format class that lets you control the number of samples. Change-Id: Id01f107a15787f33b65429d3c882854f2dc8784e Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | | | Rename function to fix symbol clash in static buildKai Koehne2013-02-113-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename qt_gl_read_framebuffer function to qt_gl_read_frame_buffer in Qt5OpenGL. This fixes an error when linking statically against both Qt5Gui and Qt5OpenGL: Qt5Guid.lib(qopenglframebufferobject.obj) : error LNK2005: "class QImage __cdecl qt_gl_read_framebuffer(class QSize const &,bool,bool)" (?qt_gl_read_framebuffer@@YA?AVQImage@@ABVQSize@@_N1@Z) already defined in Qt5OpenGLd.lib(qgl.obj) Creating library debug\composition.lib and object debug\composition.exp The function was duplicated in 6e28e844 . Change-Id: I9e3b78e0ec5b25264575d563538587b45cd93e86 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | | | Fixed missing support for single buffered OpenGL on OS X.Samuel Rødal2013-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-28804 Change-Id: I426a9bbc08953d777f67a23b050570e9f7d442d7 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* | | | Merge "Merge branch 'release' into stable" into refs/staging/stableSergio Ahumada2013-02-011-27/+1
|\ \ \ \
| * \ \ \ Merge branch 'release' into stableSergio Ahumada2013-01-311-27/+1
| |\ \ \ \ | | |_|_|/ | |/| | | | | | | | Change-Id: If3aa1b7ed75082eff6e9761ad82c83691135ed60
| | * | | Remove out-dated duplicate logic from qgl.hSean Harmer2013-01-271-27/+1
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now use the updated logic for #including the correct GL headers already implemented in QtGui. This is needed to fix compilation of QtOpenGL on CentOS 5.8 and RHEL. Change-Id: Ifdedd13885566016073538f33aa6daf5902c3497 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | / / substitute fixed version numbers in qdocconf files with variablesOswald Buddenhagen2013-02-011-1/+1
|/ / / | | | | | | | | | | | | | | | Change-Id: Ie57765c10a8e90d6fc74ee5a8fd84bfc7cd8bcf2 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* | / 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>
* | Update copyright year in Digia's license headersSergio Ahumada2013-01-1847-47/+47
|/ | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@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>