diff options
author | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2016-03-16 16:27:06 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2016-03-18 15:09:39 +0000 |
commit | 8ed76a6e4f5a86c98f12e8669ad664dd1d8ba7bb (patch) | |
tree | b6ddd89dc244c1245503473df1e47b797b173db3 /src/plugins | |
parent | bec47545dc7570bad2af3975ad3b92496ce6d9a3 (diff) |
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>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/ios/qiosbackingstore.mm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/platforms/ios/qiosbackingstore.mm b/src/plugins/platforms/ios/qiosbackingstore.mm index 3887596a9b..fb0c9805f9 100644 --- a/src/plugins/platforms/ios/qiosbackingstore.mm +++ b/src/plugins/platforms/ios/qiosbackingstore.mm @@ -149,12 +149,12 @@ void QIOSBackingStore::flush(QWindow *window, const QRegion ®ion, 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) |