From ab10c5b4be5c0d06edd79d8b4a8da090c1511d7e Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 14 Sep 2009 11:25:11 +0200 Subject: Don't call into paint engines when we don't have pens and brushes Reviewed-by: sroedal --- src/gui/painting/qpaintengineex.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp index e75240c..656f383 100644 --- a/src/gui/painting/qpaintengineex.cpp +++ b/src/gui/painting/qpaintengineex.cpp @@ -535,8 +535,13 @@ void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen) void QPaintEngineEx::draw(const QVectorPath &path) { - fill(path, state()->brush); - stroke(path, state()->pen); + const QBrush &brush = state()->brush; + if (qbrush_style(brush) != Qt::NoBrush) + fill(path, brush); + + const QPen &pen = state()->pen; + if (qpen_style(pen) != Qt::NoPen && qbrush_style(qpen_brush(pen)) != Qt::NoBrush) + stroke(path, pen); } -- cgit v0.12