summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-06-08 10:01:26 -0700
committerAnders Bakken <anders.bakken@nokia.com>2009-06-08 10:01:26 -0700
commit79e2bc2bce3e5faa05872f662ab231c8b42d2612 (patch)
treef565f4a2e05ea9fd7b110a8c800369b72e65ec49 /src
parentb9c4f8fec2a009003029dd95b20d0342271c0473 (diff)
Make the directfb plugin compile against 0.9
Not sure to what extent it actually works but atleast it compiles now. - A couple of image formats doesn't exist in 0.9 - IDirectFBSurface::ReleaseSource doesn't exist in 0.9 - IDirectFBWindow::SetBounds doesn't exist in 0.9 Reviewed-by: Donald <qt-info@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp4
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp7
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp14
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.h2
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp17
5 files changed, 40 insertions, 4 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
index 2fb533a707..5be4d47edf 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
@@ -532,7 +532,9 @@ void QDirectFBPaintEngine::drawImage(const QRectF &r, const QImage &image,
d->prepareForBlit(QDirectFBScreen::hasAlpha(imgSurface));
d->blit(r, imgSurface, sr);
if (release) {
+#if (Q_DIRECTFB_VERSION >= 0x010000)
imgSurface->ReleaseSource(imgSurface);
+#endif
imgSurface->Release(imgSurface);
}
#endif
@@ -897,7 +899,9 @@ void QDirectFBPaintEnginePrivate::end()
{
lockedMemory = 0;
dfbDevice = 0;
+#if (Q_DIRECTFB_VERSION >= 0x010000)
surface->ReleaseSource(surface);
+#endif
surface->SetClip(surface, NULL);
surface = 0;
}
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
index 18754f5045..81840738cf 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
@@ -225,7 +225,9 @@ 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);
+#if (Q_DIRECTFB_VERSION >= 0x010000)
dfbSurface->ReleaseSource(dfbSurface);
+#endif
if (result != DFB_OK) {
DirectFBError("QDirectFBPixmapData::copy()", result);
invalidate();
@@ -316,8 +318,9 @@ QPixmap QDirectFBPixmapData::transformed(const QTransform &transform,
const DFBRectangle destRect = { 0, 0, size.width(), size.height() };
data->dfbSurface->StretchBlit(data->dfbSurface, dfbSurface, 0, &destRect);
+#if (Q_DIRECTFB_VERSION >= 0x010000)
data->dfbSurface->ReleaseSource(data->dfbSurface);
-
+#endif
return QPixmap(data);
}
@@ -336,7 +339,9 @@ QImage QDirectFBPixmapData::toImage() const
imgSurface->SetBlittingFlags(imgSurface, DSBLIT_NOFX);
}
imgSurface->Blit(imgSurface, dfbSurface, 0, 0, 0);
+#if (Q_DIRECTFB_VERSION >= 0x010000)
imgSurface->ReleaseSource(imgSurface);
+#endif
imgSurface->Release(imgSurface);
return ret;
}
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
index 9e35a664ea..6a0c665054 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
@@ -196,7 +196,9 @@ IDirectFBSurface *QDirectFBScreen::copyDFBSurface(IDirectFBSurface *src,
surface->SetBlittingFlags(surface, flags);
surface->Blit(surface, src, 0, 0, 0);
+#if (Q_DIRECTFB_VERSION >= 0x010000)
surface->ReleaseSource(surface);
+#endif
return surface;
}
@@ -317,7 +319,9 @@ IDirectFBSurface *QDirectFBScreen::copyToDFBSurface(const QImage &img,
DFBResult result = dfbSurface->Blit(dfbSurface, imgSurface, 0, 0, 0);
if (result != DFB_OK)
DirectFBError("QDirectFBScreen::copyToDFBSurface()", result);
+#if (Q_DIRECTFB_VERSION >= 0x010000)
dfbSurface->ReleaseSource(dfbSurface);
+#endif
imgSurface->Release(imgSurface);
#else // QT_NO_DIRECTFB_PREALLOCATED
Q_ASSERT(image.format() == pixmapFormat);
@@ -388,10 +392,12 @@ DFBSurfacePixelFormat QDirectFBScreen::getSurfacePixelFormat(QImage::Format form
#endif
case QImage::Format_RGB16:
return DSPF_RGB16;
+#if (Q_DIRECTFB_VERSION >= 0x010000)
case QImage::Format_ARGB6666_Premultiplied:
return DSPF_ARGB6666;
case QImage::Format_RGB666:
return DSPF_RGB18;
+#endif
case QImage::Format_RGB32:
return DSPF_RGB32;
case QImage::Format_ARGB32_Premultiplied:
@@ -423,10 +429,12 @@ QImage::Format QDirectFBScreen::getImageFormat(IDirectFBSurface *surface)
return QImage::Format_RGB555;
case DSPF_RGB16:
return QImage::Format_RGB16;
+#if (Q_DIRECTFB_VERSION >= 0x010000)
case DSPF_ARGB6666:
return QImage::Format_ARGB6666_Premultiplied;
case DSPF_RGB18:
return QImage::Format_RGB666;
+#endif
case DSPF_RGB32:
return QImage::Format_RGB32;
case DSPF_ARGB: {
@@ -780,7 +788,9 @@ static const FlagDescription blitDescriptions[] = {
{ " DSBLIT_DEINTERLACE", DSBLIT_DEINTERLACE },
{ " DSBLIT_SRC_PREMULTCOLOR", DSBLIT_SRC_PREMULTCOLOR },
{ " DSBLIT_XOR", DSBLIT_XOR },
+#if (Q_DIRECTFB_VERSION >= 0x010000)
{ " DSBLIT_INDEX_TRANSLATION", DSBLIT_INDEX_TRANSLATION },
+#endif
{ 0, 0 }
};
@@ -1223,7 +1233,9 @@ void QDirectFBScreen::compose(const QRegion &region)
blit(surface->image(), offset, r);
}
}
+#if (Q_DIRECTFB_VERSION >= 0x010000)
d_ptr->dfbSurface->ReleaseSource(d_ptr->dfbSurface);
+#endif
}
// Normally, when using DirectFB to compose the windows (I.e. when
@@ -1271,7 +1283,9 @@ void QDirectFBScreen::blit(const QImage &img, const QPoint &topLeft,
return;
}
blit(src, topLeft, reg);
+#if (Q_DIRECTFB_VERSION >= 0x010000)
d_ptr->dfbSurface->ReleaseSource(d_ptr->dfbSurface);
+#endif
src->Release(src);
}
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
index 84199a2766..440c472ed3 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
@@ -178,10 +178,12 @@ inline bool QDirectFBScreen::hasAlpha(DFBSurfacePixelFormat format)
case DSPF_ARGB2554:
case DSPF_ARGB4444:
case DSPF_AYUV:
+#if (Q_DIRECTFB_VERSION >= 0x010000)
case DSPF_A4:
case DSPF_ARGB1666:
case DSPF_ARGB6666:
case DSPF_LUT2:
+#endif
return true;
default:
return false;
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
index 330eb8870d..442f8dd8f3 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
@@ -188,14 +188,25 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect, const QRegion &mask)
if (!dfbWindow)
createWindow();
- if (isResize && isMove)
+#if (Q_DIRECTFB_VERSION >= 0x010000)
+ if (isResize && isMove) {
result = dfbWindow->SetBounds(dfbWindow, rect.x(), rect.y(),
rect.width(), rect.height());
- else if (isResize)
+ } else if (isResize) {
result = dfbWindow->Resize(dfbWindow,
rect.width(), rect.height());
- else if (isMove)
+ } else if (isMove) {
result = dfbWindow->MoveTo(dfbWindow, rect.x(), rect.y());
+ }
+#else
+ if (isResize) {
+ result = dfbWindow->Resize(dfbWindow,
+ rect.width(), rect.height());
+ }
+ if (isMove) {
+ result = dfbWindow->MoveTo(dfbWindow, rect.x(), rect.y());
+ }
+#endif
#endif
}