summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/wx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/graphics/wx')
-rw-r--r--Source/WebCore/platform/graphics/wx/FontCacheWx.cpp18
-rw-r--r--Source/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp12
2 files changed, 15 insertions, 15 deletions
diff --git a/Source/WebCore/platform/graphics/wx/FontCacheWx.cpp b/Source/WebCore/platform/graphics/wx/FontCacheWx.cpp
index e0034ecd6..acd1dc3e1 100644
--- a/Source/WebCore/platform/graphics/wx/FontCacheWx.cpp
+++ b/Source/WebCore/platform/graphics/wx/FontCacheWx.cpp
@@ -43,9 +43,9 @@ void FontCache::platformInit()
{
}
-const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length)
+PassRefPtr<SimpleFontData> FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length)
{
- SimpleFontData* fontData = 0;
+ RefPtr<SimpleFontData> fontData = 0;
fontData = getCachedFontData(font.fontDescription(), font.family().family(), false, DoNotRetain);
if (!fontData->containsCharacters(characters, length))
fontData = getSimilarFontPlatformData(font);
@@ -53,12 +53,12 @@ const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, cons
fontData = getLastResortFallbackFont(font.fontDescription());
ASSERT(fontData);
- return fontData;
+ return fontData.release();
}
-SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font)
+PassRefPtr<SimpleFontData> FontCache::getSimilarFontPlatformData(const Font& font)
{
- SimpleFontData* simpleFontData = 0;
+ RefPtr<SimpleFontData> simpleFontData = 0;
#if OS(DARWIN)
// Attempt to find an appropriate font using a match based on
// the presence of keywords in the the requested names. For example, we'll
@@ -78,14 +78,14 @@ SimpleFontData* FontCache::getSimilarFontPlatformData(const Font& font)
if (!simpleFontData)
simpleFontData = getCachedFontData(font.fontDescription(), font.family().family());
- return simpleFontData;
+ return simpleFontData.release();
}
-SimpleFontData* FontCache::getLastResortFallbackFont(const FontDescription& fontDescription, ShouldRetain shouldRetain)
+PassRefPtr<SimpleFontData> FontCache::getLastResortFallbackFont(const FontDescription& fontDescription, ShouldRetain shouldRetain)
{
// FIXME: Would be even better to somehow get the user's default font here. For now we'll pick
// the default that the user would get without changing any prefs.
- SimpleFontData* fallback = 0;
+ RefPtr<SimpleFontData> fallback = 0;
#if OS(WINDOWS)
static AtomicString fallbackName("Arial Unicode MS");
#else
@@ -94,7 +94,7 @@ SimpleFontData* FontCache::getLastResortFallbackFont(const FontDescription& font
fallback = getCachedFontData(fontDescription, fallbackName, false, shouldRetain);
ASSERT(fallback);
- return fallback;
+ return fallback.release();
}
FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family)
diff --git a/Source/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp b/Source/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp
index c2e4f2b84..e08a1540c 100644
--- a/Source/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp
+++ b/Source/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp
@@ -90,32 +90,32 @@ void SimpleFontData::platformDestroy()
#endif
}
-PassOwnPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescription& fontDescription, float scaleFactor) const
+PassRefPtr<SimpleFontData> SimpleFontData::createScaledFontData(const FontDescription& fontDescription, float scaleFactor) const
{
FontDescription desc = FontDescription(fontDescription);
desc.setSpecifiedSize(scaleFactor * fontDescription.computedSize());
FontPlatformData platformData(desc, desc.family().family());
- return adoptPtr(new SimpleFontData(platformData, isCustomFont(), false));
+ return SimpleFontData::create(platformData, isCustomFont(), false);
}
-SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDescription) const
+PassRefPtr<SimpleFontData> SimpleFontData::smallCapsFontData(const FontDescription& fontDescription) const
{
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->smallCaps)
m_derivedFontData->smallCaps = createScaledFontData(fontDescription, .7);
- return m_derivedFontData->smallCaps.get();
+ return m_derivedFontData->smallCaps;
}
-SimpleFontData* SimpleFontData::emphasisMarkFontData(const FontDescription& fontDescription) const
+PassRefPtr<SimpleFontData> SimpleFontData::emphasisMarkFontData(const FontDescription& fontDescription) const
{
if (!m_derivedFontData)
m_derivedFontData = DerivedFontData::create(isCustomFont());
if (!m_derivedFontData->emphasisMark)
m_derivedFontData->emphasisMark = createScaledFontData(fontDescription, .5);
- return m_derivedFontData->emphasisMark.get();
+ return m_derivedFontData->emphasisMark;
}
bool SimpleFontData::containsCharacters(const UChar* characters, int length) const