summaryrefslogtreecommitdiffstats
path: root/src/openvg/qvg_p.h
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-12-07 08:32:53 +1000
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-12-07 08:32:53 +1000
commit8f27913d0558c96a781b81834396374318b70fd6 (patch)
treef148c4ee794096de5e4c9dc69a160ca731dfb511 /src/openvg/qvg_p.h
parent28206b2ec077396bc1fafffa4d85cab505f4409a (diff)
Automatically destroy VG pixmaps when the last window surface goes away
Under S60, Qt will destroy the window surfaces of an application that goes into the background, which frees up EGL surface objects. But the VGImage's for pixmaps, and the EGLContext, were still using GPU memory. This change keeps track of the number of widgets / window surfaces that are in use and then calls hibernate() on all QVGPixmapData objects when it goes to zero. Once all the VGImage's are destroyed, the EGLContext should also be destroyed. Task-number: QT-2555 Reviewed-by: Sarah Smith
Diffstat (limited to 'src/openvg/qvg_p.h')
-rw-r--r--src/openvg/qvg_p.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/openvg/qvg_p.h b/src/openvg/qvg_p.h
index 04e2babbea..3577013f99 100644
--- a/src/openvg/qvg_p.h
+++ b/src/openvg/qvg_p.h
@@ -71,11 +71,17 @@ class QEglContext;
// Create an EGL context, but don't bind it to a surface. If single-context
// mode is enabled, this will return the previously-created context.
-Q_OPENVG_EXPORT QEglContext *qt_vg_create_context(QPaintDevice *device);
+// "devType" indicates the type of device using the context, usually
+// QInternal::Widget or QInternal::Pixmap.
+Q_OPENVG_EXPORT QEglContext *qt_vg_create_context
+ (QPaintDevice *device, int devType);
// Destroy an EGL context that was created by qt_vg_create_context().
// If single-context mode is enabled, this will decrease the reference count.
-Q_OPENVG_EXPORT void qt_vg_destroy_context(QEglContext *context);
+// "devType" indicates the type of device destroying the context, usually
+// QInternal::Widget or QInternal::Pixmap.
+Q_OPENVG_EXPORT void qt_vg_destroy_context
+ (QEglContext *context, int devType);
// Return the shared pbuffer surface that can be made current to
// destroy VGImage objects when there is no other surface available.