Enable STORE_FONT_CUSTOM_PLATFORM_DATA for all platforms
https://bugs.webkit.org/show_bug.cgi?id=108438
Reviewed by Andreas Kling.
Remove the conditional code so it is turned on for all platforms.
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::~CachedFont):
(WebCore::CachedFont::ensureCustomFontData):
(WebCore::CachedFont::platformDataFromCustomData):
(WebCore::CachedFont::allClientsRemoved):
(WebCore::CachedFont::reportMemoryUsage):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146802 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/loader/cache/CachedFont.cpp b/Source/WebCore/loader/cache/CachedFont.cpp
index 611bf4a..0d4e912 100644
--- a/Source/WebCore/loader/cache/CachedFont.cpp
+++ b/Source/WebCore/loader/cache/CachedFont.cpp
@@ -27,13 +27,10 @@
#include "config.h"
#include "CachedFont.h"
-#if !PLATFORM(WIN_CAIRO) && !PLATFORM(WX)
-#define STORE_FONT_CUSTOM_PLATFORM_DATA
-#endif
-
#include "CachedResourceClient.h"
#include "CachedResourceClientWalker.h"
#include "CachedResourceLoader.h"
+#include "FontCustomPlatformData.h"
#include "FontPlatformData.h"
#include "MemoryCache.h"
#include "ResourceBuffer.h"
@@ -41,10 +38,6 @@
#include "WebCoreMemoryInstrumentation.h"
#include <wtf/Vector.h>
-#ifdef STORE_FONT_CUSTOM_PLATFORM_DATA
-#include "FontCustomPlatformData.h"
-#endif
-
#if ENABLE(SVG_FONTS)
#include "NodeList.h"
#include "SVGDocument.h"
@@ -65,9 +58,7 @@
CachedFont::~CachedFont()
{
-#ifdef STORE_FONT_CUSTOM_PLATFORM_DATA
delete m_fontData;
-#endif
}
void CachedFont::load(CachedResourceLoader*, const ResourceLoaderOptions& options)
@@ -105,13 +96,11 @@
bool CachedFont::ensureCustomFontData()
{
-#ifdef STORE_FONT_CUSTOM_PLATFORM_DATA
if (!m_fontData && !errorOccurred() && !isLoading() && m_data) {
m_fontData = createFontCustomPlatformData(m_data.get()->sharedBuffer());
if (!m_fontData)
setStatus(DecodeError);
}
-#endif
return m_fontData;
}
@@ -121,12 +110,8 @@
if (m_externalSVGDocument)
return FontPlatformData(size, bold, italic);
#endif
-#ifdef STORE_FONT_CUSTOM_PLATFORM_DATA
ASSERT(m_fontData);
return m_fontData->fontPlatformData(static_cast<int>(size), bold, italic, orientation, widthVariant, renderingMode);
-#else
- return FontPlatformData();
-#endif
}
#if ENABLE(SVG_FONTS)
@@ -180,12 +165,10 @@
void CachedFont::allClientsRemoved()
{
-#ifdef STORE_FONT_CUSTOM_PLATFORM_DATA
if (m_fontData) {
delete m_fontData;
m_fontData = 0;
}
-#endif
}
void CachedFont::checkNotify()
@@ -205,9 +188,7 @@
#if ENABLE(SVG_FONTS)
info.addMember(m_externalSVGDocument, "externalSVGDocument");
#endif
-#ifdef STORE_FONT_CUSTOM_PLATFORM_DATA
info.addMember(m_fontData, "fontData");
-#endif
}
}