summaryrefslogtreecommitdiffstats
path: root/src/plugins/gfxdrivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/gfxdrivers')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp25
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp5
2 files changed, 21 insertions, 9 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
index 1b499b6..3185664 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
@@ -378,7 +378,7 @@ void QDirectFBPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op)
Q_D(QDirectFBPaintEngine);
d->dirtyClip = true;
const QPoint bottom = d->transform.map(QPoint(0, int(path.controlPointRect().bottom())));
- if (bottom.y() >= d->lastLockedHeight)
+ if (bottom.y() > d->lastLockedHeight)
d->lock();
QRasterPaintEngine::clip(path, op);
}
@@ -389,7 +389,7 @@ void QDirectFBPaintEngine::clip(const QRect &rect, Qt::ClipOperation op)
d->dirtyClip = true;
if (d->clip() && !d->clip()->hasRectClip && d->clip()->enabled) {
const QPoint bottom = d->transform.map(QPoint(0, rect.bottom()));
- if (bottom.y() >= d->lastLockedHeight)
+ if (bottom.y() > d->lastLockedHeight)
d->lock();
}
@@ -567,6 +567,7 @@ void QDirectFBPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pixmap,
QPixmapData *data = pixmap.pixmapData();
Q_ASSERT(data->classId() == QPixmapData::DirectFBClass);
QDirectFBPixmapData *dfbData = static_cast<QDirectFBPixmapData*>(data);
+ dfbData->unlockDirectFB();
IDirectFBSurface *s = dfbData->directFBSurface();
d->blit(r, s, sr);
}
@@ -598,6 +599,10 @@ void QDirectFBPaintEngine::drawTiledPixmap(const QRectF &r,
QRasterPaintEngine::drawTiledPixmap(r, pix, sp);
} else {
d->unlock();
+ QPixmapData *data = pixmap.pixmapData();
+ Q_ASSERT(data->classId() == QPixmapData::DirectFBClass);
+ QDirectFBPixmapData *dfbData = static_cast<QDirectFBPixmapData*>(data);
+ dfbData->unlockDirectFB();
d->drawTiledPixmap(r, pixmap);
}
}
@@ -913,11 +918,17 @@ void QDirectFBPaintEnginePrivate::end()
void QDirectFBPaintEnginePrivate::setPen(const QPen &p)
{
pen = p;
- simplePen = (pen.style() == Qt::NoPen) ||
- (pen.style() == Qt::SolidLine
- && !antialiased
- && (pen.brush().style() == Qt::SolidPattern)
- && (pen.widthF() <= 1 && scale != NoScale));
+ if (pen.style() == Qt::NoPen) {
+ simplePen = true;
+ } else if (pen.style() == Qt::SolidLine
+ && !antialiased
+ && pen.brush().style() == Qt::SolidPattern
+ && pen.widthF() <= 1.0
+ && (scale == NoScale || pen.isCosmetic())) {
+ simplePen = true;
+ } else {
+ simplePen = false;
+ }
}
void QDirectFBPaintEnginePrivate::setCompositionMode(QPainter::CompositionMode mode)
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
index 9dc7818..c9d5d7c 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp
@@ -90,7 +90,6 @@ void QDirectFBPixmapData::resize(int width, int height)
setSerialNumber(++global_ser_no);
}
-
// mostly duplicated from qimage.cpp (QImageData::checkForAlphaPixels)
static bool checkForAlphaPixels(const QImage &img)
{
@@ -209,6 +208,7 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect)
QPixmapData::copy(data, rect);
return;
}
+ unlockDirectFB();
const QDirectFBPixmapData *otherData = static_cast<const QDirectFBPixmapData*>(data);
IDirectFBSurface *src = otherData->directFBSurface();
@@ -296,10 +296,10 @@ void QDirectFBPixmapData::fill(const QColor &color)
QPixmap QDirectFBPixmapData::transformed(const QTransform &transform,
Qt::TransformationMode mode) const
{
+ QDirectFBPixmapData *that = const_cast<QDirectFBPixmapData*>(this);
if (!dfbSurface || transform.type() != QTransform::TxScale
|| mode != Qt::FastTransformation)
{
- QDirectFBPixmapData *that = const_cast<QDirectFBPixmapData*>(this);
const QImage *image = that->buffer();
Q_ASSERT(image);
const QImage transformed = image->transformed(transform, mode);
@@ -308,6 +308,7 @@ QPixmap QDirectFBPixmapData::transformed(const QTransform &transform,
data->fromImage(transformed, Qt::AutoColor);
return QPixmap(data);
}
+ that->unlockDirectFB();
const QSize size = transform.mapRect(QRect(0, 0, w, h)).size();
if (size.isEmpty())