iOS: Use composeAndFlush() to flush all backing store updates

QPlatformBackingStore::composeAndFlush() handles an empty texture list
just fine, and results in the same blitting of the backing store image
as we're doing today using the OpenGL paint engine, except the compose
and flush code path is a lot more optimized.

Among other things it clears the render buffer as the first step (as
recommended by Apple on iOS), doesn't re-create the backing store
texture each pass just because the image has changed, and respects
the flushed region for both the texture upload (using glTexSubImage2D)
and when blitting the texture.

The result is a 10x increase in frames per second when blitting full
screen updates.

Change-Id: I163fab473751f8201758a5684b18d80bb90d42fb
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
This commit is contained in:
Tor Arne Vestbø 2016-03-16 16:27:06 +01:00
parent bec47545dc
commit 8ed76a6e4f

View File

@ -149,12 +149,12 @@ void QIOSBackingStore::flush(QWindow *window, const QRegion &region, const QPoin
}
if (window->surfaceType() == QSurface::RasterGLSurface) {
QPainter painter(m_glDevice);
painter.drawImage(QPoint(), m_image);
static QPlatformTextureList emptyTextureList;
composeAndFlush(window, region, offset, &emptyTextureList, m_context, false);
} else {
m_context->makeCurrent(window);
m_context->swapBuffers(window);
}
m_context->makeCurrent(window);
m_context->swapBuffers(window);
}
void QIOSBackingStore::resize(const QSize &size, const QRegion &staticContents)