aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/scenegraph/softwarecontext/rectanglenode.h
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@digia.com>2014-09-08 18:22:45 +0200
committerAndy Nichols <andy.nichols@digia.com>2014-10-21 15:05:34 +0300
commitcc972dc16c5ebcff5e8dc728f98605ad4e899c8c (patch)
tree35e14b6a9ecfed367551cf80989fb06fba1eecc2 /src/plugins/scenegraph/softwarecontext/rectanglenode.h
parentd2eb3152552846b88d693d5381c5bdbbf395e76c (diff)
Improve quality of RectangleNodes when rotated
When there is a rotation transformation on a RectangleNode it is not possible to take advantage of accelerated blitter paths, but we still need to do custom painting to recreate the behavior of a Rectangle component in Qt Quick. Now when there is a rotaiton transformation we will fall back to using QPainter::drawRect as long as there is no border or radius. If there is a border or radius value set though we will instead first render to a QPixmap before painting as the standard behavior of QPainter::drawRect and QPainter::drawRoundedRect does not match the expected behavior of a QQuick Rectangle item. This fixes the poor quality of rotated Rectangles at the cost of speed. The Rotation of any item should still be discouraged for performance reasons, but at least now Rectangles itmes should look correct when used. Change-Id: I3919ad732c9b4354a95e28e8dc09fcefd53f604e Reviewed-by: Eirik Aavitsland <eirik.aavitsland@digia.com>
Diffstat (limited to 'src/plugins/scenegraph/softwarecontext/rectanglenode.h')
-rw-r--r--src/plugins/scenegraph/softwarecontext/rectanglenode.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/scenegraph/softwarecontext/rectanglenode.h b/src/plugins/scenegraph/softwarecontext/rectanglenode.h
index f4c7cb3dcf..d3bcb2b8dc 100644
--- a/src/plugins/scenegraph/softwarecontext/rectanglenode.h
+++ b/src/plugins/scenegraph/softwarecontext/rectanglenode.h
@@ -45,6 +45,8 @@ public:
void paint(QPainter *);
private:
+ void paintRectangle(QPainter *painter, const QRect &rect);
+
QRect m_rect;
QColor m_color;
QColor m_penColor;