summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidget_p.h
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-10-07 20:36:05 +0200
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-10-13 10:51:26 +0000
commit2672a9a767909eab04ec6706bdef8a891a8f3d21 (patch)
tree0c9d6032b1733482f14e19c47c497c6dda6010b8 /src/widgets/kernel/qwidget_p.h
parentfedcaf0256f0094d77f171e4cdca2c4e2469e606 (diff)
QWidget: set brushOrigin in paintBackground() only when really needed
When painting the background for a QAbstractScrollArea, the brushOrigin was calculated for every brush type although it was not needed. Since this can be very time consuming (e.g for a QTreeView with non-uniform row sizes) it should be avoided when possible. Therefore check if the brush is a texture and skip the calculation if it is not the case. Also do not restore the old brushOrigin since the painter is not used at all afterwards. Task-number: QTBUG-61763 Change-Id: I66cbe1b796cb5cad4c78e656fb86d199d8e4bde9 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/kernel/qwidget_p.h')
-rw-r--r--src/widgets/kernel/qwidget_p.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index 20c4a682ed..c8eaabf8e2 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -400,6 +400,7 @@ public:
void setUpdatesEnabled_helper(bool );
+ bool updateBrushOrigin(QPainter *, const QBrush &brush) const;
void paintBackground(QPainter *, const QRegion &, int flags = DrawAsRoot) const;
bool isAboutToShow() const;
QRegion prepareToRender(const QRegion &region, QWidget::RenderFlags renderFlags);