summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiosbackingstore.mm
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2016-03-16 16:27:06 +0100
committerTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2016-03-18 15:09:39 +0000
commit8ed76a6e4f5a86c98f12e8669ad664dd1d8ba7bb (patch)
treeb6ddd89dc244c1245503473df1e47b797b173db3 /src/plugins/platforms/ios/qiosbackingstore.mm
parentbec47545dc7570bad2af3975ad3b92496ce6d9a3 (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/platforms/ios/qiosbackingstore.mm')
-rw-r--r--src/plugins/platforms/ios/qiosbackingstore.mm10
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 &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)