From 794c71cd5eb7fc976b8f203c4d56a9567933dd9f Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Wed, 2 Sep 2009 13:10:36 -0700 Subject: Add QDirectFBWindowSurface::releaseSubSurface This convenience function will be called from whereever the subsurface is invalidated. Reviewed-by: Donald Carr --- src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp | 16 ++++++++++++---- src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h | 1 + 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; -- cgit v0.12