diff options
author | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2014-11-26 15:40:47 +0100 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2014-12-05 14:25:09 +0100 |
commit | 8015ffef1ea1f2745d6554b2bc57d150439292b3 (patch) | |
tree | 813b2b7cc7199beddaff07e229b8ff6173f14637 /src/plugins/platforms/android | |
parent | a43684c0da78e7187fd2f4fc05791064174da9de (diff) |
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>
Diffstat (limited to 'src/plugins/platforms/android')
-rw-r--r-- | src/plugins/platforms/android/qandroidplatformscreen.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
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; |