From 7443b3c9493ebed90397eaa4f3622e76e3131d10 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Wed, 22 Apr 2015 05:28:08 +0400 Subject: Optimize QFont::resolve(const QFont &other) When resolve_mask is 0, the font inherits just everything, and there is no need in checking for any resolved attributes; the resolved font always inherits dpi, so do not check it either. Change-Id: Ie5d7ced0859d46a9237447e29051a22569480a51 Reviewed-by: Simon Hausmann --- src/gui/text/qfont.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index a5fade99fd..ce39645246 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -1724,10 +1724,8 @@ bool QFont::rawMode() const */ QFont QFont::resolve(const QFont &other) const { - if (*this == other - && (resolve_mask == other.resolve_mask || resolve_mask == 0) - && d->dpi == other.d->dpi) { - QFont o = other; + if (resolve_mask == 0 || (resolve_mask == other.resolve_mask && *this == other)) { + QFont o(other); o.resolve_mask = resolve_mask; return o; } -- cgit v1.2.3