Commit ece87828 authored by paroga@webkit.org's avatar paroga@webkit.org

2011-05-12 Patrick Gansterer <paroga@webkit.org>

        Reviewed by Darin Adler.

        Rename SimpleFontData::scaledFontData to createScaledFontData
        https://bugs.webkit.org/show_bug.cgi?id=60723

        * platform/graphics/SimpleFontData.h:
        * platform/graphics/chromium/SimpleFontDataChromiumWin.cpp:
        * platform/graphics/chromium/SimpleFontDataLinux.cpp:
        * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
        * platform/graphics/haiku/SimpleFontDataHaiku.cpp:
        * platform/graphics/mac/SimpleFontDataMac.mm:
        * platform/graphics/pango/SimpleFontDataPango.cpp:
        * platform/graphics/qt/SimpleFontDataQt.cpp:
        * platform/graphics/win/SimpleFontDataWin.cpp:
        * platform/graphics/wince/SimpleFontDataWinCE.cpp:
        * platform/graphics/wx/SimpleFontDataWx.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@86401 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b80b4638
2011-05-12 Patrick Gansterer <paroga@webkit.org>
Reviewed by Darin Adler.
Rename SimpleFontData::scaledFontData to createScaledFontData
https://bugs.webkit.org/show_bug.cgi?id=60723
* platform/graphics/SimpleFontData.h:
* platform/graphics/chromium/SimpleFontDataChromiumWin.cpp:
* platform/graphics/chromium/SimpleFontDataLinux.cpp:
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
* platform/graphics/haiku/SimpleFontDataHaiku.cpp:
* platform/graphics/mac/SimpleFontDataMac.mm:
* platform/graphics/pango/SimpleFontDataPango.cpp:
* platform/graphics/qt/SimpleFontDataQt.cpp:
* platform/graphics/win/SimpleFontDataWin.cpp:
* platform/graphics/wince/SimpleFontDataWinCE.cpp:
* platform/graphics/wx/SimpleFontDataWx.cpp:
2011-05-12 Levi Weintraub <leviw@chromium.org>
Reviewed by Simon Fraser.
......@@ -193,7 +193,7 @@ private:
void commonInit();
PassOwnPtr<SimpleFontData> scaledFontData(const FontDescription&, float scaleFactor) const;
PassOwnPtr<SimpleFontData> createScaledFontData(const FontDescription&, float scaleFactor) const;
#if (PLATFORM(WIN) && !OS(WINCE)) \
|| (OS(WINDOWS) && PLATFORM(WX))
......
......@@ -112,7 +112,7 @@ void SimpleFontData::platformDestroy()
{
}
PassOwnPtr<SimpleFontData> SimpleFontData::scaledFontData(const FontDescription& fontDescription, float scaleFactor) const
PassOwnPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescription& fontDescription, float scaleFactor) const
{
LOGFONT winFont;
GetObject(m_platformData.hfont(), sizeof(LOGFONT), &winFont);
......@@ -127,7 +127,7 @@ SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDes
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->smallCaps)
m_derivedFontData->smallCaps = scaledFontData(fontDescription, .7);
m_derivedFontData->smallCaps = createScaledFontData(fontDescription, .7);
return m_derivedFontData->smallCaps.get();
}
......@@ -137,7 +137,7 @@ SimpleFontData* SimpleFontData::emphasisMarkFontData(const FontDescription& font
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->emphasisMark)
m_derivedFontData->emphasisMark = scaledFontData(fontDescription, .5);
m_derivedFontData->emphasisMark = createScaledFontData(fontDescription, .5);
return m_derivedFontData->emphasisMark.get();
}
......
......@@ -155,7 +155,7 @@ void SimpleFontData::platformDestroy()
{
}
PassOwnPtr<SimpleFontData> SimpleFontData::scaledFontData(const FontDescription& fontDescription, float scaleFactor) const
PassOwnPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescription& fontDescription, float scaleFactor) const
{
const float scaledSize = lroundf(fontDescription.computedSize() * scaleFactor);
return adoptPtr(new SimpleFontData(FontPlatformData(m_platformData, scaledSize), isCustomFont(), false));
......@@ -166,7 +166,7 @@ SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDes
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->smallCaps)
m_derivedFontData->smallCaps = scaledFontData(fontDescription, smallCapsFraction);
m_derivedFontData->smallCaps = createScaledFontData(fontDescription, smallCapsFraction);
return m_derivedFontData->smallCaps.get();
}
......@@ -176,7 +176,7 @@ SimpleFontData* SimpleFontData::emphasisMarkFontData(const FontDescription& font
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->emphasisMark)
m_derivedFontData->emphasisMark = scaledFontData(fontDescription, emphasisMarkFraction);
m_derivedFontData->emphasisMark = createScaledFontData(fontDescription, emphasisMarkFraction);
return m_derivedFontData->emphasisMark.get();
}
......
......@@ -86,7 +86,7 @@ void SimpleFontData::platformDestroy()
{
}
PassOwnPtr<SimpleFontData> SimpleFontData::scaledFontData(const FontDescription& fontDescription, float scaleFactor) const
PassOwnPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescription& fontDescription, float scaleFactor) const
{
return adoptPtr(new SimpleFontData(FontPlatformData(cairo_scaled_font_get_font_face(m_platformData.scaledFont()),
scaleFactor * fontDescription.computedSize(), m_platformData.syntheticBold(), m_platformData.syntheticOblique()),
......@@ -99,7 +99,7 @@ SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDes
m_derivedFontData = DerivedFontData::create(isCustomFont());
// FIXME: I think we want to ask FontConfig for the right font again.
if (!m_derivedFontData->smallCaps)
m_derivedFontData->smallCaps = scaledFontData(fontDescription, .7);
m_derivedFontData->smallCaps = createScaledFontData(fontDescription, .7);
return m_derivedFontData->smallCaps.get();
}
......@@ -109,7 +109,7 @@ SimpleFontData* SimpleFontData::emphasisMarkFontData(const FontDescription& font
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->emphasisMark)
m_derivedFontData->emphasisMark = scaledFontData(fontDescription, .5);
m_derivedFontData->emphasisMark = createScaledFontData(fontDescription, .5);
return m_derivedFontData->emphasisMark.get();
}
......
......@@ -66,7 +66,7 @@ void SimpleFontData::platformDestroy()
{
}
PassOwnPtr<SimpleFontData> SimpleFontData::scaledFontData(const FontDescription& fontDescription, float scaleFactor) const
PassOwnPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescription& fontDescription, float scaleFactor) const
{
FontDescription desc = FontDescription(fontDescription);
desc.setSpecifiedSize(scaleFactor * fontDescription.computedSize());
......@@ -79,7 +79,7 @@ SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDes
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->smallCaps)
m_derivedFontData->smallCaps = scaledFontData(fontDescription, .7);
m_derivedFontData->smallCaps = createScaledFontData(fontDescription, .7);
return m_derivedFontData->smallCaps.get();
}
......@@ -89,7 +89,7 @@ SimpleFontData* SimpleFontData::emphasisMarkFontData(const FontDescription& font
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->emphasisMark)
m_derivedFontData->emphasisMark = scaledFontData(fontDescription, .5);
m_derivedFontData->emphasisMark = createScaledFontData(fontDescription, .5);
return m_derivedFontData->emphasisMark.get();
}
......
......@@ -296,7 +296,7 @@ void SimpleFontData::platformDestroy()
#endif
}
PassOwnPtr<SimpleFontData> SimpleFontData::scaledFontData(const FontDescription& fontDescription, float scaleFactor) const
PassOwnPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescription& fontDescription, float scaleFactor) const
{
if (isCustomFont()) {
FontPlatformData scaledFontData(m_platformData);
......@@ -338,7 +338,7 @@ SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDes
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->smallCaps)
m_derivedFontData->smallCaps = scaledFontData(fontDescription, smallCapsFontSizeMultiplier);
m_derivedFontData->smallCaps = createScaledFontData(fontDescription, smallCapsFontSizeMultiplier);
return m_derivedFontData->smallCaps.get();
}
......@@ -348,7 +348,7 @@ SimpleFontData* SimpleFontData::emphasisMarkFontData(const FontDescription& font
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->emphasisMark)
m_derivedFontData->emphasisMark = scaledFontData(fontDescription, .5f);
m_derivedFontData->emphasisMark = createScaledFontData(fontDescription, .5f);
return m_derivedFontData->emphasisMark.get();
}
......
......@@ -84,7 +84,7 @@ void SimpleFontData::platformDestroy()
{
}
PassOwnPtr<SimpleFontData> SimpleFontData::scaledFontData(const FontDescription& fontDescription, float scaleFactor) const
PassOwnPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescription& fontDescription, float scaleFactor) const
{
FontDescription desc = FontDescription(fontDescription);
desc.setSpecifiedSize(scaleFactor * fontDescription.computedSize());
......@@ -97,7 +97,7 @@ SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDes
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->smallCaps)
m_derivedFontData->smallCaps = scaledFontData(fontDescription, .7);
m_derivedFontData->smallCaps = createScaledFontData(fontDescription, .7);
return m_derivedFontData->smallCaps.get();
}
......@@ -107,7 +107,7 @@ SimpleFontData* SimpleFontData::emphasisMarkFontData(const FontDescription& font
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->emphasisMark)
m_derivedFontData->emphasisMark = scaledFontData(fontDescription, .5);
m_derivedFontData->emphasisMark = createScaledFontData(fontDescription, .5);
return m_derivedFontData->emphasisMark.get();
}
......
......@@ -71,7 +71,7 @@ float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
return advances.at(0).x();
}
PassOwnPtr<SimpleFontData> SimpleFontData::scaledFontData(const FontDescription& fontDescription, float scaleFactor) const
PassOwnPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescription& fontDescription, float scaleFactor) const
{
const float scaledSize = lroundf(fontDescription.computedSize() * scaleFactor);
return adoptPtr(new SimpleFontData(FontPlatformData(m_platformData, scaledSize), isCustomFont(), false));
......@@ -82,7 +82,7 @@ SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDes
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->smallCaps)
m_derivedFontData->smallCaps = scaledFontData(fontDescription, smallCapsFraction);
m_derivedFontData->smallCaps = createScaledFontData(fontDescription, smallCapsFraction);
return m_derivedFontData->smallCaps.get();
}
......@@ -92,7 +92,7 @@ SimpleFontData* SimpleFontData::emphasisMarkFontData(const FontDescription& font
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->emphasisMark)
m_derivedFontData->emphasisMark = scaledFontData(fontDescription, emphasisMarkFraction);
m_derivedFontData->emphasisMark = createScaledFontData(fontDescription, emphasisMarkFraction);
return m_derivedFontData->emphasisMark.get();
}
......
......@@ -108,7 +108,7 @@ void SimpleFontData::platformDestroy()
delete m_scriptFontProperties;
}
PassOwnPtr<SimpleFontData> SimpleFontData::scaledFontData(const FontDescription& fontDescription, float scaleFactor) const
PassOwnPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescription& fontDescription, float scaleFactor) const
{
float scaledSize = scaleFactor * m_platformData.size();
if (isCustomFont()) {
......@@ -129,7 +129,7 @@ SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDes
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->smallCaps)
m_derivedFontData->smallCaps = scaledFontData(fontDescription, cSmallCapsFontSizeMultiplier);
m_derivedFontData->smallCaps = createScaledFontData(fontDescription, cSmallCapsFontSizeMultiplier);
return m_derivedFontData->smallCaps.get();
}
......@@ -139,7 +139,7 @@ SimpleFontData* SimpleFontData::emphasisMarkFontData(const FontDescription& font
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->emphasisMark)
m_derivedFontData->emphasisMark = scaledFontData(fontDescription, .5);
m_derivedFontData->emphasisMark = createScaledFontData(fontDescription, .5);
return m_derivedFontData->emphasisMark.get();
}
......
......@@ -63,7 +63,7 @@ void SimpleFontData::platformDestroy()
{
}
PassOwnPtr<SimpleFontData> SimpleFontData::scaledFontData(const FontDescription& fontDescription, float scaleFactor) const
PassOwnPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescription& fontDescription, float scaleFactor) const
{
FontDescription fontDesc(fontDescription);
fontDesc.setComputedSize(lroundf(scaleFactor * fontDesc.computedSize()));
......@@ -80,7 +80,7 @@ SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDes
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->smallCaps)
m_derivedFontData->smallCaps = scaledFontData(fontDescription, .7);
m_derivedFontData->smallCaps = createScaledFontData(fontDescription, .7);
return m_derivedFontData->smallCaps.get();
}
......@@ -90,7 +90,7 @@ SimpleFontData* SimpleFontData::emphasisMarkFontData(const FontDescription& font
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->emphasisMark)
m_derivedFontData->emphasisMark = scaledFontData(fontDescription, .5);
m_derivedFontData->emphasisMark = createScaledFontData(fontDescription, .5);
return m_derivedFontData->emphasisMark.get();
}
......
......@@ -90,7 +90,7 @@ void SimpleFontData::platformDestroy()
#endif
}
PassOwnPtr<SimpleFontData> SimpleFontData::scaledFontData(const FontDescription& fontDescription, float scaleFactor) const
PassOwnPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescription& fontDescription, float scaleFactor) const
{
FontDescription desc = FontDescription(fontDescription);
desc.setSpecifiedSize(scaleFactor * fontDescription.computedSize());
......@@ -103,7 +103,7 @@ SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDes
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->smallCaps)
m_derivedFontData->smallCaps = scaledFontData(fontDescription, .7);
m_derivedFontData->smallCaps = createScaledFontData(fontDescription, .7);
return m_derivedFontData->smallCaps.get();
}
......@@ -113,7 +113,7 @@ SimpleFontData* SimpleFontData::emphasisMarkFontData(const FontDescription& font
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->emphasisMark)
m_derivedFontData->emphasisMark = scaledFontData(fontDescription, .5);
m_derivedFontData->emphasisMark = createScaledFontData(fontDescription, .5);
return m_derivedFontData->emphasisMark.get();
}
......
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