summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@digia.com>2012-12-10 09:23:21 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-12-11 17:49:57 (GMT)
commit439aa67582e715ddc0ca7e30305b0c9498a71f81 (patch)
treeed3d39ed8436b9b3ac090dede60f2884d3ae022d /src
parentf7e941785e811e305445d5544cffcfe889a3abc2 (diff)
downloadQt-439aa67582e715ddc0ca7e30305b0c9498a71f81.zip
Qt-439aa67582e715ddc0ca7e30305b0c9498a71f81.tar.gz
Qt-439aa67582e715ddc0ca7e30305b0c9498a71f81.tar.bz2
Fixes ignored composition mode in QPainter::fillRect with X11 engine.
It's not sufficient to check that the source brush has an alpha, there are composition modes that depend on the destination instead. Task-number: QTBUG-28499 Change-Id: I4b267544c607b6a68c4c52a6784d526bec604d75 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qpaintengine_x11.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp
index 68d91e8..eb39893 100644
--- a/src/gui/painting/qpaintengine_x11.cpp
+++ b/src/gui/painting/qpaintengine_x11.cpp
@@ -144,6 +144,11 @@ static inline int qpainterOpToXrender(QPainter::CompositionMode mode)
Q_ASSERT(mode <= QPainter::CompositionMode_Xor);
return compositionModeToRenderOp[mode];
}
+
+static inline bool complexPictOp(int op)
+{
+ return op != PictOpOver && op != PictOpSrc;
+}
#endif
// hack, so we don't have to make QRegion::clipRectangles() public or include
@@ -771,7 +776,8 @@ void QX11PaintEngine::drawRects(const QRectF *rects, int rectCount)
|| d->has_alpha_brush
|| d->has_complex_xform
|| d->has_custom_pen
- || d->cbrush.style() != Qt::SolidPattern)
+ || d->cbrush.style() != Qt::SolidPattern
+ || complexPictOp(d->composition_mode))
{
QPaintEngine::drawRects(rects, rectCount);
return;
@@ -838,7 +844,7 @@ void QX11PaintEngine::drawRects(const QRect *rects, int rectCount)
::Picture pict = d->picture;
if (X11->use_xrender && pict && d->has_brush && d->pdev_depth != 1
- && (d->has_texture || d->has_alpha_brush))
+ && (d->has_texture || d->has_alpha_brush || complexPictOp(d->composition_mode)))
{
XRenderColor xc;
if (!d->has_texture && !d->has_pattern)