summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_symbian.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-03-31 13:54:58 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2011-03-31 13:54:58 (GMT)
commit37feac98c573a099502fddfb5703c2359711b4c4 (patch)
tree33d74f9650065de4564bc0d749ca50bd65b13a2c /src/opengl/qgl_symbian.cpp
parent7b18baf23b1e8c663872b2b25b1323798b1d09df (diff)
parentb764d3e6cb114988394e7500236ba087a3385a50 (diff)
downloadQt-37feac98c573a099502fddfb5703c2359711b4c4.zip
Qt-37feac98c573a099502fddfb5703c2359711b4c4.tar.gz
Qt-37feac98c573a099502fddfb5703c2359711b4c4.tar.bz2
Merge remote-tracking branch 'origin/4.7' into qt-master-from-4.7
Conflicts: doc/src/declarative/example-slideswitch.qdoc doc/src/development/qmake-manual.qdoc doc/src/snippets/code/doc_src_qmake-manual.pro doc/src/snippets/code/doc_src_qtscript.qdoc src/corelib/animation/qabstractanimation.cpp src/s60installs/bwins/QtOpenGLu.def src/s60installs/eabi/QtOpenGLu.def src/s60installs/eabi/QtOpenVGu.def tests/auto/qdir/qdir.pro tests/auto/qsslsocket/tst_qsslsocket.cpp tools/qdoc3/doc/qdoc-manual.qdocconf
Diffstat (limited to 'src/opengl/qgl_symbian.cpp')
-rw-r--r--src/opengl/qgl_symbian.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/opengl/qgl_symbian.cpp b/src/opengl/qgl_symbian.cpp
index 7caaabd..1b41db4 100644
--- a/src/opengl/qgl_symbian.cpp
+++ b/src/opengl/qgl_symbian.cpp
@@ -48,6 +48,7 @@
#include <private/qgl_p.h>
#include <private/qpaintengine_opengl_p.h>
#include <private/qwidget_p.h> // to access QWExtra
+#include <private/qnativeimagehandleprovider_p.h>
#include "qgl_egl_p.h"
#include "qpixmapdata_gl_p.h"
#include "qgltexturepool_p.h"
@@ -411,6 +412,11 @@ void QGLPixmapData::fromNativeType(void* pixmap, NativeType type)
m_hasAlpha = m_source.hasAlphaChannel();
m_hasFillColor = false;
m_dirty = true;
+ } else if (type == QPixmapData::NativeImageHandleProvider && pixmap) {
+ destroyTexture();
+ nativeImageHandleProvider = static_cast<QNativeImageHandleProvider *>(pixmap);
+ // Cannot defer the retrieval, we need at least the size right away.
+ createFromNativeImageHandleProvider();
}
}
@@ -425,4 +431,42 @@ void* QGLPixmapData::toNativeType(NativeType type)
return 0;
}
+bool QGLPixmapData::initFromNativeImageHandle(void *handle, const QString &type)
+{
+ if (type == QLatin1String("RSgImage")) {
+ fromNativeType(handle, QPixmapData::SgImage);
+ return true;
+ } else if (type == QLatin1String("CFbsBitmap")) {
+ fromNativeType(handle, QPixmapData::FbsBitmap);
+ return true;
+ }
+ return false;
+}
+
+void QGLPixmapData::createFromNativeImageHandleProvider()
+{
+ void *handle = 0;
+ QString type;
+ nativeImageHandleProvider->get(&handle, &type);
+ if (handle) {
+ if (initFromNativeImageHandle(handle, type)) {
+ nativeImageHandle = handle;
+ nativeImageType = type;
+ } else {
+ qWarning("QGLPixmapData: Unknown native image type '%s'", qPrintable(type));
+ }
+ } else {
+ qWarning("QGLPixmapData: Native handle is null");
+ }
+}
+
+void QGLPixmapData::releaseNativeImageHandle()
+{
+ if (nativeImageHandleProvider && nativeImageHandle) {
+ nativeImageHandleProvider->release(nativeImageHandle, nativeImageType);
+ nativeImageHandle = 0;
+ nativeImageType = QString();
+ }
+}
+
QT_END_NAMESPACE