diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-29 13:26:50 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-29 13:26:50 (GMT) |
commit | a716c176c5a89c5dd0e3f0a9b6738d8a217ee6b9 (patch) | |
tree | 69ff7b89b32764ff62575b2e81ecd4c25470d691 /src/plugins | |
parent | c0f5eeec92f188381d7f085b2d4f5ea08ecc665c (diff) | |
parent | f5592ef682ce18e7e6fd3770de722a5255a34ef7 (diff) | |
download | Qt-a716c176c5a89c5dd0e3f0a9b6738d8a217ee6b9.zip Qt-a716c176c5a89c5dd0e3f0a9b6738d8a217ee6b9.tar.gz Qt-a716c176c5a89c5dd0e3f0a9b6738d8a217ee6b9.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
QMeeGoLivePixmapData: Verify dimensions of locked pixmap
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/graphicssystems/meego/qmeegolivepixmapdata.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
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; } |