diff options
author | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2017-05-10 10:11:17 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2017-05-10 10:11:57 +0200 |
commit | 6881e1613af3e31ca3cd6b297e7756bb61d2f038 (patch) | |
tree | 5398aaf4536d6c3f93869cf671ee0dbc42072ae1 /src/plugins/platforms/windows/qwindowswindow.cpp | |
parent | 3ae34b7ead938dc716e2fad2fa686d6867466255 (diff) | |
parent | 7f80c96432270e0097883e11e632c14cba68da28 (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I172e3e19ddcc5b7665e6c8382d725e7cc4f9794f
Diffstat (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 79ae4c004b..818bff2693 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1695,6 +1695,16 @@ static inline bool dwmIsCompositionEnabled() return SUCCEEDED(DwmIsCompositionEnabled(&dWmCompositionEnabled)) && dWmCompositionEnabled == TRUE; } +static inline bool isSoftwareGl() +{ +#if QT_CONFIG(dynamicgl) + return QOpenGLStaticContext::opengl32.moduleIsNotOpengl32() + && QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL; +#else + return false; +#endif // dynamicgl +} + bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message, WPARAM, LPARAM) { @@ -1706,15 +1716,10 @@ bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message, return false; PAINTSTRUCT ps; -#if QT_CONFIG(dynamicgl) - // QTBUG-58178: GL software rendering needs InvalidateRect() to suppress - // artifacts while resizing. - if (testFlag(OpenGLSurface) - && QOpenGLStaticContext::opengl32.moduleIsNotOpengl32() - && QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) { + // GL software rendering (QTBUG-58178) and Windows 7/Aero off with some AMD cards + // (QTBUG-60527) need InvalidateRect() to suppress artifacts while resizing. + if (testFlag(OpenGLSurface) && (isSoftwareGl() || !dwmIsCompositionEnabled())) InvalidateRect(hwnd, 0, false); - } -#endif // dynamicgl BeginPaint(hwnd, &ps); |