summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2009-11-03 11:15:53 (GMT)
committerTrond Kjernåsen <trond@trolltech.com>2009-11-03 11:17:24 (GMT)
commit68be6457f6732437b485812ab2db11c147a24b51 (patch)
tree62ff5c58fd075ae9c09cbf178dd5950fdb293c5b /src/gui/graphicsview
parent1fd46b4495241ed03371fb5c86965b788791b363 (diff)
downloadQt-68be6457f6732437b485812ab2db11c147a24b51.zip
Qt-68be6457f6732437b485812ab2db11c147a24b51.tar.gz
Qt-68be6457f6732437b485812ab2db11c147a24b51.tar.bz2
Removed usage of CompositionMode_Source in QGraphicsView for X11.
Due to the rendering model in XRender ((src IN mask) OP dest) we can't support the PorterDuff composition modes natively under X11. They just behave differently than what we've defined them to do in QPainter, and there is no apparent workaround. Task-number: QTBUG-4829 Reviewed-by: Gunnar
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index 710c745..8945f51 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -281,6 +281,7 @@ static const int QGRAPHICSVIEW_PREALLOC_STYLE_OPTIONS = 503; // largest prime <
#include <QtGui/qstyleoption.h>
#include <QtGui/qinputcontext.h>
#ifdef Q_WS_X11
+#include <QtGui/qpaintengine.h>
#include <private/qt_x11_p.h>
#endif
@@ -3294,7 +3295,12 @@ void QGraphicsView::paintEvent(QPaintEvent *event)
backgroundPainter.setClipRegion(d->backgroundPixmapExposed, Qt::ReplaceClip);
if (viewTransformed)
backgroundPainter.setTransform(viewTransform);
- backgroundPainter.setCompositionMode(QPainter::CompositionMode_Source);
+#ifdef Q_WS_X11
+#undef X11
+ if (backgroundPainter.paintEngine()->type() != QPaintEngine::X11)
+#define X11 qt_x11Data
+#endif
+ backgroundPainter.setCompositionMode(QPainter::CompositionMode_Source);
drawBackground(&backgroundPainter, exposedSceneRect);
d->backgroundPixmapExposed = QRegion();
}