summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@digia.com>2014-09-02 09:42:31 +0200
committerPaul Olav Tvete <paul.tvete@digia.com>2014-09-05 14:04:27 +0200
commitd98df9e929bd53c1d72ded2eca4e2ade899d01ba (patch)
treef6920d56373d43c0546931e03ce5410df8be56b2 /src/plugins
parent9c4c0443389fd3dace13a04849c8c03481d6cbdb (diff)
Android: don't recreate surface on shutdown
When we suspend the app, we destroy the surface to save resources. We don't want to create it again just as we are shutting down. Task-number: QTBUG-41072 Change-Id: I7a616249bee869b92716d0911201a80d73c2f8da Reviewed-by: Christian Stromme <christian.stromme@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/android/qandroideventdispatcher.h1
-rw-r--r--src/plugins/platforms/android/qandroidplatformopenglwindow.cpp4
2 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/platforms/android/qandroideventdispatcher.h b/src/plugins/platforms/android/qandroideventdispatcher.h
index 284c5fd392..295763ce5b 100644
--- a/src/plugins/platforms/android/qandroideventdispatcher.h
+++ b/src/plugins/platforms/android/qandroideventdispatcher.h
@@ -73,6 +73,7 @@ class QAndroidEventDispatcherStopper
{
public:
static QAndroidEventDispatcherStopper *instance();
+ static bool stopped() {return !instance()->started; }
void startAll();
void stopAll();
void addEventDispatcher(QAndroidEventDispatcher *dispatcher);
diff --git a/src/plugins/platforms/android/qandroidplatformopenglwindow.cpp b/src/plugins/platforms/android/qandroidplatformopenglwindow.cpp
index 73c0a76dd7..d3fb22094a 100644
--- a/src/plugins/platforms/android/qandroidplatformopenglwindow.cpp
+++ b/src/plugins/platforms/android/qandroidplatformopenglwindow.cpp
@@ -44,6 +44,7 @@
#include "qandroidplatformscreen.h"
#include "androidjnimain.h"
+#include "qandroideventdispatcher.h"
#include <QSurfaceFormat>
#include <QtGui/private/qwindow_p.h>
@@ -121,6 +122,9 @@ void QAndroidPlatformOpenGLWindow::setGeometry(const QRect &rect)
EGLSurface QAndroidPlatformOpenGLWindow::eglSurface(EGLConfig config)
{
+ if (QAndroidEventDispatcherStopper::stopped())
+ return m_eglSurface;
+
QMutexLocker lock(&m_surfaceMutex);
if (m_nativeSurfaceId == -1) {