mirror of https://github.com/qt/qtbase.git
Fix QOpenGLWidget/QQuickWidget GUI freeze
A window with a renderToTexture child uses the OpenGL path, but when we open a popup or dialog, that uses the raster compositor, which opens a separate surface. This patch fixes two issues when combining GL rendering with the raster compositor: 1. GL-rendered widgets were counted as part of the raster-rendered region, meaning that we did not punch a hole in the raster surface. 2. We did not destroy the surface when no longer needed. Task-number: QTBUG-41467 Change-Id: I2a2a0e860cce065b330df1c864d51fd02103aa1b Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com> Reviewed-by: BogDan Vatra <bogdan@kde.org> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
This commit is contained in:
parent
a43684c0da
commit
8015ffef1e
|
@ -284,9 +284,9 @@ void QAndroidPlatformScreen::doRedraw()
|
|||
if (m_dirtyRect.isEmpty())
|
||||
return;
|
||||
|
||||
// Stop if there no visible raster windows. This is important because if we only have
|
||||
// RasterGLSurface windows that have renderToTexture children (i.e. they need the
|
||||
// OpenGL path) then we must bail out right now.
|
||||
// Stop if there are no visible raster windows. If we only have RasterGLSurface
|
||||
// windows that have renderToTexture children (i.e. they need the OpenGL path) then
|
||||
// we do not need an overlay surface.
|
||||
bool hasVisibleRasterWindows = false;
|
||||
foreach (QAndroidPlatformWindow *window, m_windowStack) {
|
||||
if (window->window()->isVisible() && window->isRaster() && !qt_window_private(window->window())->compositing) {
|
||||
|
@ -294,9 +294,13 @@ void QAndroidPlatformScreen::doRedraw()
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (!hasVisibleRasterWindows)
|
||||
if (!hasVisibleRasterWindows) {
|
||||
if (m_id != -1) {
|
||||
QtAndroid::destroySurface(m_id);
|
||||
m_id = -1;
|
||||
}
|
||||
return;
|
||||
|
||||
}
|
||||
QMutexLocker lock(&m_surfaceMutex);
|
||||
if (m_id == -1 && m_rasterSurfaces) {
|
||||
m_id = QtAndroid::createSurface(this, m_availableGeometry, true, m_depth);
|
||||
|
@ -339,6 +343,7 @@ void QAndroidPlatformScreen::doRedraw()
|
|||
QRegion visibleRegion(m_dirtyRect);
|
||||
foreach (QAndroidPlatformWindow *window, m_windowStack) {
|
||||
if (!window->window()->isVisible()
|
||||
|| qt_window_private(window->window())->compositing
|
||||
|| !window->isRaster())
|
||||
continue;
|
||||
|
||||
|
|
Loading…
Reference in New Issue