From 8015ffef1ea1f2745d6554b2bc57d150439292b3 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 26 Nov 2014 15:40:47 +0100 Subject: 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 Reviewed-by: BogDan Vatra Reviewed-by: Eskil Abrahamsen Blomfeldt Reviewed-by: Laszlo Agocs --- src/plugins/platforms/android/qandroidplatformscreen.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/plugins/platforms/android') diff --git a/src/plugins/platforms/android/qandroidplatformscreen.cpp b/src/plugins/platforms/android/qandroidplatformscreen.cpp index 684ae64703..b70f936be1 100644 --- a/src/plugins/platforms/android/qandroidplatformscreen.cpp +++ b/src/plugins/platforms/android/qandroidplatformscreen.cpp @@ -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; -- cgit v1.2.3