diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-03-18 13:24:03 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-03-18 15:47:45 (GMT) |
commit | c2317645b94f9a3004d76dda558c4a2b853a1489 (patch) | |
tree | 38cfda93c35b2570f0fa323d1a586cddbf5a128d /tools/qmeegographicssystemhelper/qmeegoruntime.cpp | |
parent | 3fb5fce61b6f64534ad292a78250e4256a6514b6 (diff) | |
download | Qt-c2317645b94f9a3004d76dda558c4a2b853a1489.zip Qt-c2317645b94f9a3004d76dda558c4a2b853a1489.tar.gz Qt-c2317645b94f9a3004d76dda558c4a2b853a1489.tar.bz2 |
Added setSwitchPolicy to MeeGo graphicssystem helper API.
This lets the application control whether or not automatic switching
should be used, and also to completely disable switching if desired.
Reviewed-by: Armin Berres
Diffstat (limited to 'tools/qmeegographicssystemhelper/qmeegoruntime.cpp')
-rw-r--r-- | tools/qmeegographicssystemhelper/qmeegoruntime.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/qmeegographicssystemhelper/qmeegoruntime.cpp b/tools/qmeegographicssystemhelper/qmeegoruntime.cpp index 15f9cdf..928d01a 100644 --- a/tools/qmeegographicssystemhelper/qmeegoruntime.cpp +++ b/tools/qmeegographicssystemhelper/qmeegoruntime.cpp @@ -75,6 +75,7 @@ typedef void (*QMeeGoInvalidateLiveSurfacesFunc) (void); typedef void (*QMeeGoSwitchToRasterFunc) (void); typedef void (*QMeeGoSwitchToMeeGoFunc) (void); typedef void (*QMeeGoRegisterSwitchCallbackFunc) (void (*callback)(int type, const char *name)); +typedef void (*QMeeGoSetSwitchPolicyFunc) (int policy); static QMeeGoImageToEglSharedImageFunc qt_meego_image_to_egl_shared_image = NULL; static QMeeGoPixmapDataFromEglSharedImageFunc qt_meego_pixmapdata_from_egl_shared_image = NULL; @@ -95,6 +96,7 @@ static QMeeGoInvalidateLiveSurfacesFunc qt_meego_invalidate_live_surfaces = NULL static QMeeGoSwitchToRasterFunc qt_meego_switch_to_raster = NULL; static QMeeGoSwitchToMeeGoFunc qt_meego_switch_to_meego = NULL; static QMeeGoRegisterSwitchCallbackFunc qt_meego_register_switch_callback = NULL; +static QMeeGoSetSwitchPolicyFunc qt_meego_set_switch_policy = NULL; extern "C" void handleSwitch(int type, const char *name) { @@ -134,6 +136,7 @@ void QMeeGoRuntime::initialize() qt_meego_switch_to_raster = (QMeeGoSwitchToRasterFunc) library.resolve("qt_meego_switch_to_raster"); qt_meego_switch_to_meego = (QMeeGoSwitchToMeeGoFunc) library.resolve("qt_meego_switch_to_meego"); qt_meego_register_switch_callback = (QMeeGoRegisterSwitchCallbackFunc) library.resolve("qt_meego_register_switch_callback"); + qt_meego_set_switch_policy = (QMeeGoSetSwitchPolicyFunc) library.resolve("qt_meego_set_switch_policy"); if (qt_meego_image_to_egl_shared_image && qt_meego_pixmapdata_from_egl_shared_image && qt_meego_pixmapdata_with_gl_texture && qt_meego_destroy_egl_shared_image && qt_meego_update_egl_shared_image_pixmap && @@ -141,7 +144,8 @@ void QMeeGoRuntime::initialize() qt_meego_pixmapdata_with_new_live_texture && qt_meego_pixmapdata_from_live_texture_handle && qt_meego_live_texture_lock && qt_meego_live_texture_release && qt_meego_live_texture_get_handle && qt_meego_create_fence_sync && qt_meego_destroy_fence_sync && qt_meego_invalidate_live_surfaces && - qt_meego_switch_to_raster && qt_meego_switch_to_meego && qt_meego_register_switch_callback) + qt_meego_switch_to_raster && qt_meego_switch_to_meego && qt_meego_register_switch_callback && + qt_meego_set_switch_policy) { qDebug("Successfully resolved MeeGo graphics system: %s %s\n", qPrintable(libraryPrivate->fileName), qPrintable(libraryPrivate->fullVersion)); } else { @@ -289,3 +293,10 @@ void QMeeGoRuntime::enableSwitchEvents() switchEventsEnabled = true; } } + +void QMeeGoRuntime::setSwitchPolicy(QMeeGoGraphicsSystemHelper::SwitchPolicy policy) +{ + ENSURE_INITIALIZED; + Q_ASSERT(qt_meego_set_switch_policy); + qt_meego_set_switch_policy(int(policy)); +} |