aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@digia.com>2014-08-12 16:18:51 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-08-12 17:46:43 +0300
commitcd71ddd020d16dc06c5eb7f5d4d0988255d49cd9 (patch)
treed83df696e0dbc4a6f7267fe66414b27034bb1355
parent8e7d0905e553c5c42f3caa204a5a160e25ad62f7 (diff)
Use fillRect when appropriate
This is the most common case and it is possible to use the accelerated blitter path, where as drawRect requires extra effort for the border and thus always uses the raster path. Change-Id: Ic4600b7247a86db5f79268c5ad5b02c331f51058 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
-rw-r--r--softwarecontext/rectanglenode.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/softwarecontext/rectanglenode.cpp b/softwarecontext/rectanglenode.cpp
index 0c2575b3fd..643325ebcd 100644
--- a/softwarecontext/rectanglenode.cpp
+++ b/softwarecontext/rectanglenode.cpp
@@ -95,6 +95,8 @@ void RectangleNode::paint(QPainter *painter)
painter->setBrush(m_brush);
if (m_radius)
painter->drawRoundedRect(m_rect, m_radius, m_radius);
+ else if (m_pen.style() == Qt::NoPen && m_stops.isEmpty())
+ painter->fillRect(m_rect, m_color);
else
painter->drawRect(m_rect);
}