summaryrefslogtreecommitdiffstats
path: root/src/plugins/gfxdrivers
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-05-01 17:20:53 (GMT)
committerAnders Bakken <anders.bakken@nokia.com>2009-05-01 18:13:18 (GMT)
commita8692a079d0509fcfc45843dc68518007df27fbb (patch)
tree1771dd2f63353350cbbef74c0975c5229cba2842 /src/plugins/gfxdrivers
parent793ea1535f131b4ada2e0049f60cf5e24ad35a7b (diff)
downloadQt-a8692a079d0509fcfc45843dc68518007df27fbb.zip
Qt-a8692a079d0509fcfc45843dc68518007df27fbb.tar.gz
Qt-a8692a079d0509fcfc45843dc68518007df27fbb.tar.bz2
Extended surface capabilities
Clean up code and make it possible to set more DFBSurfaceCapabilities on the primary surface. Also allow users to force systemonly for the surfaces.
Diffstat (limited to 'src/plugins/gfxdrivers')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp34
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.h3
2 files changed, 31 insertions, 6 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
index e2324ff..858a958 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
@@ -214,10 +214,10 @@ IDirectFBSurface *QDirectFBScreen::createDFBSurface(const QSize &size,
}
-IDirectFBSurface* QDirectFBScreen::createDFBSurface(DFBSurfaceDescription desc, SurfaceCreationOptions options)
+IDirectFBSurface *QDirectFBScreen::createDFBSurface(DFBSurfaceDescription desc, SurfaceCreationOptions options)
{
- DFBResult result;
- IDirectFBSurface* newSurface = 0;
+ DFBResult result = DFB_OK;
+ IDirectFBSurface *newSurface = 0;
if (!d_ptr->dfb) {
qWarning("QDirectFBScreen::createDFBSurface() - not connected");
@@ -247,6 +247,8 @@ IDirectFBSurface* QDirectFBScreen::createDFBSurface(DFBSurfaceDescription desc,
}
desc.caps = DFBSurfaceCapabilities(desc.caps & ~DSCAPS_VIDEOONLY);
}
+ if (d_ptr->directFBFlags & SystemOnly)
+ desc.caps = DFBSurfaceCapabilities(desc.caps | DSCAPS_SYSTEMONLY);
if (!newSurface)
result = d_ptr->dfb->CreateSurface(d_ptr->dfb, &desc, &newSurface);
@@ -805,6 +807,14 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
if (displayArgs.contains(QLatin1String("videoonly"), Qt::CaseInsensitive))
d_ptr->directFBFlags |= VideoOnly;
+ if (displayArgs.contains(QLatin1String("systemonly"), Qt::CaseInsensitive)) {
+ if (d_ptr->directFBFlags & VideoOnly) {
+ qWarning("QDirectFBScreen: error. videoonly and systemonly are mutually exclusive");
+ } else {
+ d_ptr->directFBFlags |= SystemOnly;
+ }
+ }
+
if (displayArgs.contains(QLatin1String("ignoresystemclip"), Qt::CaseInsensitive))
d_ptr->directFBFlags |= IgnoreSystemClip;
@@ -819,9 +829,23 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
description.flags = DFBSurfaceDescriptionFlags(description.flags | DSDESC_WIDTH);
if (::setIntOption(displayArgs, QLatin1String("height"), &description.height))
description.flags = DFBSurfaceDescriptionFlags(description.flags | DSDESC_HEIGHT);
+
uint caps = DSCAPS_PRIMARY|DSCAPS_DOUBLE;
- if (displayArgs.contains(QLatin1String("static_alloc")))
- caps |= DSCAPS_STATIC_ALLOC;
+ struct {
+ const char *name;
+ const DFBSurfaceCapabilities cap;
+ } const capabilities[] = {
+ { "static_alloc", DSCAPS_STATIC_ALLOC },
+ { "triplebuffer", DSCAPS_TRIPLE },
+ { "interlaced", DSCAPS_INTERLACED },
+ { "separated", DSCAPS_SEPARATED },
+// { "depthbuffer", DSCAPS_DEPTH }, // only makes sense with TextureTriangles which are not supported
+ { 0, DSCAPS_NONE }
+ };
+ for (int i=0; capabilities[i].name; ++i) {
+ if (displayArgs.contains(QString::fromLatin1(capabilities[i].name), Qt::CaseInsensitive))
+ caps |= capabilities[i].cap;
+ }
if (displayArgs.contains(QLatin1String("forcepremultiplied"), Qt::CaseInsensitive)) {
caps |= DSCAPS_PREMULTIPLIED;
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
index 5e948ee..6b3a975 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
@@ -62,7 +62,8 @@ public:
enum DirectFBFlag {
NoFlags = 0x00,
VideoOnly = 0x01,
- IgnoreSystemClip = 0x02
+ SystemOnly = 0x02,
+ IgnoreSystemClip = 0x04
};
Q_DECLARE_FLAGS(DirectFBFlags, DirectFBFlag);