diff options
author | Aleksandar Sasha Babic <aleksandar.babic@nokia.com> | 2009-09-18 12:11:05 (GMT) |
---|---|---|
committer | Aleksandar Sasha Babic <aleksandar.babic@nokia.com> | 2009-09-18 12:16:30 (GMT) |
commit | ad32d9a2d2c3b1202867f8563a69afb93effecd0 (patch) | |
tree | 371f84075a5c21e664a461ccc3f7db2fc7b320a9 /src/gui/image/qpixmap_s60.cpp | |
parent | df062a2df4e9a438b6e876801cbd04a7cab7a569 (diff) | |
download | Qt-ad32d9a2d2c3b1202867f8563a69afb93effecd0.zip Qt-ad32d9a2d2c3b1202867f8563a69afb93effecd0.tar.gz Qt-ad32d9a2d2c3b1202867f8563a69afb93effecd0.tar.bz2 |
Adding support for symbian graphics resources.
This enables us to convert from and to new Symbian type of
graphics resource, namely SgImage. This only supported with
the OpenVG graphics system.
On other graphics systems this will return null QPixmap.
Conflicts:
src/corelib/global/qglobal.h
src/gui/image/qpixmap.h
src/gui/image/qpixmap_s60.cpp
Reviewed-by: Jason Barron
Diffstat (limited to 'src/gui/image/qpixmap_s60.cpp')
-rw-r--r-- | src/gui/image/qpixmap_s60.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index 8a6ecb0..0a81ebd 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -42,6 +42,8 @@ #include <w32std.h> #include <fbs.h> +#include <private/qapplication_p.h> +#include <private/qgraphicssystem_p.h> #include <private/qt_s60_p.h> #include <private/qpaintengine_s60_p.h> @@ -895,5 +897,61 @@ void QS60PixmapData::endDataAccess(bool readOnly) const symbianBitmapDataAccess->endDataAccess(cfbsBitmap); } +/*! + \since 4.6 + + Returns a QPixmap that wraps given \c RSgImage \a graphics resource. + The data should be valid even when original RSgImage handle has been + closed. + + \warning This function is only available on Symbian OS. + + \sa toSymbianRSgImage(), {QPixmap#Pixmap Conversion}{Pixmap Conversion} +*/ + +QPixmap QPixmap::fromSymbianRSgImage(RSgImage *sgImage) +{ + // It is expected that RSgImage will + // CURRENTLY be used in conjuction with + // OpenVG graphics system + // + // Surely things might change in future + + if (!sgImage) + return QPixmap(); + + QPixmap pixmap; + pixmap.pixmapData()->fromRSgImage(sgImage); + + return pixmap; +} + +/*! +\since 4.6 + +Returns a \c RSgImage that is equivalent to the QPixmap by copying the data. + +It is the caller's responsibility to close/delete the \c RSgImage after use. + +\warning This function is only available on Symbian OS. + +\sa fromSymbianRSgImage() +*/ + +RSgImage *QPixmap::toSymbianRSgImage() const +{ + // It is expected that RSgImage will + // CURRENTLY be used in conjuction with + // OpenVG graphics system + // + // Surely things might change in future + + if (isNull()) + return 0; + + RSgImage *sgImage = pixmapData()->toRSgImage(); + + return sgImage; +} QT_END_NAMESPACE |