From 02e406ac50e7e57ad50d9596e9db1b32639a6a8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 30 Apr 2013 12:33:02 +0200 Subject: iOS: Don't pretend like our OpenGL context is single-buffered MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Internally iOS double-buffers its rendering using copy instead of flipping, so we reported that our context was single-buffered so that clients could take advantage of the unchanged buffer. This failed when clients (such as Qt itself) then assumed that calling swapBufferes() was not needed. We now properly report that we're double-buffered, and we'll have to find another way to report the way double-buffering works if that's still an optimization we'd like to provide to clients. Change-Id: Id2e4faa68ed3b837ad01d6f22b2927fc9c9769c2 Reviewed-by: Richard Moe Gustavsen Reviewed-by: Samuel Rødal --- src/plugins/platforms/ios/qioscontext.mm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/plugins/platforms/ios') diff --git a/src/plugins/platforms/ios/qioscontext.mm b/src/plugins/platforms/ios/qioscontext.mm index 9467cfdb42..807c75df54 100644 --- a/src/plugins/platforms/ios/qioscontext.mm +++ b/src/plugins/platforms/ios/qioscontext.mm @@ -58,10 +58,11 @@ QIOSContext::QIOSContext(QOpenGLContext *context) m_format.setMajorVersion(2); m_format.setMinorVersion(0); - // Even though iOS internally double-buffers its rendering, we - // report single-buffered here since the buffer remains unchanged - // when swapping unlesss you manually clear it yourself. - m_format.setSwapBehavior(QSurfaceFormat::SingleBuffer); + // iOS internally double-buffers its rendering using copy instead of flipping, + // so technically we could report that we are single-buffered so that clients + // could take advantage of the unchanged buffer, but this means clients (and Qt) + // will also assume that swapBufferes() is not needed, which is _not_ the case. + m_format.setSwapBehavior(QSurfaceFormat::DoubleBuffer); } QIOSContext::~QIOSContext() -- cgit v1.2.3