From ad4cf5068cd39b9ca16bdd9705d0a3ef61783d33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 16 Nov 2012 07:36:49 +0100 Subject: iOS: Don't recreate paint device on beginPaint() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This causes painting errors. Use one lazily-created device that is used for the lifetime of the backing store. Change-Id: Ib36b6f1d6c9f958304dc8403cf17e5d71136469a Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qiosbackingstore.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/ios/qiosbackingstore.mm b/src/plugins/platforms/ios/qiosbackingstore.mm index 71f14fdd91..6cefc03377 100644 --- a/src/plugins/platforms/ios/qiosbackingstore.mm +++ b/src/plugins/platforms/ios/qiosbackingstore.mm @@ -60,6 +60,7 @@ QIOSBackingStore::QIOSBackingStore(QWindow *window) QIOSBackingStore::~QIOSBackingStore() { delete m_context; + delete m_device; } void QIOSBackingStore::beginPaint(const QRegion &) @@ -68,7 +69,8 @@ void QIOSBackingStore::beginPaint(const QRegion &) window()->setSurfaceType(QSurface::OpenGLSurface); m_context->makeCurrent(window()); - m_device = new QOpenGLPaintDevice(window()->size()); + if (!m_device) + m_device = new QOpenGLPaintDevice(window()->size()); } QPaintDevice *QIOSBackingStore::paintDevice() @@ -86,8 +88,6 @@ void QIOSBackingStore::flush(QWindow *window, const QRegion ®ion, const QPoin void QIOSBackingStore::endPaint() { - delete m_device; - // Calling makeDone() on the context here would be an option, // but is not needed, and would actually add some overhead. } -- cgit v1.2.3