summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-04-01 01:10:26 (GMT)
committerAnders Bakken <anders.bakken@nokia.com>2009-04-07 02:00:58 (GMT)
commit80d83e72fca6a60ca9cfec8bfa37a82087c931a9 (patch)
tree7d4926d16447089aabad84642bf5b138d98d313e /src/plugins
parent5fb7752ff93b31635e64fa321917749744cc9db6 (diff)
downloadQt-80d83e72fca6a60ca9cfec8bfa37a82087c931a9.zip
Qt-80d83e72fca6a60ca9cfec8bfa37a82087c931a9.tar.gz
Qt-80d83e72fca6a60ca9cfec8bfa37a82087c931a9.tar.bz2
Make windows the right formats and videoonly
CreateWindow gives you more control over how windows are created. Make sure to specify that they're in the same format as the primary surface and that they're in video memory if this is supported. Reviewed-by: TrustMe
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp
index ec108c4..15c2f7c 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp
@@ -98,10 +98,19 @@ void QDirectFBSurface::createWindow()
if (!layer)
qFatal("QDirectFBWindowSurface: Unable to get primary display layer!");
- DFBWindowDescription description;
- description.caps = DFBWindowCapabilities(DWCAPS_NODECORATION |
- DWCAPS_ALPHACHANNEL);
- description.flags = DWDESC_CAPS;
+ DFBWindowDescription description;
+ description.caps = DFBWindowCapabilities(DWCAPS_NODECORATION);
+ description.flags = DFBWindowDescriptionFlags(DWDESC_CAPS
+ |DWDESC_SURFACE_CAPS
+ |DWDESC_PIXELFORMAT);
+
+ description.surface_caps = DSCAPS_NONE;
+ if (QDirectFBScreen::instance()->preferVideoOnly())
+ description.surface_caps = DFBSurfaceCapabilities(description.surface_caps|DSCAPS_VIDEOONLY);
+ const QImage::Format format = QDirectFBScreen::instance()->pixelFormat();
+ description.pixelformat = QDirectFBScreen::getSurfacePixelFormat(format);
+ if (QDirectFBScreen::isPremultiplied(format))
+ description.surface_caps = DFBSurfaceCapabilities(DSCAPS_PREMULTIPLIED|description.caps);
DFBResult result = layer->CreateWindow(layer, &description, &dfbWindow);
if (result != DFB_OK)
@@ -111,7 +120,7 @@ void QDirectFBSurface::createWindow()
dfbSurface->Release(dfbSurface);
dfbWindow->GetSurface(dfbWindow, &dfbSurface);
- forceRaster = (dfbSurface && QDirectFBScreen::getImageFormat(dfbSurface) == QImage::Format_RGB32);
+ forceRaster = (format == QImage::Format_RGB32);
}
#endif // QT_NO_DIRECTFB_WM