diff options
author | Anders Bakken <anders.bakken@nokia.com> | 2010-03-05 18:17:59 (GMT) |
---|---|---|
committer | Anders Bakken <anders.bakken@nokia.com> | 2010-03-05 18:17:59 (GMT) |
commit | 2dd029993b16b8c696de61a0ead5a417d1f778f9 (patch) | |
tree | cf0229fce075c36c652fbb3fa2d8829ac8f04dde /src/plugins | |
parent | 4a72e2f1994324198d1a2c79382185dcca41a576 (diff) | |
download | Qt-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')
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp | 7 |
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())); |