summaryrefslogtreecommitdiffstats
path: root/src/plugins/graphicssystems
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/graphicssystems')
-rw-r--r--src/plugins/graphicssystems/meego/qmeegographicssystem.cpp2
-rw-r--r--src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp12
2 files changed, 12 insertions, 2 deletions
diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
index c515f55..fdb72de 100644
--- a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
+++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp
@@ -170,7 +170,7 @@ bool QMeeGoGraphicsSystemSwitchHandler::eventFilter(QObject *object, QEvent *eve
if (visibleWidgets() == 0)
QMeeGoGraphicsSystem::switchToRaster();
} else {
- if (visibleWidgets() == 1)
+ if (visibleWidgets() > 0)
QMeeGoGraphicsSystem::switchToMeeGo();
}
}
diff --git a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp
index 0970b89..b6ba7ec 100644
--- a/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp
+++ b/src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp
@@ -194,6 +194,8 @@ QImage* QMeeGoLivePixmapData::lock(EGLSyncKHR fenceSync)
void *data = 0;
int pitch = 0;
+ int surfaceWidth = 0;
+ int surfaceHeight = 0;
EGLSurface surface = 0;
QImage::Format format;
lockedImage = QImage();
@@ -206,9 +208,11 @@ QImage* QMeeGoLivePixmapData::lock(EGLSyncKHR fenceSync)
eglQuerySurface(QEgl::display(), surface, EGL_BITMAP_POINTER_KHR, (EGLint*) &data);
eglQuerySurface(QEgl::display(), surface, EGL_BITMAP_PITCH_KHR, (EGLint*) &pitch);
+ eglQuerySurface(QEgl::display(), surface, EGL_WIDTH, (EGLint*) &surfaceWidth);
+ eglQuerySurface(QEgl::display(), surface, EGL_HEIGHT, (EGLint*) &surfaceHeight);
// Ok, here we know we just support those two formats. Real solution would be:
- // uqery also the format.
+ // query also the format.
if (backingX11Pixmap->depth() > 16)
format = QImage::Format_ARGB32_Premultiplied;
else
@@ -219,6 +223,12 @@ QImage* QMeeGoLivePixmapData::lock(EGLSyncKHR fenceSync)
return &lockedImage;
}
+ if (width() != surfaceWidth || height() != surfaceHeight) {
+ qWarning("Live texture dimensions don't match!");
+ QMeeGoExtensions::eglUnlockSurfaceKHR(QEgl::display(), surface);
+ return &lockedImage;
+ }
+
lockedImage = QImage((uchar *) data, width(), height(), pitch, format);
return &lockedImage;
}