iOS: Don't recreate paint device on beginPaint()

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ø <tor.arne.vestbo@digia.com>
bb10
Morten Johan Sørvig 2012-11-16 07:36:49 +01:00 committed by Tor Arne Vestbø
parent 7f7d752012
commit ad4cf5068c
1 changed files with 3 additions and 3 deletions

View File

@ -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 &region, 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.
}