summaryrefslogtreecommitdiffstats
path: root/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-08-24 15:34:08 (GMT)
committerAnders Bakken <anders.bakken@nokia.com>2009-08-25 19:15:08 (GMT)
commit6a546cadf18b2c73d32868d84a8e3edc4455d508 (patch)
tree5494bf4c3c1018954e0b7218a6934ac4d97fc53f /src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
parentdc4e9f4bb91237b26b82e27310eda6808786ce36 (diff)
downloadQt-6a546cadf18b2c73d32868d84a8e3edc4455d508.zip
Qt-6a546cadf18b2c73d32868d84a8e3edc4455d508.tar.gz
Qt-6a546cadf18b2c73d32868d84a8e3edc4455d508.tar.bz2
Implement support for keeping image provider alive
If you define QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE we make sure atleast one IDirectFBImageProvider is alive at all times. Apparently this is refcounted by DirectFB on atleast one implementation and there's considerable overhead involved when releasing the last/creating the first image provider. Reviewed-by: TrustMe
Diffstat (limited to 'src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
index caa973f..70a6e02 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
@@ -237,12 +237,18 @@ bool QDirectFBPixmapData::fromDataBufferDescription(const DFBDataBufferDescripti
return false;
}
+#if defined QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE
+ IDirectFBImageProvider *provider = 0;
+#else
QDirectFBPointer<IDirectFBImageProvider> provider;
+#endif
if ((result = dataBuffer->CreateImageProvider(dataBuffer, &provider)) != DFB_OK) {
DirectFBError("QDirectFBPixmapData::fromDataBufferDescription(): Can't create image provider", result);
return false;
}
-
+#if defined QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE
+ screen->setDirectFBImageProvider(provider);
+#endif
DFBSurfaceDescription surfaceDescription;
if ((result = provider->GetSurfaceDescription(provider, &surfaceDescription)) != DFB_OK) {
DirectFBError("QDirectFBPixmapData::fromDataBufferDescription(): Can't get surface description", result);