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 <louai.al-khanji@theqtcompany.com>
bb10
Andrew Knight 2014-10-28 09:23:25 +02:00 committed by Louai Al-Khanji
parent a570e8b0f6
commit d6c1a9cb26
1 changed files with 4 additions and 5 deletions

View File

@ -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<QWindowsDirect2DBitmap> QWindowsDirect2DWindow::copyBackBuffer() const