From d6c1a9cb267cc5ffec2e55bc9990ced43c19b73a Mon Sep 17 00:00:00 2001 From: Andrew Knight Date: Tue, 28 Oct 2014 09:23:25 +0200 Subject: direct2d: Fix window resize with translucent windows If the size of the window has changed, the backing bitmap should be reset with the new geometry. Change-Id: I1ca430cd7b5df1845b4fef31f5bf8f05d889a2fc Reviewed-by: Louai Al-Khanji --- src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/plugins/platforms/direct2d') diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp index ef02d77375..c89d293d1d 100644 --- a/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp +++ b/src/plugins/platforms/direct2d/qwindowsdirect2dwindow.cpp @@ -199,12 +199,13 @@ void QWindowsDirect2DWindow::setupSwapChain() void QWindowsDirect2DWindow::resizeSwapChain(const QSize &size) { - if (!m_swapChain) - return; - m_pixmap.reset(); m_bitmap.reset(); m_deviceContext->SetTarget(Q_NULLPTR); + m_needsFullFlush = true; + + if (!m_swapChain) + return; HRESULT hr = m_swapChain->ResizeBuffers(0, size.width(), size.height(), @@ -212,8 +213,6 @@ void QWindowsDirect2DWindow::resizeSwapChain(const QSize &size) 0); if (FAILED(hr)) qWarning("%s: Could not resize swap chain: %#x", __FUNCTION__, hr); - - m_needsFullFlush = true; } QSharedPointer QWindowsDirect2DWindow::copyBackBuffer() const -- cgit v1.2.3