From 2903db0469487944f035aff1c44e69605d48fa8f Mon Sep 17 00:00:00 2001 From: Andrew Knight Date: Mon, 1 Dec 2014 09:57:15 +0200 Subject: 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 --- src/plugins/platforms/winrt/qwinrtscreen.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/plugins/platforms/winrt') 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 #include #include +#ifndef Q_OS_WINPHONE +#include +#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 d3dDevice; + const EGLBoolean ok = eglQuerySurfacePointerANGLE(d->eglDisplay, EGL_NO_SURFACE, EGL_DEVICE_EXT, (void **)d3dDevice.GetAddressOf()); + if (ok && d3dDevice) { + ComPtr dxgiDevice; + if (SUCCEEDED(d3dDevice.As(&dxgiDevice))) + dxgiDevice->Trim(); + } +#endif QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationSuspended); QWindowSystemInterface::flushWindowSystemEvents(); return S_OK; -- cgit v1.2.3 From 5367fa356233da4c0f28172a8f817791525f5457 Mon Sep 17 00:00:00 2001 From: Andrew Knight Date: Thu, 4 Dec 2014 15:21:28 +0200 Subject: winrt: Fix window resize The fixed-size EGL display must be updated on PC as well as Windows Phone. Task-number: QTBUG-43112 Change-Id: I0ba90370b67e8c065843e5754579e341b647266d Reviewed-by: Oliver Wolff --- src/plugins/platforms/winrt/qwinrtscreen.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/plugins/platforms/winrt') diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp index 612a50f6b7..37a3ff3d63 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.cpp +++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp @@ -1081,12 +1081,14 @@ HRESULT QWinRTScreen::onSizeChanged(ICoreWindow *, IWindowSizeChangedEventArgs * d->logicalSize = logicalSize; if (d->eglDisplay) { const QRect newGeometry = geometry(); -#ifdef Q_OS_WINPHONE // Resize the EGL window - const int width = newGeometry.width() * (d->orientation == Qt::InvertedPortraitOrientation || d->orientation == Qt::LandscapeOrientation ? -1 : 1); - const int height = newGeometry.height() * (d->orientation == Qt::InvertedPortraitOrientation || d->orientation == Qt::InvertedLandscapeOrientation ? -1 : 1); + int width = newGeometry.width(); + int height = newGeometry.height(); +#ifdef Q_OS_WINPHONE // Windows Phone can pass in a negative size to provide orientation information + width *= (d->orientation == Qt::InvertedPortraitOrientation || d->orientation == Qt::LandscapeOrientation) ? -1 : 1; + height *= (d->orientation == Qt::InvertedPortraitOrientation || d->orientation == Qt::InvertedLandscapeOrientation) ? -1 : 1; +#endif eglSurfaceAttrib(d->eglDisplay, d->eglSurface, EGL_WIDTH, width); eglSurfaceAttrib(d->eglDisplay, d->eglSurface, EGL_HEIGHT, height); -#endif QWindowSystemInterface::handleScreenGeometryChange(screen(), newGeometry, newGeometry); QPlatformScreen::resizeMaximizedWindows(); handleExpose(); -- cgit v1.2.3