summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/eglconvenience
Commit message (Collapse)AuthorAgeFilesLines
* Fix EGL config - X visual matching for i.MX6Laszlo Agocs2015-03-181-0/+6
| | | | | | Task-number: QTBUG-44290 Change-Id: I06cbb169803aa8a06ea310651def1f3582194c8e Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Add support for grabWindow() on eglfs with widgetsLaszlo Agocs2015-03-162-0/+51
| | | | | | | | | | | | | For real OpenGL content it is still not supported because we have no reliable way to read back the contents at arbitrary times. Applications should rather use QQuickWindow::grabWindow() in that case. [ChangeLog][QtGui] Support for QScreen::grabWindow() is now available on embedded platforms (eglfs, linuxfb). Task-number: QTBUG-44937 Change-Id: I4ad046062782c160f5bb9f8f2a2fe82f2e7394cc Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* eglfs: Report the QScreen refresh rate from eglfsLaszlo Agocs2015-03-142-0/+28
| | | | | | | | | | | | For KMS we can always know the correct rate so report it from the backend's custom screen implementation. For the rest, query from the framebuffer. If the fb driver publishes the timings then we can calculate the vertical refresh rate from them. If not, default to 60. Task-number: QTBUG-44971 Change-Id: I854a34e7c0d652790cc2ac967715828ec76f5733 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* Support QCursor::setPos() properly for eglfsLaszlo Agocs2015-03-141-0/+1
| | | | | | | | | | | | | | | | | The internal state of the input handlers need updating too. This was not possible in the past due to the one way communication from the input handlers (that are potentially loaded as interface-less generic plugins), but using our new private QInputDeviceManager in QtGui we can now easily implement "talking back" from QtGui to the input handlers, regardless of them being plugins or compiled in. The rest of setPos() is in place already for eglfs. linuxfb will be handled in follow-up patches. Task-number: QTBUG-44856 Change-Id: Id72fdb8b1ea176ddfe082e466e7a538a2a98a005 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* eglfs: Generate enter and leave eventsLaszlo Agocs2015-03-144-3/+52
| | | | | | | | | | | In addition the logic in QGuiApplication that picks the target window for input events with a null window has to be enhanced to be compatible with how real windowing systems work: mouse events following a press are delivered to the same window until the release, even if the cursor has left the original target window. Task-number: QTBUG-44814 Change-Id: I3fea84ac77a5ccebeae5def64f92d8d2e03d13ff Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Fix up signal handling in QFbVtHandlerLaszlo Agocs2015-03-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Start using signalfd where we can. Drop the crash (SIGSEGV, SIGBUS) handling completely. The crash handling that was in place previously was not async-safe. It also prevented getting a core dump. So just remove it. There is no safe solution for a single application process since restoring the keyboard, video modes, etc. all need unsafe calls in the signal handler almost for sure. We can however improve the handling of non-crash scenarios greatly: Introduce support for SIGINT, allowing nicely and cleanly restoring the video mode with the KMS backend when pressing Ctrl+C while QT_QPA_ENABLE_TERMINAL_KEYBOARD is set. Same goes for keyboard suspend (SIGTSTP, Ctrl+Z). When QT_QPA_ENABLE_TERMINAL_KEYBOARD is set, platform plugins now have the possibility to act upon Ctrl+Z. As an example eglfs' KMS backend is enhanced to handle this by restoring the video mode before suspending the process, and reinitializing when brought into foreground again (SIGCONT). SIGTERM is also handled. This is extremely handy when starting an application locally on the embedded device and then kill-ing it via a remote ssh session. Keyboard and video mode is now cleanly restored. Finally, when disabling the keyboard, try setting also KDSKBMUTE. Change-Id: I2b3608dc23c798e2b39f74cb27f12dcb0e958435 Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
* Optimize egl cursor update eventsLaszlo Agocs2015-03-052-38/+34
| | | | | | | | | Avoid invokeMethod on every cursor movement and use an event instead. This is more lightweight and efficient. Also, there is no need to have a separate QObject just for this. Change-Id: I65ae202943eeb1e30cf22926576f84198f2487f8 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* Fix compilation with ICC: failure to parse placement of Q_DECL_OVERRIDEThiago Macieira2015-02-171-1/+1
| | | | | | | | | | | | | | | | | This is the right way: void (*getProcAddress(const QByteArray &procName)) () Q_DECL_OVERRIDE; However, ICC and GCC do not get it. They expect it in the form: void (*getProcAddress(const QByteArray &procName) Q_DECL_OVERRIDE) (); ICC complains with an error, so this needs a workaround. GCC ignores the incorrectly-placed "override", so it just looks to GCC like no "override" was added. See also: https://groups.google.com/a/isocpp.org/forum/#!topic/std-discussion/IjVB8CWiS5A Change-Id: I1a800c709d3543699131ffff13c2ffc9cee46245 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Update copyright headersJani Heikkinen2015-02-1116-112/+112
| | | | | | | | | | | | | | | | | | 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 Gladhorn2015-02-101-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro src/gui/image/qimage_conversions.cpp src/gui/opengl/qopenglextensions_p.h src/gui/text/qtextengine.cpp src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/eglfs/qeglfshooks_stub.cpp src/plugins/platforms/eglfs/qeglfsscreen.cpp src/plugins/platforms/eglfs/qeglfswindow.cpp src/plugins/platforms/windows/qwindowsfontdatabase.cpp src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp src/plugins/platforms/windows/qwindowsnativeinterface.cpp src/plugins/platforms/windows/qwindowsscreen.cpp src/plugins/platforms/windows/qwindowswindow.cpp src/plugins/platforms/windows/qwindowswindow.h src/plugins/platforms/xcb/qxcbdrag.h src/widgets/itemviews/qabstractitemview.cpp src/widgets/kernel/qwidget.cpp src/widgets/util/qsystemtrayicon_p.h tests/auto/corelib/itemmodels/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp Thanks to Friedemann Kleint for resolving the qwindowsfontdatabase.cpp conflicts. Change-Id: I937232c30523d5121c195d947d92aec6f129b03e
| * Fix build of egl integrationStephan Binner2015-02-022-1/+2
| | | | | | | | | | | | | | Add missing includes and reorder includes to avoid X defines breakage Change-Id: Iaf95ae2488df3d3301436262ed79f7091b4be0a9 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Fix build of egl integrationStephan Binner2015-02-052-0/+2
| | | | | | | | | | | | | | Add qtextstream.h includes before header files define Status Change-Id: I02e1fe710d4371100509a7fafac1eda8f436d80f Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Set some state before rendering the EGL/GLES mouse cursorLaszlo Agocs2015-02-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Custom OpenGL rendering code often sets these and, unlike the Quick scenegraph, may not reset it before calling swapBuffers(). Play nice with the most commmon settings. Resetting the active texture unit is critical in particular, since frameworks like Qt3D will change this. Change-Id: I86acaf7e0b2ce67a23c731fffce4f20375614321 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* | Utilize EGL_KHR_surfaceless_context in QOffscreenSurface when availableLaszlo Agocs2015-02-022-7/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use it also in the context initialization code which also relied on pbuffers until now. This is safe to do since QOffscreenSurface is deliberately kept minimal: we only support it for rendering to FBOs or uploading textures, it is quite useless for any rendering type of operation. Therefore simply not creating a surface when the extension is available is viable and should not break anything. While we should have done this a long time ago, the real inspiration now is to avoid crashes with some bad EGL implementations. Mesa in particular tends to crash in its interal configuration handling when trying to create a pbuffer surface with more exotic attributes, for example with multisampling enabled. Just getting rid of those properties is not an option since the resulting pbuffer would not be compatible with the existing context. Therefore our only option is to avoid the pbuffer altogether. There's a so-far-ignored patch for Mesa http://patchwork.freedesktop.org/patch/38100/ which tries to solve some of this but it turns out it is not sufficient to avoid problems with the multisampled case. So to avoid more headache, we just stop using pbuffers there. [ChangeLog][QtGui] QOffscreenSurface is now relying on EGL_KHR_surfaceless_context when available, and avoids creating a pbuffer surface when the extension is present. Change-Id: Id18742768b8e66c8d92ce65a9bf64b0296e14db7 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Unify input device hotplugging support for embeddedLaszlo Agocs2015-01-213-40/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On embedded the mouse cursor will now appear and reappear regardless of how the input handling code is loaded (via a generic plugin or compiled-in to the platform plugin). Instead of passing around QDeviceDiscovery instances that only works when compiling-in the code into the platform plugin, introduce a new internal central QInputDeviceManager. The single instance of this provides a place to store any future input device related signals and properties. Also introduce mouse hotplugging support to linuxfb. [ChangeLog][QtGui] The mouse cursor on Embedded Linux is now handling hotplugging correctly with eglfs and linuxfb regardless of how the input handling code is loaded (via a generic plugin or built in to the platform plugin). Change-Id: I147c1b04a193baf216598015264f2c06e1b20f84 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
* | eglfs: Make sure there is a platform window for the backing storeLaszlo Agocs2015-01-061-0/+2
| | | | | | | | | | | | | | | | | | Some example code creates the backing store before the platform window. Make this case working by calling create(). Task-number: QTBUG-43543 Change-Id: I29c260f38eddd15ea09931e814c5dbd031b65505 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devSimon Hausmann2014-12-181-1/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/platformsupport/platformcompositor/qopenglcompositor.cpp src/platformsupport/platformcompositor/qopenglcompositorbackingstore.cpp tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I5422868500be695584a496dbbbc719d146bc572d
| * Prevent continuous painting with viewport QOpenGLWidgetLaszlo Agocs2014-12-182-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the source widget to the texture list (may be null for custom compositor implementations that add textures not belonging to actual widgets). This allows us to do proper checks with the dirtyRenderToTextureWidgets list. As a result paint events are only sent to a QOpenGLWidget if (1) there was an update() for it or (2) it was actually marked dirty. (2) was previously behaving differently: the widget got a paint event when anything in the window has changed. This is fine for naive animating OpenGL code but less ideal for QGraphicsView. Bool properties like stacksOnTop are now stored in a flags value to prevent future explosion of texture list fields and parameters. Task-number: QTBUG-43178 Change-Id: I48cbcf93df72ac682c9b5d64982a8b648fe21ef3 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
| * Change bugreports.qt-project.org -> bugreports.qt.ioAlex Blasche2014-12-181-1/+1
| | | | | | | | | | | | | | The Qt bug tracker URL changes as part of the qt.io transition Change-Id: Icb4ab198943b93639b5e3a8d99262303785c6459 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Add Q_DECL_OVERRIDE in the src subdirectoryOlivier Goffart2014-12-032-10/+10
| | | | | | | | | | | | | | | | | | | | 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>
* | Add generic OpenGL compositor and backingstore bitsLaszlo Agocs2014-11-2610-687/+32
| | | | | | | | | | | | | | | | By removing the EGL(FS) dependencies we get classes that can be used by any platform plugin that runs without a windowing system. Change-Id: If99b42de5a4da02bbef80863609b6d92c6734613 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-11-241-5/+26
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qiodevice.cpp src/plugins/bearer/linux_common/qofonoservice_linux.cpp src/plugins/bearer/linux_common/qofonoservice_linux_p.h src/plugins/platforms/android/qandroidplatformtheme.cpp src/tools/bootstrap/bootstrap.pro src/widgets/styles/qmacstyle_mac.mm Change-Id: Ia02aab6c4598ce74e9c30bb4666d5e2ef000f99b
| * eglfs: ifdef linux specific functionality from convenience functionsPasi Petäjäjärvi2014-11-131-5/+26
| | | | | | | | | | | | | | | | | | | | Because change a093204f07f276bc8e7b4fedf4af0e1369f55734 qeglfshooks_stub.cpp don't compile anymore on any other *nix platform than linux as those functions have been set linux specific only. Change-Id: I339672b1bf2745511076030cc1fe13dc7f2356ff Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-271-1/+1
|\| | | | | | | | | | | | | Conflicts: src/gui/text/qfontdatabase.cpp Change-Id: I6ac1f55faa22b8e7b591386fb67f0333d0ea443d
| * eglfs: Do not flush input events when updating the cursorLaszlo Agocs2014-10-221-1/+1
| | | | | | | | | | | | | | Task-number: QTBUG-42079 Change-Id: Ica806a090db74b4a1c34421334a28d7efd002b35 Reviewed-by: Jonathan Liu <net147@gmail.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-201-0/+5
|\| | | | | | | Change-Id: If7e51514ed6832750e3ad967e4d322ccf920d2bb
| * Print warning when unable to query physical screen sizeGatis Paeglis2014-10-101-0/+5
| | | | | | | | | | | | | | | | This warning was removed when re-factoring code in: 328f2f9c35f3cc5e7049a060a608c3f72876484a Change-Id: I5a9d7fbbf2b78e6e80a79478f4e9fb08ccaec431 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Simplify using tslib with eglfsLaszlo Agocs2014-10-171-1/+11
| | | | | | | | | | | | | | | | | | | | | | tslib support can now be built-in into eglfs, like evdev. Set QT_QPA_EGLFS_TSLIB to 1 to use tslib instead of evdevtouch. The input device can be controlled via TSLIB_TSDEVICE. Change-Id: Iff6bdbb4d133f73eca5528705844862236f8752b Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* | Avoid qCWarningLaszlo Agocs2014-10-161-7/+7
| | | | | | | | | | | | | | | | | | | | qCWarning messages are shown by default. This was not the intention. Switch to qCDebug since these are not necessarily errors, just debugging information. Change-Id: I15f114fd07887afb687e40342b289a6463e0c93a Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* | eglconvenience/eglfs: Clean up warning messagesLaszlo Agocs2014-10-134-25/+21
| | | | | | | | | | | | | | | | | | | | | | | | Remove the last occurrence of ifdefed debug prints and replace it with categorized logging. Also clean up the warning texts for some of the serious errors, the old ones from Qt 4 times were somewhat messy. Change-Id: I2a3e48c393d56be2511d25c3003b1f2b74ac3c8c Reviewed-by: Louai Al-Khanji <louai.al-khanji@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* | EGLFS: Add support for multiple displaysLouai Al-Khanji2014-10-102-14/+3
| | | | | | | | | | Change-Id: Id039e0ed2d99562eb2a5cfe1e7b34013c75ff3ac Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | eglfs: Add support for systems without pbuffer supportLaszlo Agocs2014-10-102-16/+33
| | | | | | | | | | | | | | | | | | Use a small native window and window surface in case the hooks indicate that pbuffer support is not available. Change-Id: I6515309041f0e1e2f5321d59941f35d6ee16dca7 Reviewed-by: Louai Al-Khanji <louai.al-khanji@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-091-2/+2
|\| | | | | | | Change-Id: I05fcd8dc66d9ad0dc76bb7f5bae05c9876bfba14
| * Rename internal enum value to avoid clashing with XlibLaszlo Agocs2014-10-051-2/+2
| | | | | | | | | | | | Change-Id: I4926d1f75ece220d28abf9f2e7081e41f0aaf339 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com> Reviewed-by: Martin Jansa <Martin.Jansa@gmail.com>
* | Do not assume QEGLPlatformCursor in the common egl bitsLaszlo Agocs2014-10-031-1/+1
| | | | | | | | | | | | | | The kms hook uses a custom QPlatformCursor. Change-Id: I4543df6314a45abfc20495cbffdd376aed8bbe93 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* | EGLFS: Fix plugin destruction (again)Louai Al-Khanji2014-10-032-9/+7
| | | | | | | | | | | | | | | | | | The previous patch was flawed since by the time the QEglPlatformIntegration destructor was called the virtual function table did not point to the methods in QEglFsPlatformIntegration any more. Change-Id: I310e5e3e734a22b44645ba912b579f193bcfae86 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | EGLFS: Fix plugin destructionLouai Al-Khanji2014-10-012-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The proper init/destruction order is as follows: QEglFsHooks::platformInit() eglInitialize() eglTerminate() QEglFsHooks::platformDestroy() Prior to this patch platformDestroy() was called before eglTerminate(), leading to a crash on some platforms. Additionally we need to destroy the native windows before deleting the screen, otherwise the QEglFSWindow destructor ends up calling into the deallocated screen. Change-Id: Id08ccbac9bb44a778bcf1a55f73c0057e0a7b3af Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-2920-380/+330
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/image/qimage.cpp src/gui/image/qppmhandler.cpp src/gui/kernel/qguiapplication.cpp src/gui/painting/qpaintengine_raster.cpp Change-Id: I7c1a8e7ebdfd7f7ae767fdb932823498a7660765
| * Update license headers and add new license filesMatti Paaso2014-09-2420-380/+220
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
| * Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-09-2310-0/+110
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The isAlwaysAskOption was removed in 38621713150b663355ebeb799a5a50d8e39a3c38 so manually removed code in src/plugins/bearer/connman/qconnmanengine.cpp Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qcollator_macx.cpp src/corelib/tools/qstring.cpp src/gui/kernel/qwindow.cpp src/gui/kernel/qwindow_p.h src/gui/text/qtextengine.cpp src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h src/plugins/platforms/android/qandroidinputcontext.cpp src/plugins/platforms/xcb/qglxintegration.cpp src/plugins/platforms/xcb/qglxintegration.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp src/testlib/qtestlog.cpp src/widgets/dialogs/qfiledialog.cpp src/widgets/kernel/qwindowcontainer.cpp tests/auto/corelib/tools/qcollator/tst_qcollator.cpp tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp Change-Id: Ic5d4187f682257a17509f6cd28d2836c6cfe2fc8
| | * Add missing private headers warningSamuel Gaist2014-09-0410-0/+110
| | | | | | | | | | | | | | | Change-Id: I7a4dd22ea3bcebf4c3ec3ad731628fd8f3c247e0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | EGLFS: Do not assume all hooks will want to create a QEGLPlatformCursorLouai Al-Khanji2014-09-161-0/+1
| | | | | | | | | | | | | | | Change-Id: I05502c27d697524fb4c4d4ccc3aec0e59589fe24 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | | eglconvenience: use qEnvironmentVariableIntValue()Marc Mutz2014-09-122-6/+6
|/ / | | | | | | | | | | | | | | It doesn't allocate memory, so cannot throw and is a lot faster than qgetenv(). Change-Id: Id50609c1f3511287d99e24b03e48c0a254893194 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Make the EGL platform cursor reset the array bufferLaszlo Agocs2014-09-022-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | Otherwise bad things happen if the application leaves a buffer bound. [ChangeLog] The eglfs mouse cursor properly resets the array buffer to prevent rendering issues. This, just like with vertex attributes and textures, requires applications to be aware of such state changes in swapBuffers(). Change-Id: I8b383cc867d8d0d0572773eacfa650e7b33b9680 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Prevent current context from becoming inconsistent upon create()Laszlo Agocs2014-09-011-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Platform plugins have a tendency to make the newly created native context current with a temporary surface. This is usually needed to query some information related to the new context. Afterwards most of them just reset to having nothing current. This has two issues: It unexpectedly changes the current context/surface. A call into QOpenGLContext::create() does not imply that the current context will get changed. This is the minor issue and we could probably live with it (at least if it had been documented). However, the real issue is that QOpenGLContext::currentContext() will become inconsistent: it will still report whatever was current before the create() even though on the EGL/WGL/GLX level that's not the case anymore. To prevent all this confusion the platform plugins can easily be changed to restore whatever context/surface was current before they altered it. Change-Id: I6a5b4597c86571327524ddb13e0d02538593cc7b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Make sure to have a pbuffer-capable config for the temp pbufferLaszlo Agocs2014-08-141-1/+5
| | | | | | | | | | | | | | | | | | The temporary pbuffer has to have a config that is pbuffer capable. Otherwise the makeCurrent() can potentially fail with drivers that strictly differentiate between the different configurations. Change-Id: Id63f52da5c5a1308072b1f1bb4b297ea6a547166 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Fix composition for windows with alphaLaszlo Agocs2014-08-132-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While we will cover the entire surface with our textured quads, the clear is still necessary in order to make top-levels with TranslucentBackground render correctly: We don't want to blend transparent areas with undefined content that is in the surface's framebuffer. Blending is problematic for alpha values. We now prevent the blended alpha from being written out. This ensures that in examples like qquickviewcomparison, where the backingstore image contains an alpha of 0.5 while the QQuickWidget texture 1.0, the result is still an alpha value of 1.0 in the final image. Writing out an alpha of 0.5 would break on systems where windows get an alpha buffer by default. hellogl2 can now take a --transparent parameter which makes the QOpenGLWidget being cleared to transparent in order to verify it works in combination with Qt::WA_TranslucentBackground. The swapped red and blue problem is also corrected. RGBA8888 does not need swizzling. The only format that needs this is RGB32. Task-number: QTBUG-40716 Change-Id: I54a9fd3a91a1b59575b38cdb908835315514e40f Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* | Make QOpenGLWidget publicLaszlo Agocs2014-08-012-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Add EglDisplay case to nativeResourceForContext on eglfsAndras Becsi2014-07-301-0/+4
| | | | | | | | | | | | | | | | | | | | This is needed to make it possible to use the same interface for retrieving the EGLDisplay on Windows and EGLFS, thus get rid of cluttering ifdefs. Change-Id: I37b848b1017eacbf8a29627cd157b74e22e5f40c Reviewed-by: Michael Bruning <michael.bruning@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | Use RGBA8888 always in the eglfs backingstoreLaszlo Agocs2014-07-091-8/+1
| | | | | | | | | | | | | | | | | | | | | | Do not try to be clever, this format works always. Using RGBX8888 for windows without alpha buffer was a bad idea because it broke renderToTexture widgets (QQuickWidget, QOpenGLWidget) which failed to properly draw the transparent rect with this format. Change-Id: I295d2f8c17490b59cc5e6b9d81035360da28ab3d Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>