summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2013-12-12 14:17:03 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-10 13:28:13 +0100
commit8166a34fc5dafd56a7a0d29bb6b7ed4db0654a45 (patch)
tree6de351c974a4dfad0a33563cb6273a54950871d2 /src
parentdb73862302c41a373e299c482a4f2578909a08ed (diff)
Support running Qt apps on the integrated GPU
By default starting an app that uses OpenGL will switch machines with dual graphics hardware over to the discrete GPU. This causes a delay at startup and possibly increased power usage. It is possible to prevent the switch: 1) Add the NSOpenGLPFAAllowOfflineRenderers attribute to the OpenGL pixel format. This is done in this commit. 2) Add <key>NSSupportsAutomaticGraphicsSwitching</key><true/> to the apps Info.plist. This final opt-in is left to the app author. Change-Id: Ibff56fd7770a6b7f8041c8bb60bf290eed24330a Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/platformsupport/cglconvenience/cglconvenience.mm1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/platformsupport/cglconvenience/cglconvenience.mm b/src/platformsupport/cglconvenience/cglconvenience.mm
index 12ae5965df..50c39a12e0 100644
--- a/src/platformsupport/cglconvenience/cglconvenience.mm
+++ b/src/platformsupport/cglconvenience/cglconvenience.mm
@@ -121,6 +121,7 @@ void *qcgl_createNSOpenGLPixelFormat(const QSurfaceFormat &format)
<< NSOpenGLPFASamples << (NSOpenGLPixelFormatAttribute) format.samples();
}
+ attrs << NSOpenGLPFAAllowOfflineRenderers;
attrs << 0;
NSOpenGLPixelFormat* pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs.constData()];