diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-11-30 16:46:41 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-12-06 20:47:05 +0000 |
commit | 933497bace2ddfd9920100ccf155658cd2030c7c (patch) | |
tree | 47ee45f0795a0267782e98ab5153aefdcc209892 /src/plugins/platforms/ios/qiosbackingstore.h | |
parent | e37c9d5d5f4ba9874808a4e565c36b2953eb96da (diff) |
iOS: Ignore view layouts while in the background
Despite the OpenGL ES Programming Guide telling us to avoid all
use of OpenGL while in the background, iOS will perform its view
snapshotting for the app switcher after the application has been
backgrounded; once for each orientation. Presumably the expectation
is that no rendering needs to be done to provide an alternate
orientation snapshot, just relayouting of views. But in our case,
or any non-stretchable content case such as a OpenGL based game,
this is not true.
Instead of continuing layout, which will send potentially expensive
geometry changes (with isExposed false, since we're in the background),
we short-circuit the snapshotting.
iOS will still use the latest rendered frame to create the application
switcher thumbnail, but it will be based on the last active orientation
of the application.
To ensure that we pick up the right geometry when rotating the device
while the app is in the background, we treat applicationWillEnterForeground
as Qt::ApplicationInactive, which matches the recommendations of the
OpenGL ES Programming Guide to "re-create any objects and restart your
animation timers".
Change-Id: Ia9c27f85f996ecf30284c825b43447aa7099224e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/plugins/platforms/ios/qiosbackingstore.h')
0 files changed, 0 insertions, 0 deletions