path: root/src/plugins/platforms/ios/qiosapplicationstate.h
diff options
authorTor Arne Vestbø <>2016-06-01 13:29:24 +0200
committerTor Arne Vestbø <>2016-06-17 13:18:24 +0000
commit655687d84d6a5914227f2580889e20b7e1b31095 (patch)
tree1c75a2dfb69f4b0085c7ec47fc99643cb7a447dd /src/plugins/platforms/ios/qiosapplicationstate.h
parent0b6adbcd234724edef747df4d17aa7a5bcf4381b (diff)
UIKit: Don't reallocate renderbuffer on QIOSContext::swapBuffers()
During device rotation, the backing CEAGLLayer of our custom UIView is resized by the system. Normally this is the time where we would then reconfigure the corresponding renderbuffer that we render to, which shares memory with the CEAGLLayer, but we chose a lazy approach where we'd defer the reconfigure until client code actually called makeCurrent. This caused problems because not only did we implement the lazy reconfig in makeCurrent, but in every QIOSContext function that operated on the default FBO, including swapBuffers(). When using threaded rendering, such as in Qt Quick, the render thread may be half way in rendering a new frame when the system resizes the CEAGLLayer, and we pick up that resize on the swapBuffer call and allocate a new renderbuffer, before flushing the queued up GL commands that were operating on another renderbuffer of a different size. This resulted in the following crash: 0 - gpus_ReturnObjectErrorKillClient() 1 - gpusSubmitDataBuffers() 2 - glrFlushContextToken() 3 - flush(__GLIContextRec*)() 4 - QIOSContext::swapBuffers(QPlatformSurface*) ... We solve this by still being lazy in how we reconfigure, but limit the reconfigure to makeCurrent(). If the CEAGLLayer is resized in between two frames, we skip the half-drawn frame. The old frame will then be scaled to match the new size by the system, but this is preferable to flushing a new frame that may have been drawn with two conflicting window geometries. Task-number: QTBUG-50017 Change-Id: Ie229f26d156dfbfc7ed8d9efd0eb5e992eee73f1 Reviewed-by: Richard Moe Gustavsen <>
Diffstat (limited to 'src/plugins/platforms/ios/qiosapplicationstate.h')
0 files changed, 0 insertions, 0 deletions