summaryrefslogtreecommitdiffstats
path: root/src/openvg/qwindowsurface_vgegl.cpp
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-12-15 11:11:20 +1000
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-12-15 13:48:12 +1000
commitc5ae0ffd52ee3f2964404bf85dee55712fb6bd8c (patch)
treec84a17960411bafcc9d9431928c99a86c1aa909a /src/openvg/qwindowsurface_vgegl.cpp
parent36949134f109c72b8aba174ebf4d618f91a9f7ce (diff)
Add an image allocation pool to the OpenVG paint engine
Some OpenVG GPU's have limitations on the amount of memory available to create VGImage's. When the memory runs out, vgCreateImage() will fail. This change introduces QVGImagePool, which keeps track of all QVGPixmapData image allocations and ejects least-recently-used pixmaps when GPU memory is exhausted. Task-number: QT-2554 Reviewed-by: trustme
Diffstat (limited to 'src/openvg/qwindowsurface_vgegl.cpp')
-rw-r--r--src/openvg/qwindowsurface_vgegl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/openvg/qwindowsurface_vgegl.cpp b/src/openvg/qwindowsurface_vgegl.cpp
index 15710830f6..bda60965f0 100644
--- a/src/openvg/qwindowsurface_vgegl.cpp
+++ b/src/openvg/qwindowsurface_vgegl.cpp
@@ -42,6 +42,7 @@
#include "qwindowsurface_vgegl_p.h"
#include "qpaintengine_vg_p.h"
#include "qpixmapdata_vg_p.h"
+#include "qvgimagepool_p.h"
#include "qvg_p.h"
#if !defined(QT_NO_EGL)
@@ -360,6 +361,9 @@ void qt_vg_hibernate_pixmaps(QVGSharedContext *shared)
pd = pd->next;
}
+ // Hibernate any remaining VGImage's in the image pool.
+ QVGImagePool::instance()->hibernate();
+
// Don't need the current context any more.
shared->context->lazyDoneCurrent();