summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android/qandroidplatformbackingstore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/android/qandroidplatformbackingstore.cpp')
-rw-r--r--src/plugins/platforms/android/qandroidplatformbackingstore.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformbackingstore.cpp b/src/plugins/platforms/android/qandroidplatformbackingstore.cpp
index b85b1157a8..ff49f59076 100644
--- a/src/plugins/platforms/android/qandroidplatformbackingstore.cpp
+++ b/src/plugins/platforms/android/qandroidplatformbackingstore.cpp
@@ -50,11 +50,8 @@ QT_BEGIN_NAMESPACE
QAndroidPlatformBackingStore::QAndroidPlatformBackingStore(QWindow *window)
: QPlatformBackingStore(window)
{
- Q_ASSERT(window->handle());
- if (window->surfaceType() == QSurface::RasterSurface)
- (static_cast<QAndroidPlatformRasterWindow *>(window->handle()))->setBackingStore(this);
- else
- qWarning("QAndroidPlatformBackingStore does not support GL windows.");
+ if (window->handle())
+ setBackingStore(window);
}
QPaintDevice *QAndroidPlatformBackingStore::paintDevice()
@@ -64,9 +61,11 @@ QPaintDevice *QAndroidPlatformBackingStore::paintDevice()
void QAndroidPlatformBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
{
- Q_UNUSED(window);
Q_UNUSED(offset);
+ if (!m_backingStoreSet)
+ setBackingStore(window);
+
(static_cast<QAndroidPlatformRasterWindow *>(window->handle()))->repaint(region);
}
@@ -78,4 +77,14 @@ void QAndroidPlatformBackingStore::resize(const QSize &size, const QRegion &stat
m_image = QImage(size, window()->screen()->handle()->format());
}
+void QAndroidPlatformBackingStore::setBackingStore(QWindow *window)
+{
+ if (window->surfaceType() == QSurface::RasterSurface) {
+ (static_cast<QAndroidPlatformRasterWindow *>(window->handle()))->setBackingStore(this);
+ m_backingStoreSet = true;
+ } else {
+ qWarning("QAndroidPlatformBackingStore does not support GL windows.");
+ }
+}
+
QT_END_NAMESPACE