summaryrefslogtreecommitdiffstats
path: root/src/plugins/gfxdrivers
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-09-02 20:10:36 (GMT)
committerAnders Bakken <anders.bakken@nokia.com>2009-09-02 21:49:50 (GMT)
commit794c71cd5eb7fc976b8f203c4d56a9567933dd9f (patch)
treea1b8a682391db1fb268085610394b65b35cb173a /src/plugins/gfxdrivers
parente9f94fef250d1aef20e6803d79c400ed1a618dcb (diff)
downloadQt-794c71cd5eb7fc976b8f203c4d56a9567933dd9f.zip
Qt-794c71cd5eb7fc976b8f203c4d56a9567933dd9f.tar.gz
Qt-794c71cd5eb7fc976b8f203c4d56a9567933dd9f.tar.bz2
Add QDirectFBWindowSurface::releaseSubSurface
This convenience function will be called from whereever the subsurface is invalidated. Reviewed-by: Donald Carr <donald.carr@nokia.com>
Diffstat (limited to 'src/plugins/gfxdrivers')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp16
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h1
2 files changed, 13 insertions, 4 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp
index e74bd89..b82433d 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp
@@ -59,13 +59,10 @@ QDirectFBPaintDevice::QDirectFBPaintDevice(QDirectFBScreen *scr)
QDirectFBPaintDevice::~QDirectFBPaintDevice()
{
- unlockSurface();
if (QDirectFBScreen::instance()) {
unlockSurface();
#ifdef QT_DIRECTFB_SUBSURFACE
- if (subSurface) {
- screen->releaseDFBSurface(subSurface);
- }
+ releaseSubSurface();
#endif
if (dfbSurface) {
screen->releaseDFBSurface(dfbSurface);
@@ -207,6 +204,17 @@ QPaintEngine *QDirectFBPaintDevice::paintEngine() const
return engine;
}
+#ifdef QT_DIRECTFB_SUBSURFACE
+void QDirectFBPaintDevice::releaseSubSurface()
+{
+ Q_ASSERT(QDirectFBScreen::instance());
+ if (subSurface) {
+ screen->releaseDFBSurface(subSurface);
+ subSurface = 0;
+ }
+}
+#endif
+
QT_END_NAMESPACE
#endif // QT_NO_QWS_DIRECTFB
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
index cdd2bea..adb80e2 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
@@ -86,6 +86,7 @@ protected:
IDirectFBSurface *dfbSurface;
#ifdef QT_DIRECTFB_SUBSURFACE
+ void releaseSubSurface();
IDirectFBSurface *subSurface;
friend class QDirectFBPaintEnginePrivate;
bool syncPending;