diff options
author | mread <qt-info@nokia.com> | 2009-08-10 13:18:56 (GMT) |
---|---|---|
committer | mread <qt-info@nokia.com> | 2009-08-10 13:18:56 (GMT) |
commit | 34dd8163f4fcd16be5677fc94ce960cc464991d5 (patch) | |
tree | f871fef42b4f337a98bce77ad307efe079b7dc5f /src/openvg | |
parent | 0dfca6e13a7ad3cce38d5509d446f76eb496f398 (diff) | |
parent | 70e098d965318651acb725374b73e026f2946b76 (diff) | |
download | Qt-34dd8163f4fcd16be5677fc94ce960cc464991d5.zip Qt-34dd8163f4fcd16be5677fc94ce960cc464991d5.tar.gz Qt-34dd8163f4fcd16be5677fc94ce960cc464991d5.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt-s60-public
Diffstat (limited to 'src/openvg')
-rw-r--r-- | src/openvg/qpixmapdata_vg.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp index 90fd9a5..6f2024f 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 |