summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2013-04-30 12:33:02 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-30 23:30:52 +0200
commit02e406ac50e7e57ad50d9596e9db1b32639a6a8f (patch)
treefcf035e47c4e41301121ad8f3c888fd685601467 /src/plugins
parent008aedc8d11f7bcfd4aa64aab064646bda812def (diff)
iOS: Don't pretend like our OpenGL context is single-buffered
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 <richard.gustavsen@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/ios/qioscontext.mm9
1 files changed, 5 insertions, 4 deletions
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()