diff options
author | Anders Bakken <anders.bakken@nokia.com> | 2009-04-07 05:52:12 (GMT) |
---|---|---|
committer | Anders Bakken <anders.bakken@nokia.com> | 2009-04-07 05:52:12 (GMT) |
commit | fd4a62bfc18006b3c29918a65b60d9bacf22c9c0 (patch) | |
tree | 1abb22ff8060d0876ee3a368a39b78b70aed22f7 /src | |
parent | 3923604b4390e613000f4c2b00db9e0a954f92ed (diff) | |
download | Qt-fd4a62bfc18006b3c29918a65b60d9bacf22c9c0.zip Qt-fd4a62bfc18006b3c29918a65b60d9bacf22c9c0.tar.gz Qt-fd4a62bfc18006b3c29918a65b60d9bacf22c9c0.tar.bz2 |
Call ReleaseSource where appropriate
DirectFB caches the last source surface in the target surface after a
Blit. This can cause a surface to be kept around longer than desired
since the caching increases the ref-count. Unless it's likely that the
blit will happen again soon we Release the source.
Reviewed-by: TrustMe
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 2 | ||||
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp | 3 | ||||
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index 45f0710..c4144bd 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -132,6 +132,7 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect) const DFBRectangle blitRect = { rect.x(), rect.y(), rect.width(), rect.height() }; DFBResult result = dfbSurface->Blit(dfbSurface, src, &blitRect, 0, 0); + dfbSurface->ReleaseSource(dfbSurface); if (result != DFB_OK) { DirectFBError("QDirectFBPixmapData::copy()", result); setSerialNumber(0); @@ -236,6 +237,7 @@ QPixmap QDirectFBPixmapData::transformed(const QTransform &transform, const DFBRectangle destRect = { 0, 0, size.width(), size.height() }; data->dfbSurface->StretchBlit(data->dfbSurface, dfbSurface, 0, &destRect); + data->dfbSurface->ReleaseSource(data->dfbSurface); return QPixmap(data); } diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp index cb40935..4ae64f7 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp @@ -195,7 +195,7 @@ IDirectFBSurface *QDirectFBScreen::copyDFBSurface(IDirectFBSurface *src, surface->SetBlittingFlags(surface, flags); surface->Blit(surface, src, 0, 0, 0); - surface->ReleaseSource(surface); // ??? Is this always right? + surface->ReleaseSource(surface); return surface; } @@ -1093,6 +1093,7 @@ void QDirectFBScreen::compose(const QRegion ®ion) blit(surface->image(), offset, r); } } + d_ptr->dfbSurface->ReleaseSource(d_ptr->dfbSurface); } // Normally, when using DirectFB to compose the windows (I.e. when diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp index 15c2f7c..592ad47 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp @@ -262,7 +262,7 @@ bool QDirectFBSurface::scroll(const QRegion ®ion, int dx, int dy) dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_NOFX); dfbSurface->BatchBlit(dfbSurface, dfbSurface, dfbRects.data(), dfbPoints.data(), n); - + dfbSurface->ReleaseSource(dfbSurface); return true; } |