summaryrefslogtreecommitdiffstats
path: root/src/plugins/gfxdrivers/directfb
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2010-03-05 18:17:59 (GMT)
committerAnders Bakken <anders.bakken@nokia.com>2010-03-05 18:17:59 (GMT)
commit2dd029993b16b8c696de61a0ead5a417d1f778f9 (patch)
treecf0229fce075c36c652fbb3fa2d8829ac8f04dde /src/plugins/gfxdrivers/directfb
parent4a72e2f1994324198d1a2c79382185dcca41a576 (diff)
downloadQt-2dd029993b16b8c696de61a0ead5a417d1f778f9.zip
Qt-2dd029993b16b8c696de61a0ead5a417d1f778f9.tar.gz
Qt-2dd029993b16b8c696de61a0ead5a417d1f778f9.tar.bz2
QDirectFBPaintEngine optimization
If you call fillRect(QBrush(QColor())); we should short-circuit before falling back to the raster engine. Reviewed-by: muthu <qt-info@nokia.com>
Diffstat (limited to 'src/plugins/gfxdrivers/directfb')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
index e79dceb..1bd6dce 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
@@ -805,13 +805,14 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QBrush &brush)
if (d->clipType != QDirectFBPaintEnginePrivate::ComplexClip) {
switch (brush.style()) {
case Qt::SolidPattern: {
+ const QColor color = brush.color();
+ if (!color.isValid())
+ return;
+
if (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_RectsUnsupported
|| !(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)) {
break;
}
- const QColor color = brush.color();
- if (!color.isValid())
- return;
d->setDFBColor(color);
const QRect r = state()->matrix.mapRect(rect).toRect();
CLIPPED_PAINT(d->surface->FillRectangle(d->surface, r.x(), r.y(), r.width(), r.height()));