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
parent
7f7d752012
commit
ad4cf5068c
|
|
@ -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.
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue