diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-03-24 16:10:15 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-03-24 16:10:15 +0100 |
commit | 3b5c0bc0780f1749fed7c07bd8b691400a0282b7 (patch) | |
tree | 1022f5553ad5a0aca9b5f3b49ca38a01c2329d20 /src/plugins/platforms/android/qandroidplatformbackingstore.cpp | |
parent | c79918733a194ebbe5a2fe1617c884659f3e4b9f (diff) | |
parent | 21f1738a94fc8544ece04b3b1ee03a11986fe59b (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
src/gui/image/qjpeghandler.cpp
Change-Id: I9db3acea7d5c82f5da679c8eaeb29431136665f0
Diffstat (limited to 'src/plugins/platforms/android/qandroidplatformbackingstore.cpp')
-rw-r--r-- | src/plugins/platforms/android/qandroidplatformbackingstore.cpp | 21 |
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 ®ion, 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 |