Commit 8f71f50f authored by zecke@webkit.org's avatar zecke@webkit.org
Browse files

[Qt] Avoid calling QFont::detach too often from FontQt

https://bugs.webkit.org/show_bug.cgi?id=35569

The letter- and wordspacing is inside the WebCore::Font class,
our QFont is located in the WebCore::FontPlatformData. Everytime
we need to use a QFont inside WebCore::Font we are calling the
font method which gets the QFont from the WebCore::FontPlatformData
and is applying the letter- and wordspacing. Internally this
will attempt to detach the QFont...

Avoid calling setLetterSpacing and setWordSpacing on QFont if
the WebCore::Font has the default applied.

* platform/graphics/qt/FontQt.cpp:
(WebCore::Font::font):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55518 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f4941ad8
2010-03-02 Holger Hans Peter Freyther <zecke@selfish.org>
Reviewed by Simon Hausmann.
[Qt] Avoid calling QFont::detach too often from FontQt
https://bugs.webkit.org/show_bug.cgi?id=35569
The letter- and wordspacing is inside the WebCore::Font class,
our QFont is located in the WebCore::FontPlatformData. Everytime
we need to use a QFont inside WebCore::Font we are calling the
font method which gets the QFont from the WebCore::FontPlatformData
and is applying the letter- and wordspacing. Internally this
will attempt to detach the QFont...
Avoid calling setLetterSpacing and setWordSpacing on QFont if
the WebCore::Font has the default applied.
* platform/graphics/qt/FontQt.cpp:
(WebCore::Font::font):
2010-03-04 Alexander Pavlov <apavlov@chromium.org>
 
Reviewed by Pavel Feldman.
......
......@@ -219,8 +219,10 @@ FloatRect Font::selectionRectForComplexText(const TextRun& run, const IntPoint&
QFont Font::font() const
{
QFont f = primaryFont()->getQtFont();
f.setLetterSpacing(QFont::AbsoluteSpacing, m_letterSpacing);
f.setWordSpacing(m_wordSpacing);
if (m_letterSpacing != 0)
f.setLetterSpacing(QFont::AbsoluteSpacing, m_letterSpacing);
if (m_wordSpacing != 0)
f.setWordSpacing(m_wordSpacing);
return f;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment