path: root/src/plugins/platforms/ios
diff options
authorTor Arne Vestbø <>2012-12-10 17:11:15 +0100
committerTor Arne Vestbø <>2013-02-27 23:55:50 +0100
commitd059866eb43a7415dd786a2bcba14f729d938675 (patch)
treefb105b61eb771dd40c3f11e3cd0a888711cf6ae5 /src/plugins/platforms/ios
parent8dde67fcd33fc35fe95262bd7acb6f7b5143fead (diff)
iOS: Keep QIOSBackingStore's paint device size in sync with the window
Treating the paint-device as a thing wrapper around the OpenGL paint engine failed when the window was resized, as the paint engine would clip the drawing to the old size. We need to update the size in beginPaint. QBackingStore resize still behaves like before, and we emit a warning if the user tries to resize the backing-store to some other size than the window size, as that's not a supported use-case for our iOS backing store. Change-Id: I1a0eeb65fa9db8b5538dc69963d6fc84be6e63f1 Reviewed-by: Richard Moe Gustavsen <>
Diffstat (limited to 'src/plugins/platforms/ios')
1 files changed, 11 insertions, 5 deletions
diff --git a/src/plugins/platforms/ios/ b/src/plugins/platforms/ios/
index dfa41f0003..6bae08ce2b 100644
--- a/src/plugins/platforms/ios/
+++ b/src/plugins/platforms/ios/
@@ -69,12 +69,14 @@ void QIOSBackingStore::beginPaint(const QRegion &)
+ static_cast<QOpenGLPaintDevice *>(paintDevice())->setSize(window()->size());
QPaintDevice *QIOSBackingStore::paintDevice()
if (!m_device)
- m_device = new QOpenGLPaintDevice(window()->size());
+ m_device = new QOpenGLPaintDevice;
return m_device;
@@ -95,12 +97,16 @@ void QIOSBackingStore::endPaint()
void QIOSBackingStore::resize(const QSize &size, const QRegion &staticContents)
- Q_UNUSED(size);
- // We don't need to resize the QOpenGLPaintDevice, as it's just a thin wrapper
- // around the OpenGL paint-engine, and the real geometry is handled by the
- // context and window.
+ // Resizing the backing store would in our case mean resizing the QWindow,
+ // as we cheat and use an QOpenGLPaintDevice that we target at the window.
+ // That's probably not what the user intended, so we ignore resizes of the
+ // backing store and always keep the paint device's size in sync with the
+ // window size in beginPaint().
+ if (size != window()->size())
+ qWarning() << "QIOSBackingStore needs to have the same size as its window";