summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix warnings building with --std=c++11 and gcc 8Allan Sandfeld Jensen2018-12-141-1/+1
| | | | | | | Silence warnings about signed constants being shifted out of int range. Change-Id: I5dc397de71f4de09e54ce3cbc0f8e3a1cf977b03 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-11-191-19/+0
|\ | | | | | | | | | | | | Conflicts: src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm Change-Id: I66a08c770767a93cd26535689e3e7806486aab06
| * Purge some unused code for the OpenGL library nameEdward Welbourne2018-11-121-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We had a global static, a setter for it (that's nowhere used within Qt code) and a getter for it whose only use was commented out. Neither was declared in any header; the getter's commented-out client had a local extern declaration at the point of (non-)use. Found while reviewing a change to the next few lines of code after the commented-out use of the getter. Change-Id: I393d56219cb7dd7cf836ca80e1bdd605a2914003 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | Be more explicit about the effects of swapBuffers() on the current contextTor Arne Vestbø2018-08-061-1/+2
| | | | | | | | | | Change-Id: I7ab9e4e7323d49cf19774bfd0c51f8516ecb842d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | QGLWidget: Gracefully handle failed makeCurrent during resize and paint eventTor Arne Vestbø2018-07-201-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | The underlying QOpenGLContext may fail to be made current, e.g. if the surface is not exposed, or the graphics hardware is not available. Instead of trying to initialize and resize the GL viewport with a non-current context, we return early and defer the init and resize until later. Change-Id: I278ca8f1ad4d3da2d5be18b44d775f8d6c8af726 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | qdoc: properly omit comments for enums marked with omitvalueChristian Ehrlicher2018-03-271-6/+6
|/ | | | | | | | | | When a value is omitted with \omitvalue, the comment must be either deleted or omitted with \omit .. \endomit. Otherwise the comment is merged into the comment for the previous value Change-Id: Ic5cfb20d36853526ae939529b4609712cd0eb341 Reviewed-by: Martin Smith <martin.smith@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Add more Q_FALLTHROUGH()Friedemann Kleint2018-01-121-11/+11
| | | | | | | | Silence g++ 7.X warnings. Change-Id: Id06d06e7e3b5be2cf3934d81f1891da58dea2649 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Use QT_CONFIG(library) instead of QT_NO_LIBRARYUlf Hermann2017-03-061-1/+0
| | | | | | | | | | | | | For the windows file system engine, we add an extra macro to use library loading if configured to do so, but avoid it on WinRT, as none of the symbols would be found. We also QT_REQUIRE_CONFIG(library) in the library headers and exclude the sources from the build if library loading is disabled. This, in turn, makes it necessary to clean up some header inclusions. Change-Id: I2b152cb5b47a2658996b6f4702b038536a5704ec Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-011-0/+11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/win/msvc_version.cpp configure.pri mkspecs/macx-ios-clang/features/default_post.prf mkspecs/macx-ios-clang/features/resolve_config.prf mkspecs/features/uikit/default_post.prf mkspecs/features/uikit/resolve_config.prf src/corelib/io/qsettings_mac.cpp src/corelib/json/qjsondocument.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/cocoa/qnswindowdelegate.h src/plugins/platforms/cocoa/qnswindowdelegate.mm src/plugins/platforms/ios/ios.pro src/plugins/platforms/ios/kernel.pro src/plugins/platforms/ios/qiosintegration.h src/plugins/platforms/minimalegl/qminimaleglintegration.cpp tests/auto/gui/painting/qpainter/tst_qpainter.cpp tools/configure/environment.cpp Change-Id: I654845e54e40f5951fb78aab349ca667e9f27843
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-131-0/+11
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also bump minimum required Qt version for Android: Ministro updates. Conflicts: src/android/java/src/org/qtproject/qt5/android/bindings/QtActivityLoader.java src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java src/plugins/platforms/android/androidjnimain.cpp Change-Id: I966f249bebf92da37bfdeb995ad21b027eb03301
| | * QtOpenGl: compile with GCC 7Marc Mutz2016-10-121-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 7 warns about implicit fall-throughs now. Fix by adding the missing comments. Change-Id: I081d4db07c7f2b30ee6344a166aaec34ac639ee5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-161-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/src/qmake-manual.qdoc src/corelib/global/qglobal.cpp src/corelib/tools/qstring.cpp src/network/socket/qabstractsocket.cpp src/network/socket/qnativesocketengine_unix.cpp src/plugins/platforms/eglfs/api/qeglfsglobal.h Change-Id: Id5dfdbd30fa996f9b4b66a0b030b7d3b8c0ef288
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-131-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/io/qsettings.cpp src/corelib/itemmodels/qstringlistmodel.cpp tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp Change-Id: I1c6c306ef42c3c0234b19907914b19da706b4a03
| | * Doc: Change instances of '(Mac) OS X' to 'macOS'Topi Reinio2016-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of version 10.12 (Sierra), the name of Apple's desktop operating system will be macOS. Change the occurrences where the Mac platform is discussed to use a macro \macos, which expands to 'macOS'. This helps with adapting to future renaming. Update the instructions on mac-specific Q_OS_* macro usage. Add a \target for the old 'Qt for OS X' topic to keep links working for other documentation modules that try to link with the old name. Change-Id: Id33fb0cd985df702a4ae4efb4c5fd428e77d9b85 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-121-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config_help.txt configure src/corelib/io/qprocess_wince.cpp src/plugins/platforms/windows/qwindowstheme.cpp src/plugins/platforms/xcb/qxcbbackingstore.cpp tests/auto/corelib/tools/qtimezone/BLACKLIST tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp Change-Id: I26644d1cb3b78412c8ff285e2a55bea1bd641c01
| * | OpenGL: use const (and const APIs) moreAnton Kudryavtsev2016-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | For CoW types, prefer const methods to avoid needless detach()ing. Change-Id: I211ae74434bf3705914764e1e9d02ae823a1be3a Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | OGLTextureCache::insert - make sure it did not failTimur Pocheptsov2016-04-151-1/+2
|/ / | | | | | | | | | | | | | | | | | | | | QGLTextureCache is using QCache internally, QCache in theory can delete the object we are trying to insert (in case the cost > maxCost). Vague comments in the code suggest that this can never happen. Q_ASSERT assert this. Found by coverity, CID 11765 Change-Id: I34ef114b9607926cd5e7d2baed4b63051cf87cff Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | OpenGL, PlatformSupport: use QStringRef to optimize memory allocationAnton Kudryavtsev2016-04-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Replace substring functions that return QString with corresponding functions that return QStringRef where it's possible. Create QString from QStringRef only where necessary. While touching the code, also port loops to C++11 style. Change-Id: Ib94d29b6ecec1cdab2604d0277a743e8b340be5e Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Use QFlags::setFlag where prudent in qtbaseAndre Somers2016-02-121-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFlags::setFlag is most useful to replace explicit constructs like if (condition) { someFlags |= TheConditionFlag; } else { someFlags &= ~TheConditionFlag; } with someFlags.setFlag(TheConditionFlag, condition); Change-Id: Ie4586681c83e0af812d5bbf14965aad51941a960 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
|/ | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.5' into devFrederik Gladhorn2015-08-061-2/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/global/qt-cpp-defines.qdocconf src/3rdparty/forkfd/forkfd.c src/corelib/codecs/qtextcodec.cpp src/corelib/kernel/qmetatype.cpp src/corelib/tools/qset.qdoc src/gui/accessible/qaccessible.cpp src/gui/image/qpixmapcache.cpp src/opengl/qgl.cpp src/tools/qdoc/generator.cpp src/widgets/kernel/qwidget.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp Change-Id: I4fbe1fa756a54c6843aa75f4ef70a1069ba7b085
| * Doc:added doc to undocumented functionsNico Vertriest2015-07-221-1/+7
| | | | | | | | | | | | Task-number: QTBUG-36985 Change-Id: Ic358682b276d67ef804f727bcf14191718613469 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | Enable non-integer device pixel ratioMorten Johan Sørvig2015-07-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Work around QPaintDevice::metric's int return type by adding a new metric that returns a scaled devicePixelRatio. Choose a scale factor that gives us more than enough range. The QPaintDevice::devicePixelRatio() convenience accessor is public API and can unfortunately not be changed to return a qreal. Add devicePixelRatioF() which returns the (unscaled) devicePixelRatio. Change all call sites of QPaintDevice::devicePixelRatio() to use QPainDevice::devicePixelRatioF(). Task-number: QTBUG-46615 Change-Id: I97ec4000fe379b7ff5e1624a871ae2512790aad9 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Fix some qdoc-warnings.Friedemann Kleint2015-07-101-0/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | qtbase/src/corelib/io/qdatastream.cpp:501: warning: Undocumented enum item 'Qt_5_6' in QDataStream::Version qtbase/src/corelib/itemmodels/qitemselectionmodel.cpp:1764: warning: Undocumented parameter 'model' in QItemSelectionModel::setModel() qtbase/src/corelib/statemachine/qabstractstate.cpp:216: warning: Undocumented parameter 'active' in QAbstractState::activeChanged() qtbase/src/corelib/statemachine/qstatemachine.cpp:3262: warning: Undocumented parameter 'running' in QStateMachine::runningChanged() qtbase/src/corelib/tools/qchar.cpp:160: warning: Undocumented enum item 'Unicode_7_0' in QChar::UnicodeVersion qtbase/src/gui/image/qimagereader.cpp:1168: warning: Undocumented parameter 'enabled' in QImageReader::setAutoTransform() qtbase/src/gui/image/qimagewriter.cpp:621: warning: Undocumented parameter 'transform' in QImageWriter::setTransformation() qtbase/src/gui/itemmodels/qstandarditemmodel.cpp:1268: warning: Undocumented parameter 'tristate' in QStandardItem::setAutoTristate() qtbase/src/gui/kernel/qscreen.cpp:590: warning: Undocumented parameter 'orientation' in QScreen::orientationChanged() qtbase/src/gui/kernel/qscreen.cpp:599: warning: Undocumented parameter 'orientation' in QScreen::primaryOrientationChanged() qtbase/src/gui/text/qtextdocument.cpp:1455: warning: No such parameter 'from' in QTextDocument::find() qtbase/src/gui/text/qtextdocument.cpp:533: warning: Undocumented parameter 'option' in QTextDocument::setDefaultTextOption() qtbase/src/widgets/itemviews/qtableview.cpp:2546: warning: Undocumented parameter 'enable' in QTableView::setSortingEnabled() qtbase/src/widgets/statemachine/qkeyeventtransition.cpp:119: warning: Undocumented parameter 'key' in QKeyEventTransition::setKey() qtbase/src/widgets/widgets/qplaintextedit.cpp:1610: warning: Can't link to 'toText()' qtbase/src/opengl/qgl.cpp:4371: warning: No documentation for 'QGLWidget::event()' Remove the documentation as they are properties: qtbase/src/widgets/widgets/qfontcombobox.cpp:407: warning: Undocumented parameter 'font' in QFontComboBox::setCurrentFont() qtbase/src/widgets/widgets/qfontcombobox.cpp:403: warning: Undocumented parameter 'script' in QFontComboBox::setWritingSystem() Change-Id: If599a3ce747bbb8a3418dd973810923b87246371 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
* Replace MAC OS X with OS XNico Vertriest2015-06-301-1/+1
| | | | | | Task-number: QTBUG-46374 Change-Id: I7bc633ab551740bd328a24b0ccae1d534af47138 Reviewed-by: Martin Smith <martin.smith@digia.com>
* Use QDebugStateSaver to restore space setting in stream operators.Friedemann Kleint2015-03-301-1/+2
| | | | | | | | Returning dbg.space() breaks formatting on streams that already have nospace() set. Change-Id: I55e38b018679a67eb40be6b4664505483a3a7d8e Reviewed-by: David Faure <david.faure@kdab.com>
* QtOpenGL: Fix const correctness in old style castsThiago Macieira2015-03-261-1/+1
| | | | | | | Found with GCC's -Wcast-qual. Change-Id: Ia0aac2f09e9245339951ffff13c946886247a98a Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* QGLWidget: make renderText() work in high-dpi modeMorten Johan Sørvig2015-03-231-1/+4
| | | | | | | | | Keep the win_x/y position in device independent pixels. Call glViewport with the device pixel size. Change-Id: I96fa038b1a0a3e18cb7f467b65def09cb89692a3 Task-number: QTBUG-38778 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-241-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/xml/htmlinfo/simpleexample.html examples/xml/rsslisting/rsslisting.cpp qmake/generators/win32/msbuild_objectmodel.cpp src/3rdparty/harfbuzz-ng/src/hb-private.hh src/corelib/global/qlogging.cpp src/corelib/io/qstorageinfo_unix.cpp src/corelib/thread/qwaitcondition_unix.cpp src/gui/kernel/qguiapplication.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp src/testlib/doc/src/qt-webpages.qdoc tests/auto/other/qaccessibility/tst_qaccessibility.cpp Change-Id: Ib272ff0bc30a1a5d51275eb3cd2f201dc82c11ff
| * QtOpenGL: avoid crashing if creating a QGLContext sharing with the global ↵Giuseppe D'Angelo2015-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QOpenGLContext If one asks for the global OpenGL context via the right attribute, and then creates a QGLContext sharing with that context, Qt will create anoter, dummy QGLContext owned by the global context. At application shutdown, and specifically after ~QObject of QGuiApplication has run, the QObjectPrivate dpointer gets destroyed. That destroys the owning global QOpenGLContext, and therefore that dummy QGLContext as well. However, QGLContext dtor triggers a code path that accesses qApp as if it were still alive. That's not the case any more -- it has already been destroyed. So, introduce a check and avoid dereferencing NULL. Task-number: QTBUG-44621 Change-Id: Ic160ac99e9269db999e76229b1c7f8c53bd2be61 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Update copyright headersJani Heikkinen2015-02-111-7/+7
|/ | | | | | | | | | | | | | | | | | 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>
* Fix for current_fbo getting out of sync in QtOpenGLSamuel Rødal2014-11-111-0/+29
| | | | | | | | | | | | | | | When using QGLWidget in combination with QOpenGLFramebufferObject from QtGui, instead of QGLFramebufferObject from QtOpenGL, the current_fbo variable doesn't get updated when framebuffer object bindings change. To ensure that the QGLWidget correctly releases the currently bound framebuffer object when using a QPainter, we keep track of whether QOpenGLFramebufferObject has modified the current FBO binding, and if that's the case we need to read the OpenGL state directly instead of relying on a cached value. Change-Id: If7e0bd936e202cad07365b5ce641ee01d2251930 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Mark the remaining QGL classes as obsoleteLaszlo Agocs2014-09-101-0/+3
| | | | | | | Many of them are already marked. Do it for the rest (QGLWidget et al). Change-Id: I506d72ad20f8ef39981dbeee0df49229bcf748a7 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-08-121-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | Manually included changes from 3a347a4e70e5a10ee92dd2578316c926a399e894 in src/opengl/qgl.cpp. Conflicts: src/opengl/qgl_qpa.cpp src/plugins/platforms/android/androidjnimain.cpp Change-Id: Ic26b58ee587d4884c9d0fba45c5a94b5a45ee929
* | Modernize the OpenGL examplesLaszlo Agocs2014-08-121-14/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change them to use QOpenGLWidget and QOpenGLTexture. Advocate also the usage of VBOs. Hopeless examples, that rely on the fixed pipeline and will not compile or work in ES and dynamic builds, are moved to a "legacy" directory. The documentation pages for these are removed. This long due change avoids the confusion newcomers experience when trying to get started with Qt 5 and OpenGL. hellowindow's behavior is changed to open a single window only by default. The old default behavior, that opened three windows on platforms that supported both MultipleWindows & ThreadedOpenGL, can be requested by passing --multiple. --single is removed since it is the default now. This plays much nicer with drivers that have issues with threading. In addition, say hello to hellogl2. This is the old hellogl example updated to use QOpenGLWidget and OpenGL 2. It also has a mainwindow with multiple (un)dockable widgets containing the OpenGL widgets. This helps testing the behavior when the top-level of the QOpenGLWidget changes and provides a very important example of how to do proper resource management in this case. (must use aboutToBeDestroyed() of the context, since the context goes away and is replaced by a new one on every dock/undock) As a bonus, the logo is now real 3D, no more orthographic nonsense. Launch with --multisample to request 4x MSAA. Launch with --coreprofile to request 3.2 Core. In this particular example the shaders are present in both versions and there is a VAO so the application is functional with core profile contexts. Change-Id: Id780a80cb0708ef164cc172450ed74050f065596 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-08-041-0/+2
|\| | | | | | | | | | | | | | | | | Conflicts: config.tests/arch/arch.cpp src/opengl/qgl_qpa.cpp src/widgets/kernel/qapplication.cpp Change-Id: I80b442a4c2c9632743a5b5c7319ff201ec5bc4fd
* | Make QOpenGLWidget publicLaszlo Agocs2014-08-011-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QOpenGLWidget is now public. In addition Qt::WA_AlwaysStackOnTop is introduced to support the special case of semi-transparent QOpenGLWidget or QQuickWidget on top of regular widgets. hellogl_es2 becomes the qopenglwidget example. This example performs painting both via QPainter and native GL commands and has the OpenGL widget combined with other, normal widgets. The widget stack receives some changes when it comes to renderToTexture widgets like QQuickWidget and QOpenGLWidget. Calling update() will now result in a paint event, which is essential for QOpenGLWidget since we want it to behave like a regular widget. The dirty region handling is extended specially for such widgets due to performance reasons. (an OpenGL content update must not result in any backingstore painting, and is thus handled as a different kind of dirtiness) [ChangeLog] Added QOpenGLWidget. This widget serves as a replacement for QGLWidget. Task-number: QTBUG-36899 Task-number: QTBUG-40086 Change-Id: Ibf7f82fea99b39edfffd2fc088e7e0eadbca25cf Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* | Unduplicate the implementations of next power of twoAllan Sandfeld Jensen2014-06-261-16/+2
| | | | | | | | | | | | | | | | | | | | | | Qtbase contains four identical implementations of next power of two, these should be shared and the implementation made available to other qt modules, as it is also used many places outside of qtbase. [ChangeLog][QtCore][QtMath] Introduced qNextPowerOfTwo methods. Change-Id: Id23fbe5ad6bae647b30d5a4212c0330e48a50278 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | qpa: Merge qgl_qpa.cpp into qgl.cppTor Arne Vestbø2014-05-151-11/+388
| | | | | | | | | | Change-Id: I91cfd7daf7f1dd88659019ccc671ec0d9245067f Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-05-061-14/+26
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/qnx-x86-qcc/qplatformdefs.h src/corelib/global/qglobal.h src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/qgl.cpp src/opengl/qglpixelbuffer.cpp src/opengl/qglshaderprogram.cpp tests/auto/opengl/qglthreads/tst_qglthreads.cpp Change-Id: Iaba137884d3526a139000ca26fee02bb27b5cdb5
| * Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2014-05-011-13/+13
| |\ | | | | | | | | | | | | | | | This merge adds the opengl rename. Change-Id: I84ea0b6abee9780ebb2cf3f64ab9e3fdf2acab3e
| | * Rename new QOpenGLContext APIsLaszlo Agocs2014-04-251-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | isES() becomes isOpenGLES(). The library type enums are changed DesktopGL -> LibGL and GLES2 -> LibGLES. This removes the now unnecessary version number, the confusing "desktop" term and provides better readability. The old function/values are kept until the related qtdeclarative changes are integrated. Task-number: QTBUG-38564 Change-Id: Ibb0a1209985f1ce4bb9451f9b7b093c2b68a6505 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * | Avoid a double memory copy during bindTextureAllan Sandfeld Jensen2014-04-251-1/+13
| |/ | | | | | | | | | | | | | | | | | | | | If a painter is active on a QPixmap being uploaded, it will be copied twice, first to create a QImage and then from QImage into a texture. The first copy is unnecessary since the QImage is only temporary, so we can force it to be created as a reference instead of a copy. Change-Id: Iabcfb514a634446a01f1c4031349c185ec09290b Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* / Remove direct OpenGL calls from QtOpenGLLaszlo Agocs2014-04-281-123/+161
|/ | | | | | Task-number: QTBUG-36483 Change-Id: I96dea5649c0a49a11cd2ff31da659cd2067e769d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Avoid recreating the underlying context in QGLContext wrappersLaszlo Agocs2014-04-031-2/+3
| | | | | | | | | | | QGLContexts created from a QOpenGLContext get their valid flag reset, resulting in creating a totally new underlying context. This is wrong and becomes visible when sharing is expected between contexts (since the QGLContext's underlying QOpenGLContext will not have sharing). Task-number: QTBUG-37893 Change-Id: I8cb37c11dfb400a77e510bf4c8219bedc742309e Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* QNX: Fix OpenGL autotestFabian Bumberger2014-04-011-0/+5
| | | | | | | | | | | | On QNX grabbing the frame buffer returns the content of the back buffer. In order to execute the OpenGL tests properly a swapBuffers is executed before in order to be able to retrieve the content of the front buffer. The patch also documents this platform behavior. Change-Id: I7a501818ec6eea061f2f54f95854f68cb72e0534 Reviewed-by: James McDonnell <jmcdonnell@qnx.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix some documentation errors.Friedemann Kleint2014-03-241-46/+1
| | | | | | | | Correct links and fix typos, remove obsolete documentation, fix some snippets, mark some classes as internal. Change-Id: I9a3266605f060783413d32740057a57a820c8929 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Fix crash: make sure functions pointer is initialized.BogDan Vatra2014-03-221-1/+1
| | | | | Change-Id: I42fd3933f33370612290e8ba252349acfae72381 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Resurrect QGLWidget::renderText()Laszlo Agocs2014-03-151-12/+8
| | | | | | | | | | The variant taking x, y, z has been broken in all Qt 5.x releases. This is now corrected by making the GL2 paint engine capable of applying a Z translation. Task-number: QTBUG-31156 Change-Id: I119566e9e9577f6cdf7e8bae56cac1e34995e622 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>