summaryrefslogtreecommitdiffstats
path: root/src/openvg/qpixmapdata_vg_p.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-03-08 14:59:31 (GMT)
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-03-08 14:59:31 (GMT)
commita870c5e10fe83b6b8df254ec760ac50020738aaa (patch)
tree9db282a0027e5ccf7e79049b6fab1a6faf4c2e64 /src/openvg/qpixmapdata_vg_p.h
parentcb7ce0b2cb0f47e7ef51e7c7f034dda39cc410ad (diff)
downloadQt-a870c5e10fe83b6b8df254ec760ac50020738aaa.zip
Qt-a870c5e10fe83b6b8df254ec760ac50020738aaa.tar.gz
Qt-a870c5e10fe83b6b8df254ec760ac50020738aaa.tar.bz2
Added native image handle provider support in pixmaps on openvg.
QNativeImageHandleProvider is a thin interface consisting of get() and release() functions. Pixmaps constructed with such a provider will call these functions to acquire and release a native handle, e.g. a CFbsBitmap or RSgImage pointer in case of Symbian. The behavior is largely similar to constructing pixmaps via fromSymbianCFbsBitmap or fromSymbianRSgImage, with the exception of pixmap hibernation: release() (and subsequently get()) is guaranteed to be called also in case of hibernation, allowing more fine-grained tracking of the usage and lifetime of image data. Task-number: QT-4632 Reviewed-by: Jani Hautakangas
Diffstat (limited to 'src/openvg/qpixmapdata_vg_p.h')
-rw-r--r--src/openvg/qpixmapdata_vg_p.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/openvg/qpixmapdata_vg_p.h b/src/openvg/qpixmapdata_vg_p.h
index 80ff1cb..15ff889 100644
--- a/src/openvg/qpixmapdata_vg_p.h
+++ b/src/openvg/qpixmapdata_vg_p.h
@@ -76,6 +76,8 @@ void qt_vg_unregister_pixmap(QVGPixmapData *pd);
void qt_vg_hibernate_pixmaps(QVGSharedContext *context);
#endif
+class QNativeImageHandleProvider;
+
class Q_OPENVG_EXPORT QVGPixmapData : public QPixmapData
{
public:
@@ -138,6 +140,9 @@ public:
#if defined(Q_OS_SYMBIAN)
void* toNativeType(NativeType type);
void fromNativeType(void* pixmap, NativeType type);
+ bool initFromNativeImageHandle(void *handle, const QString &type);
+ void createFromNativeImageHandleProvider();
+ void releaseNativeImageHandle();
#endif
protected:
@@ -177,6 +182,12 @@ protected:
mutable QEglContext *context;
#endif
+#if defined(Q_OS_SYMBIAN)
+ mutable QNativeImageHandleProvider *nativeImageHandleProvider;
+ void *nativeImageHandle;
+ QString nativeImageType;
+#endif
+
void forceToImage();
QImage::Format sourceFormat() const;
QImage::Format idealFormat(QImage *image, Qt::ImageConversionFlags flags) const;