summaryrefslogtreecommitdiffstats
path: root/tools/qmeegographicssystemhelper
diff options
context:
space:
mode:
authorPauli Nieminen <ext-pauli.nieminen@nokia.com>2011-03-07 11:39:02 +0100
committerSamuel Rødal <samuel.rodal@nokia.com>2011-03-07 11:39:02 +0100
commitd55aa14630bbb4130017f38177b20c850d556371 (patch)
treed4990087819de18f7f0236ee7dee826fef8c8c79 /tools/qmeegographicssystemhelper
parent7b4e032559c7b226280e5c9229cd685e73d1e707 (diff)
Invalidate the EGL surface of QMeeGoLivePixmapData when switching to Raster
QMeeGoLivePixmap fails to lock the EGL surface and texture after switch to raster graphics system. The EGL surface is invalid after eglTerminate call in switch. But QMeeGoLivePixmapData doesn't know about the switch. Marking EGL surfaces and texture invalid after switch makes live pixmap automatically recreate the surface when next time requiring live pixmap. Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Merge-request: 2571 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'tools/qmeegographicssystemhelper')
-rw-r--r--tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp2
-rw-r--r--tools/qmeegographicssystemhelper/qmeegoruntime.cpp12
-rw-r--r--tools/qmeegographicssystemhelper/qmeegoruntime.h1
3 files changed, 14 insertions, 1 deletions
diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp
index e1c0460f61..ac3299506e 100644
--- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp
+++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp
@@ -111,6 +111,8 @@ void QMeeGoGraphicsSystemHelper::switchToRaster()
QApplication *app = static_cast<QApplication *>(QCoreApplication::instance());
app->setGraphicsSystem(QLatin1String("raster"));
+ QMeeGoRuntime::invalidateLiveSurfaces();
+
QMeeGoSwitchEvent didSwitchEvent(QLatin1String("raster"), QMeeGoSwitchEvent::DidSwitch);
foreach (QWidget *widget, QApplication::topLevelWidgets())
QCoreApplication::sendEvent(widget, &didSwitchEvent);
diff --git a/tools/qmeegographicssystemhelper/qmeegoruntime.cpp b/tools/qmeegographicssystemhelper/qmeegoruntime.cpp
index c32b654f1d..7c81d517fc 100644
--- a/tools/qmeegographicssystemhelper/qmeegoruntime.cpp
+++ b/tools/qmeegographicssystemhelper/qmeegoruntime.cpp
@@ -65,6 +65,7 @@ typedef bool (*QMeeGoLiveTextureReleaseFunc) (QPixmap*, QImage *i);
typedef Qt::HANDLE (*QMeeGoLiveTextureGetHandleFunc) (QPixmap*);
typedef void* (*QMeeGoCreateFenceSyncFunc) (void);
typedef void (*QMeeGoDestroyFenceSyncFunc) (void *fs);
+typedef void (*QMeeGoInvalidateLiveSurfacesFunc) (void);
static QMeeGoImageToEglSharedImageFunc qt_meego_image_to_egl_shared_image = NULL;
static QMeeGoPixmapDataFromEglSharedImageFunc qt_meego_pixmapdata_from_egl_shared_image = NULL;
@@ -81,6 +82,7 @@ static QMeeGoLiveTextureReleaseFunc qt_meego_live_texture_release = NULL;
static QMeeGoLiveTextureGetHandleFunc qt_meego_live_texture_get_handle = NULL;
static QMeeGoCreateFenceSyncFunc qt_meego_create_fence_sync = NULL;
static QMeeGoDestroyFenceSyncFunc qt_meego_destroy_fence_sync = NULL;
+static QMeeGoInvalidateLiveSurfacesFunc qt_meego_invalidate_live_surfaces = NULL;
void QMeeGoRuntime::initialize()
{
@@ -109,13 +111,14 @@ void QMeeGoRuntime::initialize()
qt_meego_live_texture_get_handle = (QMeeGoLiveTextureGetHandleFunc) library.resolve("qt_meego_live_texture_get_handle");
qt_meego_create_fence_sync = (QMeeGoCreateFenceSyncFunc) library.resolve("qt_meego_create_fence_sync");
qt_meego_destroy_fence_sync = (QMeeGoDestroyFenceSyncFunc) library.resolve("qt_meego_destroy_fence_sync");
+ qt_meego_invalidate_live_surfaces = (QMeeGoInvalidateLiveSurfacesFunc) library.resolve("qt_meego_invalidate_live_surfaces");
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 &&
qt_meego_set_surface_fixed_size && qt_meego_set_surface_scaling && qt_meego_set_translucent &&
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_create_fence_sync && qt_meego_destroy_fence_sync && qt_meego_invalidate_live_surfaces)
{
qDebug("Successfully resolved MeeGo graphics system: %s %s\n", qPrintable(libraryPrivate->fileName), qPrintable(libraryPrivate->fullVersion));
} else {
@@ -232,3 +235,10 @@ void QMeeGoRuntime::destroyFenceSync(void *fs)
Q_ASSERT(qt_meego_destroy_fence_sync);
qt_meego_destroy_fence_sync(fs);
}
+
+void QMeeGoRuntime::invalidateLiveSurfaces()
+{
+ ENSURE_INITIALIZED;
+ Q_ASSERT(qt_meego_invalidate_live_surfaces);
+ qt_meego_invalidate_live_surfaces();
+}
diff --git a/tools/qmeegographicssystemhelper/qmeegoruntime.h b/tools/qmeegographicssystemhelper/qmeegoruntime.h
index bdc4eefa5a..b91efae838 100644
--- a/tools/qmeegographicssystemhelper/qmeegoruntime.h
+++ b/tools/qmeegographicssystemhelper/qmeegoruntime.h
@@ -62,6 +62,7 @@ public:
static Qt::HANDLE getLiveTextureHandle(QPixmap *pixmap);
static void* createFenceSync();
static void destroyFenceSync(void *fs);
+ static void invalidateLiveSurfaces();
private:
static bool initialized;