summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/winrt/qwinrteglcontext.cpp
Commit message (Collapse)AuthorAgeFilesLines
* winrt: QWinRTEGLContext: add isValid functionalityOliver Wolff2018-04-131-0/+6
| | | | | | | | | | | | | QPlatformOpenGLContext::isValid always returns true but it is possible that creation of the context fails in QWinRTEGLContext. This case should be reflected in isValid because other places (like QOpenGLContext::isValid()) rely on it and not having proper information about the validity of the context might lead to crashes. Task-number: QTBUG-67568 Change-Id: If989ca47cdf7b27c44961beee5d97a4647184b0a Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* port to modularized platformsupport librariesOswald Buddenhagen2016-10-151-2/+2
| | | | | Change-Id: I20eb0e33abfd70b6a5240e7b6b0aa0425f2d2ee7 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* winrt: Skip context validation in ANGLEOliver Wolff2016-04-251-0/+1
| | | | | | | | | | The flag causes context validation to be skipped by ANGLE. If validation is active nothing is rendered on Windows Phone (just a black screen) for widget applications. Everything works as expected without validation so we do without it. Change-Id: I6f9ea249b653ba5a602bc33e75105c57b686b92d Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Unify license header usage.Jani Heikkinen2016-03-291-12/+15
| | | | | | | | | Update files using old header.LGPL3 to header.LGPL Update files using old FDL template to use new one Update files using old BSD template to use new one Change-Id: I36a78272516f9953d02956522f285b40adfc8915 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Avoid repeated QByteArray creation when resolving opengl functionsLars Knoll2016-03-011-2/+2
| | | | | | | | | | Add an getProcAddress(const char *) overload to QOpenGLContext, and refactor the QPA interface to take a const char *. Like this we can avoid lots of mallocs when resoving GL methods. Change-Id: Ic45b985fbaa0da8d32ba3e3b485351173352ca6f Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-181-6/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also reverts commit 018e670a26ff5a61b949100ae080f5e654e7bee8. The change was introduced in 5.6. After the refactoring, 14960f52, in 5.7 branch and a merge, it is not needed any more. Conflicts: .qmake.conf src/corelib/io/qstandardpaths_mac.mm src/corelib/tools/qsharedpointer_impl.h tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp Change-Id: If4fdff0ebf2b9b5df9f9db93ea0022d5ee3da2a4
| * winrt: Add support for offscreen surfacesMaurice Kalinowski2016-01-261-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously offscreen surfaces were only needed to properly shutdown Qt Quick applications and the scene graph to have something to potentially render into but not show on the screen. However, Canvas3D requires a fully functional surface, preferably offscreen. Hence we use the QEGLPbuffer provided by eglconvenience in platformsupport. Task-number: QTBUG-50576 Change-Id: I1a32820bb2f2c6823be4e96dd92cf7965566f2c3 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com> Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* | Merge remote-tracking branch 'origin/5.6' into devSimon Hausmann2016-01-121-6/+15
|\| | | | | | | Change-Id: I5839bded07e23af65ced9491c4f50242f964dd31
| * winphone: Properly close the applicationMaurice Kalinowski2016-01-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When shutting down an application on Windows Phone the SceneGraph tries to create an offscreen surface to render into. If there is no offscreen surface available, it creates a new native window and tries to hide it. As the native event loop is about to shut down, creation fails and exceptions are raised. Instead we create a vanilla QPlatformOffscreenSurface. The SceneGraph recognizes it as such and can handle a proper cleanup on its own. Furthermore removing the suspend/resume handler in the destructor of QWinRTIntegration fails for Windows Phone as the application object itself does not accept this anymore. Hence skip this part for this platform. Task-number: QTBUG-49310 Change-Id: I02acdd5a635ef0b9d6ef8199376537b8f0f1a8fb Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
| * WinRT: Fix application shutdownMaurice Kalinowski2016-01-111-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not create a dummy eglDisplay when the global static is constructed. This causes ANGLE to wrongly set some internals, which breaks usage of EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE as the attribute map might be empty after calling eglGetPlatformDisplayEXT. Furthermore initialize() assigns a new display to it without terminating the old one. This way, the internal suspend handler in ANGLE (Trim11.cpp) will be added to the application. The suspend handler is not invoked when an application suspends though. Reason being that the handler needs to be added from inside the Xaml thread. As we cannot control this inside ANGLE, we will call eglInitialize inside the Xaml thread and hence get the suspend event properly. Task-number: QTBUG-50337 Task-number: QTBUG-50292 Change-Id: I3867377254c37084bf24f18e78af467f6237db57 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | Use Q_UNLIKELY for every qFatal()/qCritical()Marc Mutz2015-11-291-3/+3
|/ | | | | | | | | | | | | | | | | | | | | If, after checking a condition, we issue a qFatal() or a qCritical(), by definition that check is unlikely to be true. Tell the compiler so it can move the error handling code out of the normal code path to increase the effective icache size. Moved conditional code around where possible so that we could always use Q_UNLIKELY, instead of having to revert to Q_LIKELY here and there. In some cases, simplified the expressions newly wrapped in Q_UNLIKELY as a drive-by. Change-Id: I67537d62b04bc6977d69254690c5ebbdf98bfd6d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* WinRT: Add support for QOpenGLWidgetLaszlo Agocs2015-11-021-3/+7
| | | | | | | | | Also involves adding support for sharing contexts. Task-number: QTBUG-48663 Change-Id: I0b18846ae70b63a0a21132f820a12ea744c0e936 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* winrt: store egldisplay globallyMaurice Kalinowski2015-10-301-16/+29
| | | | | | | | | | The QWinRTEGLContext must not store the display, as it might get destroyed while other objects still need it, for instance QWinRTWindow to delete the surface. Rather create a global static for creating the display once and delete it when application lifecycle ends. Change-Id: Id176b6934e1d1327f5bb70ad0d258de91f675041 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* winrt: initialize EGL display with automatic Trim and WARPAndrew Knight2015-10-301-1/+16
| | | | | | | | | | | The minimum feature level is now detected before requesting a display. If it is less than 9_3, use the WARP device instead. Task-Id: QTBUG-44495 Task-Id: QTBUG-44694 Change-Id: I9f81f4f92269fab73c291f7373aa07236c7e5f98 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* winrt: Move EGL surface to window.Samuel Nevala2015-09-141-21/+9
| | | | | | | | | | Fixes GPU memory leak when window is created/deleted dynamically and repeatedly. EGL context used to own EGL surface, but the context outlives the surface if window is created/deleted dynamically. The EGL surface is now owned by the window and destroyed with it. Change-Id: Ib949261ef6e77217018e60aad3e36e4a6d2eaba0 Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
* winrt: Refactor platform plugin for XAML supportAndrew Knight2015-08-131-20/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By using XAML as the platform compositor, many benefits are possible: - Better input context handling for tablets - Better multiple window support (including non-fullscreen windows) - Support for transparent windows and window opacity - Integration with native platform controls - Simpler orientation handling on Windows Phone with built-in transitions This patch applies only the minimal parts to make XAML mode work just as the raw D3D mode. It does this by: - Moving all OpenGL parts into QWinRTEGLContext. This will allow us to have non-OpenGL windows later (e.g. Direct2D raster surfaces). - Moving more window-specific parts into QWinRTWindow. Each window creates a SwapChainPanel which can then be used for ANGLE (or Direct2D) content. - Moving non screen-specific parts into QWinRTIntegration. - Having QWinRTScreen create the base XAML element Canvas. - Running certain calls on the UI thread where necessary. The following code parts were removed: - The UIAutomationCore code in QWinRTInputContext, as this is incompatible with XAML automation. - The D3D Trim and device blacklist, as these have been fixed in ANGLE. - Core dispatcher processing in QEventDispatcherWinRT. Now there is only one native event dispatcher; it is always running and never needs to be pumped. Future commits should address: - Maintaining the window stack list and visibility using the XAML Canvas. - Allowing for windows (e.g. popups) to be sized and positioned instead of fullscreen. - Using the XAML automation API to improve the platform input context. [ChangeLog][QPA][winrt] Windows Store apps are now composited inside a XAML container, allowing for tighter integration with the native UI layer. Change-Id: I285c6dea657c5dab2fda2b1bd8e8e5dd15882c72 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* Updated WinRT license headers to use LGPLv3 instead of LGPLv21Jani Heikkinen2015-05-201-10/+13
| | | | | | | | | From 5.5.0 -> WinRT port is licensed with LGPLv3, see http://blog.qt.io/blog/2015/04/29/windows-10-support-in-qt/ Change-Id: I7e42564276af3fdbd0d4c61e2736610fa698b11c Reviewed-by: Tuukka Turunen <tuukka.turunen@digia.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* winrt: Use ANGLE sub-buffer swap on Windows PhoneAndrew Knight2015-05-081-0/+14
| | | | | | | | | This allows the plugin to communicate the swap region to ANGLE and avoid glitches when the orientation changes. Task-number: QTBUG-44333 Change-Id: I40240cbcb3aaec92dbf4a82f4957965e92b9c3da Reviewed-by: Oliver Wolff <oliver.wolff@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>
* winrt: Blacklist certain devices from creating a depth/stencil bufferAndrew Knight2014-11-141-2/+2
| | | | | | | | | | | This passes the EGLConfig created in the platform screen to the underlying context, and certain GPUs are blacklisted to be prevented from creating a configuration which does not render properly with Qt Quick. Task-number: QTBUG-42260 Change-Id: I7e1cdc33c2f5662538723c6930fad5f13b151d6f Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.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>
* winrt: Fix EGL context getProcAddress()Andrew Knight2014-08-051-0/+155
| | | | | | | | As ANGLE doesn't resolve non-extension functions, these need to be resolved manually. Change-Id: I0fe45005f662f7d7f2b53c09ef129efd65fb999a Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Remove unused parameter from QEGLPlatformContext constructorLaszlo Agocs2014-03-101-1/+1
| | | | | | | | The API is chosen via QSurfaceFormat, the constructor argument is ignored. Remove this historical artifact. Change-Id: I4a5c1e12cb297de22f239ad0a6747c1c36168eed Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Windows RT and Windows Phone QPAAndrew Knight2013-10-021-0/+63
Change-Id: I6ab8af31f73439172e43fb709831821482b1cc99 Done-with: Kamil Trzcinski Done-with: Oliver Wolff Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>