summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/winrt
diff options
context:
space:
mode:
authorAndrew Knight <andrew.knight@theqtcompany.com>2014-12-01 09:57:15 +0200
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>2014-12-01 20:03:50 +0100
commit2903db0469487944f035aff1c44e69605d48fa8f (patch)
tree410d406fbc6152eb56b4b3d7a555436f61be5b9a /src/plugins/platforms/winrt
parent03b5ecce4ab8dc879e27dc8f07d6f3ef846efde0 (diff)
winrt: Fix Windows Store Certification
WinRT requires that IDXGIDevice3::Trim() is called on application suspend in order to pass Store Certification. Task-number: QTBUG-38481 Change-Id: Ia3cb5d3f6a2db8f11e4bfa4fd5c7791e18d6c36d Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/winrt')
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp
index fadcd01b06..612a50f6b7 100644
--- a/src/plugins/platforms/winrt/qwinrtscreen.cpp
+++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp
@@ -37,6 +37,9 @@
#include <EGL/eglext.h>
#include <d3d11.h>
#include <dxgi1_2.h>
+#ifndef Q_OS_WINPHONE
+#include <dxgi1_3.h>
+#endif
#include "qwinrtbackingstore.h"
#include "qwinrtinputcontext.h"
@@ -1113,6 +1116,16 @@ HRESULT QWinRTScreen::onActivated(ICoreWindow *, IWindowActivatedEventArgs *args
HRESULT QWinRTScreen::onSuspended(IInspectable *, ISuspendingEventArgs *)
{
+#ifndef Q_OS_WINPHONE
+ Q_D(QWinRTScreen);
+ ComPtr<ID3D11Device> d3dDevice;
+ const EGLBoolean ok = eglQuerySurfacePointerANGLE(d->eglDisplay, EGL_NO_SURFACE, EGL_DEVICE_EXT, (void **)d3dDevice.GetAddressOf());
+ if (ok && d3dDevice) {
+ ComPtr<IDXGIDevice3> dxgiDevice;
+ if (SUCCEEDED(d3dDevice.As(&dxgiDevice)))
+ dxgiDevice->Trim();
+ }
+#endif
QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationSuspended);
QWindowSystemInterface::flushWindowSystemEvents();
return S_OK;