diff options
Diffstat (limited to 'src/openvg/qpixmapdata_vg_p.h')
-rw-r--r-- | src/openvg/qpixmapdata_vg_p.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/openvg/qpixmapdata_vg_p.h b/src/openvg/qpixmapdata_vg_p.h index fe19f35..c0bb098 100644 --- a/src/openvg/qpixmapdata_vg_p.h +++ b/src/openvg/qpixmapdata_vg_p.h @@ -55,8 +55,6 @@ #include <QtGui/private/qpixmap_raster_p.h> #include <private/qvg_p.h> -#if !defined(QT_NO_EGL) -#endif #if defined(Q_OS_SYMBIAN) class RSGImage; @@ -66,6 +64,15 @@ QT_BEGIN_NAMESPACE class QEglContext; +#if !defined(QT_NO_EGL) +class QVGPixmapData; +class QVGSharedContext; + +void qt_vg_register_pixmap(QVGPixmapData *pd); +void qt_vg_unregister_pixmap(QVGPixmapData *pd); +void qt_vg_hibernate_pixmaps(QVGSharedContext *context); +#endif + class Q_OPENVG_EXPORT QVGPixmapData : public QPixmapData { public: @@ -94,6 +101,14 @@ public: // Return the VGImage form for a specific opacity setting. virtual VGImage toVGImage(qreal opacity); + // Release the VG resources associated with this pixmap and copy + // the pixmap's contents out of the GPU back into main memory. + // The VG resource will be automatically recreated the next time + // toVGImage() is called. Does nothing if the pixmap cannot be + // hibernated for some reason (e.g. VGImage is shared with another + // process via a SgImage). + virtual void hibernate(); + QSize size() const { return QSize(w, h); } #if defined(Q_OS_SYMBIAN) @@ -108,6 +123,16 @@ protected: void cleanup(); #endif +#if !defined(QT_NO_EGL) +private: + QVGPixmapData *next; + QVGPixmapData *prev; + + friend void qt_vg_register_pixmap(QVGPixmapData *pd); + friend void qt_vg_unregister_pixmap(QVGPixmapData *pd); + friend void qt_vg_hibernate_pixmaps(QVGSharedContext *context); +#endif + protected: QSize prevSize; VGImage vgImage; @@ -121,6 +146,8 @@ protected: void forceToImage(); QImage::Format sourceFormat() const; + + void destroyImageAndContext(); }; QT_END_NAMESPACE |