summaryrefslogtreecommitdiffstats
path: root/src/opengl
Commit message (Collapse)AuthorAgeFilesLines
* QtBase: remove explicit function info from qWarning() etcMarc Mutz2015-11-281-2/+1
| | | | | | | | | | | This information is already registered by the QMessageLogger ctor. Where, by dropping the << Q_FUNC_INFO in ostream-style qDebug(), only a string literal remained, converted to printf-style qDebug() on the go. Change-Id: I3f261c98fd7bcfa1fead381a75a82713bb75e6f3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Doc: Update examplesinstallpath to include the repository nameTopi Reinio2015-10-211-1/+1
| | | | | | | | | | | | The examplesinstallpath variable in .qdocconf files defines the path under QT_INSTALL_EXAMPLES where examples are found. To match the way examples are packaged in Qt 5.6, prefix each install path with the repository name. Task-number: QTBUG-48736 Change-Id: I6a35c94fdacaad21cd044411aba02027b9019300 Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
* Doc: fixed links to qmake documentationNico Vertriest2015-09-251-1/+1
| | | | | | | Task-number: QTBUG-43810 Change-Id: I56676d6f6f95ed79bd1719404b4e48c26490eea6 Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* Fix some doc warnings.Friedemann Kleint2015-09-112-2/+2
| | | | | | | | | | | | | | | | | qtbase/src/gui/text/qzip.cpp:797:warn:Cannot find 'FileInfo::d' specified with '\variable' in any header file qtbase/src/opengl/doc/src/qtopengl-index.qdoc:28:warn:Can't link to 'Qt Gui' qtbase/src/opengl/doc/src/qtopengl-module.qdoc:28:warn:Can't link to 'Qt Gui' qtbase/src/widgets/widgets/qcombobox.cpp:3033:warn:Cannot find base function for '\reimp' in showPopupFromMouseEvent() qtbase/src/corelib/plugin/quuid.cpp:849: warning: Can't link to 'variant()' qtbase/src/corelib/plugin/quuid.cpp:863: warning: Can't link to 'variant()' qtbase/src/widgets/dialogs/qsidebar.cpp:72: warning: Cannot find base function for '\reimp' in mimeTypes() qtbase/src/widgets/dialogs/qsidebar.cpp:80: warning: Cannot find base function for '\reimp' in flags() qtbase/src/widgets/dialogs/qsidebar.cpp:98: warning: Cannot find base function for '\reimp' in mimeData() qtbase/src/widgets/dialogs/qsidebar.cpp:134: warning: Cannot find base function for '\reimp' in dropMimeData() qtbase/src/widgets/dialogs/qsidebar.cpp:151: warning: Cannot find base function for '\reimp' in setData() Change-Id: I39d6494eb8179f0f7532f99458736fa5e30cdc25 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into devFrederik Gladhorn2015-08-062-4/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Fix warnings about unused variablesThiago Macieira2015-08-061-2/+1
| | | | | | | | | | | | | | | | Found by ICC qglengineshadermanager.cpp(427): warning #177: variable "none" was declared but never referenced Change-Id: Id3d5c7bf4d4c45069621ffff13f758ffaf1744d7 Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
| * 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>
* | QtGui/QtOpenGL: Fix compiler warnings by MSVC2015 (64bit).Friedemann Kleint2015-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | opengl\qtriangulatingstroker.cpp(130): warning C4305: '=': truncation from 'double' to 'float' opengl\qtriangulatingstroker.cpp(546): warning C4305: '=': truncation from 'double' to 'float' opengl\qopenglshaderprogram.cpp(1779): warning C4312: 'reinterpret_cast': conversion from 'int' to 'const void *' of greater size qglshaderprogram.cpp(1709): warning C4312: 'reinterpret_cast': conversion from 'int' to 'const void *' of greater size Change-Id: If1de629aada308d18c3641b504d74d3294b1e8bf Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Enable non-integer device pixel ratioMorten Johan Sørvig2015-07-304-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | QtOpenGL: Use Q_NULLPTR instead of 0 in all public headersMarc Mutz2015-07-066-16/+16
| | | | | | | | | | | | | | | | | | This is in preparation of adding -Wzero-as-null-pointer-constant (or similar) to the headers check. Task-number: QTBUG-45291 Change-Id: I16c93bd36c242a6d402cf7622820e91eac782772 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Make QWidget *=0, Qt::WindowFlags f=0 functions use Q_NULLPTRMarc Mutz2015-07-041-9/+9
| | | | | | | | | | | | | | | | | | This is in preparation of adding -Wzero-as-null-pointer-constant (or similar) to the headers check. Task-number: QTBUG-45291 Change-Id: If9721e8b1ab3b4cd6e3e366362cae314f451bbed Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-07-014-6/+6
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qglobal.h src/corelib/global/qsysinfo.h src/corelib/global/qsystemdetection.h src/corelib/kernel/qobjectdefs.h src/plugins/plugins.pro tests/auto/widgets/itemviews/qlistview/qlistview.pro Change-Id: Ib55aa79d707c4c1453fb9d697f6cf92211ed665c
| * Replace MAC OS X with OS XNico Vertriest2015-06-304-6/+6
| | | | | | | | | | | | Task-number: QTBUG-46374 Change-Id: I7bc633ab551740bd328a24b0ccae1d534af47138 Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Delete the d_ptr in the destructorHolger Hans Peter Freyther2015-06-121-0/+1
| | | | | | | | | | | | | | | | | | | | The d_ptr variable is introduced by QGLCustomShaderStage and needs to be fully handled by it. Delete the d_ptr in the dtor Fixes Coverity CID #10995. Change-Id: I76bf05206acf23363419afc95094f5593e808a2e Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-06-032-8/+12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qnamespace.qdoc src/corelib/io/qwindowspipereader.cpp src/corelib/io/qwindowspipereader_p.h src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/plugins/platforms/xcb/qxcbconnection.h tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/tools/qmake/tst_qmake.cpp tests/manual/touch/main.cpp Change-Id: I917d694890e79ee3da7d65134b5b085e23e0dd62
| * Fix subpixel rendered text in QGLWidgetAllan Sandfeld Jensen2015-05-301-7/+11
| | | | | | | | | | | | | | | | | | | | | | Subpixel rendered text doesn't work in the old OpenGL paint engine because it assumes the glyphs are returned in RGB32 format, when they may be in ARGB32. This patch changes the test of the returned format to just check for 32bit matching the logic in the new OpenGL paint engine. Change-Id: Ib5b784dedba51cf22f216e2f035361518610b96b Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| * Make data tables const.Volker Krause2015-05-051-1/+1
| | | | | | | | | | | | | | | | | | | | Moves some of them to the .rodata section, the rest at least to .data.rel.ro[.local]. Change-Id: I85676ddf22b0c0097f3f0dce4c3dc018dc29d045 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | Replace <qhash.h> with <qhashfunctions.h> where applicableMarc Mutz2015-04-201-1/+1
|/ | | | | | | | To avoid source-incompatibilites, wrap in QT_DEPRECATED_SINCE(5, 5) in public headers. Change-Id: Ic3398f4f330e15a3b55065858add26b90fd70e6c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.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-262-2/+2
| | | | | | | 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>
* Remove some uses of the private Q_PI constantAllan Sandfeld Jensen2015-02-261-4/+3
| | | | | | | | | The patch removes several uses of the private Q_PI constant and removes the qmath_p.h from the includes. A few places are optimized to multiply with reciprocals instead of dividing by Q_PI. Change-Id: I097af6a929e0609d6935563064e81c856005f4bc Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-242-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Doc: mod to correct OpenGL link errorNico Vertriest2015-02-241-1/+1
| | | | | | | | | | | | Task-number: QTBUG-43810 Change-Id: I691cdeced3f857e2dcf9bda5d65207065c454635 Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Use C++ <cmath> instead of <math.h>Allan Sandfeld Jensen2015-02-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Including math.h can pollute the default namespace, and break some compilers if cmath versions of the method are declared as using. Switching to C++ math functions also greatly simplifies handling of float qreal as C++ automatically chooses the right method. [ChangeLog][QtCore][QtMath] qmath.h no longer includes math.h, so any sources depending on that indirect inclusion may fail to build. Change-Id: I4d0e331dafba354ec05dc5052e61ef4ff8d387fe Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* | Updated BSD licensed file headersJani Heikkinen2015-02-155-15/+15
| | | | | | | | | | Change-Id: I6441ff931dbd33b698d762e6f6784898f3f60fe7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* | Update copyright headersJani Heikkinen2015-02-1145-301/+301
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-12-292-6/+4
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/kernel/qplatformsystemtrayicon.cpp src/gui/kernel/qplatformsystemtrayicon.h src/plugins/platforms/xcb/xcb-plugin.pro Change-Id: I00355d3908b678af8a61c38f9e814a63df808c79
| * Qt OpenGL is deprecated with 5.4. Show that in the docs as wellLars Knoll2014-12-182-6/+4
| | | | | | | | | | | | Change-Id: Idadf24d5331443d2c947a633029c7d4ea2305caf Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | [QStaticTextItem] Drop unused membersKonstantin Ritt2014-12-141-2/+0
| | | | | | | | | | | | | | | | | | The QStaticTextItem's `chars` and `numChars` members are never used, even when set. In fact, there is nothing useful we can do with the input string in the absence of clusters mapping. Change-Id: I81fcbce3e575f4d0dcfc2515286d512b858f592b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Add Q_DECL_OVERRIDE in the src subdirectoryOlivier Goffart2014-12-0312-68/+68
|/ | | | | | | | | | Done automatically with clang-modernize on linux (But does not add Q_DECL_OVERRIDE to the function that are marked as inline because it a compilation error with MSVC2010) Change-Id: I2196ee26e3e6fe20816834ecea5ea389eeab3171 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update fbo toImage() docs regarding premultiplied alphaLaszlo Agocs2014-11-171-0/+14
| | | | | | | Task-number: QTBUG-42510 Task-number: QTBUG-37261 Change-Id: Ic11bec0a25e66df9d022f640621686be867e84d2 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Fixed QtGui's GL paint engine getting out of sync when using QtOpenGLSamuel Rødal2014-11-112-1/+21
| | | | | | | | | | We need to reset the active_engine belonging to QOpenGLContext whenever we make the QtOpenGL paint engine active, to give the OpenGL paint engine in QtGui a chance to sync its state if we've used the QtOpenGL paint engine inbetween. Change-Id: I445ce2f99bfbacf55650c881c4fdf07f2ff85069 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Fix for current_fbo getting out of sync in QtOpenGLSamuel Rødal2014-11-116-7/+58
| | | | | | | | | | | | | | | 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>
* Doc: Use title case in section1 titlesNico Vertriest2014-09-301-3/+3
| | | | | | | | Using Python script title-cased.py Task-number: QTBUG-41250 Change-Id: I00d3d7a0b30db7304a7904efd6d63abd9a7b493b Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-2437-702/+406
| | | | | | | | | - 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-122-2/+3
|\ | | | | | | | | | | | | | | | | | | | | | | 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
| * OpenGL: destroy QGLContext allocated by QGLContext::fromOpenGLContextDavid Fries2014-08-052-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QGLContext already uses ownContext to identify when it "owns" QOpenGLContext and will delete QOpenGLContext when needed. In the other way QGLContext::fromOpenGLContext creates a QGLContext for QOpenGLContext, and is now using qGLContextDeleteFunction to identify if QOpenGLContext "owns" QGLContext by QGLContext only passing a delete function when QOpenGLContext should delete QGLContext, and by QOpenGLContext calling deleteQGLContext() from destory() to do the destruction avoiding the previous leak and sometimes crash on exit. Change-Id: I65e791776e99b456e4d0c70fc5b5cdb33c975893 Task-number: QTBUG-40286 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Modernize the OpenGL examplesLaszlo Agocs2014-08-123-18/+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>
* | Use NAmE spelling of grey (gray)Marc Mutz2014-08-091-1/+1
| | | | | | | | | | | | | | These occurrences are only in docs or code comments. Change-Id: Ia114466a85c01e2b978396c329153044921fb20b Reviewed-by: Sean Harmer <sean.harmer@kdab.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
| * Propagate swapInterval to QGLFormatLaszlo Agocs2014-07-311-0/+2
| | | | | | | | | | | | Task-number: QTBUG-39370 Change-Id: Ib3a46a0ae24e5f6d690625b1d91be9e599bbc927 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
| * Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2014-05-031-1/+1
| |\ | | | | | | | | | | | | | | | | | | Manually fixed up: isES -> isOpenGLES src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp Change-Id: I57d2ef26c3d4a7b40ace09f4e8560b7686650ea5
* | | 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>
* | | Include the ES3 headers on iOSLaszlo Agocs2014-06-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The config test correctly recognizes if GLES 3.0 is available, however qopengl.h still includes the ES2 headers. This causes issues for the new GLES3 support patches. Change-Id: Ia97f556cc207f7d828918f493fe1adab93cf31ec Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | | Remove tracking of the current fboLaszlo Agocs2014-06-021-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When binding an FBO directly via glBindFramebuffer, the QOpenGLContext's internal current_fbo, that is maintained by QOpenGLFramebufferObject, becomes out of sync. This will lead to QOpenGLFramebufferObjects thinking they are still bound. Such state tracking should be avoided since it is becoming increasingly difficult to keep it consistent between the various OpenGL API wrappers and will never be robust enough when the application changes the state by directly calling OpenGL functions. current_fbo is now removed in QtGui. QtOpenGL is not touched. Change-Id: Id809aab1306c9486d1e2ba3bb5aa93593659e920 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>