diff options
author | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2010-02-03 10:17:19 (GMT) |
---|---|---|
committer | Bjørn Erik Nilsen <bjorn.nilsen@nokia.com> | 2010-02-03 12:11:32 (GMT) |
commit | 80e114ad0b7974894858a17153d6f54546835066 (patch) | |
tree | 1d1a992c8462a8afc750d6339becbf30ebcca5b6 /src/gui/painting | |
parent | cc585886ba9da17064a7fc858f5d717967da6e85 (diff) | |
download | Qt-80e114ad0b7974894858a17153d6f54546835066.zip Qt-80e114ad0b7974894858a17153d6f54546835066.tar.gz Qt-80e114ad0b7974894858a17153d6f54546835066.tar.bz2 |
QGraphicsScene: Use QPainter::setClipRect instead of setClipPath if possible.
Using QPainter::setClipPath results in complex (and slow) alphamasking
so this must be avoided if possible.
Task-number: QTBUG-7790
Reviewed-by: samuel
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qpathclipper.cpp | 4 | ||||
-rw-r--r-- | src/gui/painting/qpathclipper_p.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp index 7997e77..5702ede 100644 --- a/src/gui/painting/qpathclipper.cpp +++ b/src/gui/painting/qpathclipper.cpp @@ -90,8 +90,6 @@ static QPointF normalize(const QPointF &p) return p / qSqrt(p.x() * p.x() + p.y() * p.y()); } -static bool pathToRect(const QPainterPath &path, QRectF *rect = 0); - struct QIntersection { qreal alphaA; @@ -1660,7 +1658,7 @@ static bool fuzzyCompare(qreal a, qreal b) return qFuzzyCompare(a, b); } -static bool pathToRect(const QPainterPath &path, QRectF *rect) +bool QPathClipper::pathToRect(const QPainterPath &path, QRectF *rect) { if (path.elementCount() != 5) return false; diff --git a/src/gui/painting/qpathclipper_p.h b/src/gui/painting/qpathclipper_p.h index 0d2c049..b900862 100644 --- a/src/gui/painting/qpathclipper_p.h +++ b/src/gui/painting/qpathclipper_p.h @@ -86,6 +86,8 @@ public: bool intersect(); bool contains(); + static bool pathToRect(const QPainterPath &path, QRectF *rect = 0); + private: Q_DISABLE_COPY(QPathClipper) |