diff options
Diffstat (limited to 'src/openvg')
-rw-r--r-- | src/openvg/qvgimagepool.cpp | 13 | ||||
-rw-r--r-- | src/openvg/qvgimagepool_p.h | 4 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/openvg/qvgimagepool.cpp b/src/openvg/qvgimagepool.cpp index cd1caf4..3a187b0 100644 --- a/src/openvg/qvgimagepool.cpp +++ b/src/openvg/qvgimagepool.cpp @@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE -Q_GLOBAL_STATIC(QVGImagePool, qt_vg_image_pool) +static QVGImagePool *qt_vg_image_pool = 0; class QVGImagePoolPrivate { @@ -66,7 +66,16 @@ QVGImagePool::~QVGImagePool() QVGImagePool *QVGImagePool::instance() { - return qt_vg_image_pool(); + if (!qt_vg_image_pool) + qt_vg_image_pool = new QVGImagePool(); + return qt_vg_image_pool; +} + +void QVGImagePool::setImagePool(QVGImagePool *pool) +{ + if (qt_vg_image_pool != pool) + delete qt_vg_image_pool; + qt_vg_image_pool = pool; } VGImage QVGImagePool::createTemporaryImage(VGImageFormat format, diff --git a/src/openvg/qvgimagepool_p.h b/src/openvg/qvgimagepool_p.h index e4fd4e1..07c57bf 100644 --- a/src/openvg/qvgimagepool_p.h +++ b/src/openvg/qvgimagepool_p.h @@ -69,6 +69,10 @@ public: static QVGImagePool *instance(); + // This function can be used from system-specific graphics system + // plugins to alter the image allocation strategy. + static void setImagePool(QVGImagePool *pool); + // Create a new VGImage from the pool with the specified parameters // that is not associated with a pixmap. The VGImage is returned to // the pool when releaseImage() is called. |