diff options
author | Michael Dominic K <mdk@codethink.co.uk> | 2010-10-13 09:40:51 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2010-10-13 09:40:51 (GMT) |
commit | 6f1f1317e68a261173ddb24a045dcc823b16a3bd (patch) | |
tree | 0a081569d47f3867130c138c4f3763d129b0dace /tools | |
parent | fa6bad3c703fdb2d0218972c5774ed0a61948f84 (diff) | |
download | Qt-6f1f1317e68a261173ddb24a045dcc823b16a3bd.zip Qt-6f1f1317e68a261173ddb24a045dcc823b16a3bd.tar.gz Qt-6f1f1317e68a261173ddb24a045dcc823b16a3bd.tar.bz2 |
Correctly handle both 16bit and 32bit live pixmaps in meego graphics system.
Merge-request: 856
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp | 6 | ||||
-rw-r--r-- | tools/qmeegographicssystemhelper/qmeegoruntime.cpp | 6 | ||||
-rw-r--r-- | tools/qmeegographicssystemhelper/qmeegoruntime.h | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp b/tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp index b9dbb2b..5e36631 100644 --- a/tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp +++ b/tools/qmeegographicssystemhelper/qmeegolivepixmap.cpp @@ -118,20 +118,20 @@ QImage* QMeeGoLivePixmap::lock() void *data = NULL; int pitch = 0; + QImage::Format format; if (! QMeeGoRuntime::lockLiveTexture(d->handle)) { qWarning("Failed to lock a live texture!"); return new QImage(); } - QMeeGoRuntime::queryLiveTexture(d->handle, &data, &pitch); + QMeeGoRuntime::queryLiveTexture(d->handle, &data, &pitch, &format); if (data == NULL || pitch == 0) { qWarning("Failed to query the live texture!"); return new QImage(); } - // FIXME Bug here! FIX FIX FIX FIX FIX FIX - return new QImage((uchar *) data, width(), height(), QImage::Format_RGB16); + return new QImage((uchar *) data, width(), height(), format); } void QMeeGoLivePixmap::release(QImage *img) diff --git a/tools/qmeegographicssystemhelper/qmeegoruntime.cpp b/tools/qmeegographicssystemhelper/qmeegoruntime.cpp index 44f9f58..215dffc 100644 --- a/tools/qmeegographicssystemhelper/qmeegoruntime.cpp +++ b/tools/qmeegographicssystemhelper/qmeegoruntime.cpp @@ -62,7 +62,7 @@ typedef Qt::HANDLE (*QMeeGoLiveTextureCreateFunc) (int w, int h, QImage::Format typedef bool (*QMeeGoLiveTextureLockFunc) (Qt::HANDLE h); typedef bool (*QMeeGoLiveTextureUnlockFunc) (Qt::HANDLE h); typedef void (*QMeeGoLiveTextureDestroyFunc) (Qt::HANDLE h); -typedef void (*QMeeGoLiveTextureQueryFunc) (Qt::HANDLE h, void **data, int *pitch); +typedef void (*QMeeGoLiveTextureQueryFunc) (Qt::HANDLE h, void **data, int *pitch, QImage::Format *format); typedef Qt::HANDLE (*QMeeGoLiveTextureToEglImageFunc) (Qt::HANDLE h); static QMeeGoImageToEglSharedImageFunc qt_meego_image_to_egl_shared_image = NULL; @@ -216,11 +216,11 @@ void QMeeGoRuntime::destroyLiveTexture(Qt::HANDLE h) qt_meego_live_texture_destroy(h); } -void QMeeGoRuntime::queryLiveTexture(Qt::HANDLE h, void **data, int *pitch) +void QMeeGoRuntime::queryLiveTexture(Qt::HANDLE h, void **data, int *pitch, QImage::Format *format) { ENSURE_INITIALIZED; Q_ASSERT(qt_meego_live_texture_query); - qt_meego_live_texture_query(h, data, pitch); + qt_meego_live_texture_query(h, data, pitch, format); } Qt::HANDLE QMeeGoRuntime::liveTextureToEGLImage(Qt::HANDLE handle) diff --git a/tools/qmeegographicssystemhelper/qmeegoruntime.h b/tools/qmeegographicssystemhelper/qmeegoruntime.h index 048b9be..9f2d505 100644 --- a/tools/qmeegographicssystemhelper/qmeegoruntime.h +++ b/tools/qmeegographicssystemhelper/qmeegoruntime.h @@ -60,7 +60,7 @@ public: static bool lockLiveTexture(Qt::HANDLE h); static bool unlockLiveTexture(Qt::HANDLE h); static void destroyLiveTexture(Qt::HANDLE h); - static void queryLiveTexture(Qt::HANDLE h, void **data, int *pitch); + static void queryLiveTexture(Qt::HANDLE h, void **data, int *pitch, QImage::Format *format); static Qt::HANDLE liveTextureToEGLImage(Qt::HANDLE); private: |