summaryrefslogtreecommitdiffstats
path: root/src/plugins/gfxdrivers/directfb
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/gfxdrivers/directfb')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp4
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp2
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp29
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h1
4 files changed, 17 insertions, 19 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
index 54f4a8a..e4a0135 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
@@ -216,12 +216,12 @@ static void initRasterFallbacksMasks(int *warningMask, int *disableMask)
int idx = warning.indexOf(name);
if (idx != -1) {
*warningMask |= operations[i].operation;
- warning.remove(warning.begin() + idx);
+ warning.erase(warning.begin() + idx);
}
idx = disable.indexOf(name);
if (idx != -1) {
*disableMask |= operations[i].operation;
- disable.remove(disable.begin() + idx);
+ disable.erase(disable.begin() + idx);
}
}
}
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
index b5ac67d..4219f6f 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
@@ -174,6 +174,8 @@ bool QDirectFBPixmapData::hasAlphaChannel(const QImage &img)
bool QDirectFBPixmapData::fromFile(const QString &filename, const char *format,
Qt::ImageConversionFlags flags)
{
+ if (!QFile::exists(filename))
+ return false;
if (flags == Qt::AutoColor) {
if (filename.startsWith(QLatin1Char(':'))) { // resource
QFile file(filename);
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
index a8bdb65..51969fc 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
@@ -61,6 +61,7 @@ QDirectFBWindowSurface::QDirectFBWindowSurface(DFBSurfaceFlipFlags flip, QDirect
#endif
, flipFlags(flip)
, boundingRectFlip(scr->directFBFlags() & QDirectFBScreen::BoundingRectFlip)
+ , flushPending(false)
{
#ifdef QT_NO_DIRECTFB_WM
mode = Offscreen;
@@ -80,6 +81,7 @@ QDirectFBWindowSurface::QDirectFBWindowSurface(DFBSurfaceFlipFlags flip, QDirect
#endif
, flipFlags(flip)
, boundingRectFlip(scr->directFBFlags() & QDirectFBScreen::BoundingRectFlip)
+ , flushPending(false)
{
SurfaceFlags flags = 0;
if (!widget || widget->window()->windowOpacity() == 0xff)
@@ -299,28 +301,19 @@ void QDirectFBWindowSurface::setPermanentState(const QByteArray &state)
}
}
-static inline void scrollSurface(IDirectFBSurface *surface, const QRect &r, int dx, int dy)
-{
- const DFBRectangle rect = { r.x(), r.y(), r.width(), r.height() };
- surface->Blit(surface, surface, &rect, r.x() + dx, r.y() + dy);
- const DFBRegion region = { rect.x + dx, rect.y + dy, r.right() + dx, r.bottom() + dy };
- surface->Flip(surface, &region, DSFLIP_BLIT);
-}
-
bool QDirectFBWindowSurface::scroll(const QRegion &region, int dx, int dy)
{
- if (!dfbSurface || !(flipFlags & DSFLIP_BLIT) || region.isEmpty())
+ if (!dfbSurface || !(flipFlags & DSFLIP_BLIT) || region.rectCount() != 1)
return false;
- dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_NOFX);
- if (region.rectCount() == 1) {
- scrollSurface(dfbSurface, region.boundingRect(), dx, dy);
+ if (flushPending) {
+ dfbSurface->Flip(dfbSurface, 0, DSFLIP_BLIT);
} else {
- const QVector<QRect> rects = region.rects();
- const int n = rects.size();
- for (int i=0; i<n; ++i) {
- scrollSurface(dfbSurface, rects.at(i), dx, dy);
- }
+ flushPending = true;
}
+ dfbSurface->SetBlittingFlags(dfbSurface, DSBLIT_NOFX);
+ const QRect r = region.boundingRect();
+ const DFBRectangle rect = { r.x(), r.y(), r.width(), r.height() };
+ dfbSurface->Blit(dfbSurface, dfbSurface, &rect, r.x() + dx, r.y() + dy);
return true;
}
@@ -384,6 +377,7 @@ void QDirectFBWindowSurface::flush(QWidget *widget, const QRegion &region,
timer.restart();
}
#endif
+ flushPending = false;
}
void QDirectFBWindowSurface::beginPaint(const QRegion &)
@@ -391,6 +385,7 @@ void QDirectFBWindowSurface::beginPaint(const QRegion &)
if (!engine) {
engine = new QDirectFBPaintEngine(this);
}
+ flushPending = true;
}
void QDirectFBWindowSurface::endPaint(const QRegion &)
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
index a6138f6..4370a8f 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
@@ -114,6 +114,7 @@ private:
DFBSurfaceFlipFlags flipFlags;
bool boundingRectFlip;
+ bool flushPending;
#ifdef QT_DIRECTFB_TIMING
int frames;
QTime timer;