summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qopenglwindow.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Enable non-integer device pixel ratioMorten Johan Sørvig2015-07-301-5/+0
| | | | | | | | | | | | | | | | | | | | 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>
* QOpenGLWindow: initializeGL is to be called before resizeGLLaszlo Agocs2015-05-271-114/+131
| | | | | | | | | This involves deinlining some private class stuff to keep things readable and maintainable. Task-number: QTBUG-46002 Change-Id: Ie2888aa6c16a6f5182b61fbaa43288cfcc96cbc4 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Create context with the correct screen in QOpenGLWindowLaszlo Agocs2015-05-121-0/+1
| | | | | | | | | | Targeting a non-primary screen with a QOpenGLWindow requires (at least with GLX) that the context is created with the same screen. Otherwise the context cannot be used with the window (BadMatch due to different X screens) Change-Id: I64f38ad7317d39a164bb69bb1430692319fc49d4 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* 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>
* QOpenGLWidget/Window: improve docs for the dtorGiuseppe D'Angelo2015-02-071-1/+1
| | | | | | | Remove a typo and add the standard sentence about a dtor. Change-Id: Ie21ad6d2e83977705ea43fdc872d08f496a32376 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* QOpenGLWidget/QOpenGLWindow: add a destructor which calls makeCurrentGiuseppe D'Angelo2015-01-241-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generally speaking, QOpenGLWindow subclasses are going to use some various QOpenGL* wrapper object to handle their buffers, FBOs, etc. Some of those QOpenGL* wrappers are QObjects, hence it should be safe to have them as child objects, and expect Qt to clean them up properly; but that doesn't happen because of how the destruction will work. In particular, when the subclass object is deleted, there may not be the right OpenGL context set as current. The deletion will go up to ~QObject, where the child objects will be deleted, resulting in a crash. That will *also* happen if someone connected to the context's aboutToBeDestroyed() signal: the context will in fact be deleted after the child objects, since it's stored in QOpenGLWindowPrivate, whose dtor will be run after ~QObject (!). Now, in the general case, QOpenGLWindow subclasses should always have a dtor in which they call makeCurrent() (also because various QOpenGL* class are not QObjects, hence they're kept around as full members instead of pointers-to); but at the same time we should clean up properly the QObject children. All of the above of course stands for QOpenGLWidget as well. Task-number: QTBUG-44094 Change-Id: I2379041fe175416936f6d40292039f773a515b35 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* QOpenGLWindow: make it possible to use a shared contextJørgen Lind2014-12-201-3/+26
| | | | | Change-Id: I7e9f115a9b75d38c1d6a214958d18d6fd9eac891 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Take ShareOpenGLContexts into account in QOpenGLWindowLaszlo Agocs2014-12-081-0/+6
| | | | | | | | | While the attribute was originally intended for widgets (QOpenGLWidget, QQuickWidget) only, we need a way to get multiple QOpenGLWindow instances whose contexts share with each other. Change-Id: Ib983c9c2815b0a3911bc504ffad8d8dddad192aa Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Fix QOpenGLWindow tests when devicePixelRatio != 1Jørgen Lind2014-10-201-7/+10
| | | | | Change-Id: I83d71de8b9d735cd649a6c514e41a9ff23625005 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Fix high dpi support in QOpenGLWindowLaszlo Agocs2014-09-151-3/+4
| | | | | Change-Id: I0be29fb25d854e09ae961cade0c8490586788394 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Fix the docs for resizeGL in QOpenGLWindowLaszlo Agocs2014-08-081-3/+9
| | | | | | | | Some of it was blindly copied from QOpenGLWidget and it does not apply. Change-Id: I73f358f74d286d3757a3a77a9bfe06887d57514a Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Introduce QOpenGLWindowLaszlo Agocs2014-08-051-0/+615
[ChangeLog] Added QOpenGLWindow. This serves as a convenience class for creating windows showing OpenGL content via an API similar to QGLWidget and without any widget dependencies. Done-with: Jorgen Lind <jorgen.lind@digia.com> Task-number: QTBUG-36899 Change-Id: I52e9bc61acb129dbfd3841b3adeffab2dbcf7f05 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>