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>
This commit is contained in:
Tor Arne Vestbø 2013-04-30 12:33:02 +02:00 committed by The Qt Project
parent 008aedc8d1
commit 02e406ac50

View File

@ -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()