summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android/qandroidplatformwindow.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-08-20 11:48:02 +0200
committerLaszlo Agocs <laszlo.agocs@digia.com>2014-08-25 17:40:23 +0200
commita4f50269f82695fbd0dd344f87b4b355feff4333 (patch)
tree7ae4b01a38b483c6446d5ee4dda1ac09a9bd4f9f /src/plugins/platforms/android/qandroidplatformwindow.h
parent86886566410cf7cc4587b3fbb851b3615067cca4 (diff)
Support QOpenGLWidget and QQuickWidget on Android
It gets somewhat complicated due to the fact that a RasterGLSurface window (i.e. any widget window since 5.3) may behave either like an OpenGLSurface or a RasterSurface, and the expected behavior may change on each backingstore sync. This does not fit designs where the platform window implementation is separated and there is different behavior for raster and GL windows. Therefore QAndroidPlatformOpenGLWindow is now made capable of behaving like the raster one, based on a flag communicated from the widget stack via QWindowPrivate (since the plugin knows nothing about widgets). This means that widget windows that do not have renderToTexture children (QOpenGLWidget, QQuickWidget) will go through the raster path, while the ones that have will behave like an OpenGL window with the actual rendering happening in QPlatformBackingStore::composeAndFlush(). The surface type is RasterGLSurface in both cases nonetheless. Task-number: QTBUG-37907 Change-Id: I6f9261fc0fd993afcda7f30d379c5410069033d3 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/plugins/platforms/android/qandroidplatformwindow.h')
-rw-r--r--src/plugins/platforms/android/qandroidplatformwindow.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformwindow.h b/src/plugins/platforms/android/qandroidplatformwindow.h
index 91e32fa2ac..1899499d01 100644
--- a/src/plugins/platforms/android/qandroidplatformwindow.h
+++ b/src/plugins/platforms/android/qandroidplatformwindow.h
@@ -49,6 +49,7 @@
QT_BEGIN_NAMESPACE
class QAndroidPlatformScreen;
+class QAndroidPlatformBackingStore;
class QAndroidPlatformWindow: public QPlatformWindow
{
@@ -71,10 +72,19 @@ public:
void propagateSizeHints();
void requestActivateWindow();
void updateStatusBarVisibility();
- inline bool isRaster() const { return window()->surfaceType() == QSurface::RasterSurface; }
+ inline bool isRaster() const {
+ return window()->surfaceType() == QSurface::RasterSurface
+ || window()->surfaceType() == QSurface::RasterGLSurface;
+ }
bool isExposed() const;
virtual void applicationStateChanged(Qt::ApplicationState);
+
+ void setBackingStore(QAndroidPlatformBackingStore *store) { m_backingStore = store; }
+ QAndroidPlatformBackingStore *backingStore() const { return m_backingStore; }
+
+ virtual void repaint(const QRegion &) { }
+
protected:
void setGeometry(const QRect &rect);
@@ -83,6 +93,8 @@ protected:
Qt::WindowState m_windowState;
WId m_windowId;
+
+ QAndroidPlatformBackingStore *m_backingStore = nullptr;
};
QT_END_NAMESPACE