diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2011-09-02 13:58:57 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2011-09-02 14:31:56 +0200 |
commit | 10354d71aed2ef1b7247a857d8f020fb9dca769c (patch) | |
tree | 74b8dc6c0af26961493b134b2a6793766bd70c33 /src/gui/text/qrawfont_p.h | |
parent | f63993272f2aa7acebe30a7401dab7e46dd49a29 (diff) |
micro optimizations
use an inlined version of isValid() everywhere;
don't detach where is non required;
get rid of extra checks where possible
Change-Id: I6815c1f7d7c03677d9c57dda2731ed2868ea92aa
Merge-request: 1343
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Reviewed-on: http://codereview.qt.nokia.com/4144
Diffstat (limited to 'src/gui/text/qrawfont_p.h')
-rw-r--r-- | src/gui/text/qrawfont_p.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/text/qrawfont_p.h b/src/gui/text/qrawfont_p.h index 4a4ed56223..0187c374a0 100644 --- a/src/gui/text/qrawfont_p.h +++ b/src/gui/text/qrawfont_p.h @@ -54,7 +54,9 @@ // #include "qrawfont.h" + #include "qfontengine_p.h" +#include <QtCore/qthread.h> #include <QtCore/qthreadstorage.h> #if !defined(QT_NO_RAWFONT) @@ -96,6 +98,12 @@ public: cleanUp(); } + inline bool isValid() const + { + Q_ASSERT(thread == 0 || thread == QThread::currentThread()); + return fontEngine != 0; + } + void cleanUp(); void platformCleanUp(); void platformLoadFromData(const QByteArray &fontData, |