summaryrefslogtreecommitdiffstats
path: root/src/openvg
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-08-10 13:47:28 +0200
committerJason Barron <jbarron@trolltech.com>2009-08-10 13:47:28 +0200
commit0df5d5e4367a8052082897d02b4f00429d5cc4c1 (patch)
treecc8a59f0e37dbd618270bbca5b644fc3b775d60a /src/openvg
parentf61ec84fc296c6f70011e30788ee511d6b6a18c6 (diff)
parent17bffacda99055831bb4c8c6e7da39ec15415519 (diff)
Merge commit 'qt/master'
Diffstat (limited to 'src/openvg')
-rw-r--r--src/openvg/qpixmapdata_vg.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp
index 90fd9a5882..6f2024fa1e 100644
--- a/src/openvg/qpixmapdata_vg.cpp
+++ b/src/openvg/qpixmapdata_vg.cpp
@@ -341,4 +341,29 @@ QImage::Format QVGPixmapData::sourceFormat() const
return QImage::Format_ARGB32_Premultiplied;
}
+/*
+ \internal
+
+ Returns the VGImage that is storing the contents of \a pixmap.
+ Returns VG_INVALID_HANDLE if \a pixmap is not owned by the OpenVG
+ graphics system or \a pixmap is invalid.
+
+ This function is typically used to access the backing store
+ for a pixmap when executing raw OpenVG calls. It must only
+ be used when a QPainter is active and the OpenVG paint engine
+ is in use by the QPainter.
+
+ \sa {QtOpenVG Module}
+*/
+Q_OPENVG_EXPORT VGImage qPixmapToVGImage(const QPixmap& pixmap)
+{
+ QPixmapData *pd = pixmap.pixmapData();
+ if (pd->classId() == QPixmapData::OpenVGClass) {
+ QVGPixmapData *vgpd = static_cast<QVGPixmapData *>(pd);
+ if (vgpd->isValid())
+ return vgpd->toVGImage();
+ }
+ return VG_INVALID_HANDLE;
+}
+
QT_END_NAMESPACE