Log Message
[WIN] Add WTF_USE_IMLANG_FONT_LINK2 https://bugs.webkit.org/show_bug.cgi?id=115198
Reviewed by Andreas Kling. Source/WebCore: Add this new define to have a central place for switching the IMLangFontLinkType and adop all usages of the type. This makes the usage of the code easier on desktop pcs. * platform/graphics/FontCache.h: (WebCore): * platform/graphics/wince/FontCacheWinCE.cpp: (WebCore::currentFontContainsCharacter): (WebCore::createMLangFont): (WebCore::FontCache::getFontDataForCharacters): * platform/graphics/wince/SimpleFontDataWinCE.cpp: (WebCore::SimpleFontData::containsCharacters): Source/WTF: * wtf/Platform.h:
Modified Paths
Diff
Modified: trunk/Source/WTF/ChangeLog (149292 => 149293)
--- trunk/Source/WTF/ChangeLog 2013-04-29 16:24:18 UTC (rev 149292)
+++ trunk/Source/WTF/ChangeLog 2013-04-29 16:33:04 UTC (rev 149293)
@@ -1,5 +1,14 @@
2013-04-29 Patrick Gansterer <[email protected]>
+ [WIN] Add WTF_USE_IMLANG_FONT_LINK2
+ https://bugs.webkit.org/show_bug.cgi?id=115198
+
+ Reviewed by Andreas Kling.
+
+ * wtf/Platform.h:
+
+2013-04-29 Patrick Gansterer <[email protected]>
+
Define USE(ICU_UNICODE) if USE(WCHAR_UNICODE) is false
https://bugs.webkit.org/show_bug.cgi?id=115349
Modified: trunk/Source/WTF/wtf/Platform.h (149292 => 149293)
--- trunk/Source/WTF/wtf/Platform.h 2013-04-29 16:24:18 UTC (rev 149292)
+++ trunk/Source/WTF/wtf/Platform.h 2013-04-29 16:33:04 UTC (rev 149293)
@@ -918,6 +918,10 @@
#define WTF_USE_UNIX_DOMAIN_SOCKETS 1
#endif
+#if !defined(WTF_USE_IMLANG_FONT_LINK2) && !OS(WINCE)
+#define WTF_USE_IMLANG_FONT_LINK2 1
+#endif
+
#if !defined(ENABLE_COMPARE_AND_SWAP) && (OS(WINDOWS) || (COMPILER(GCC) && (CPU(X86) || CPU(X86_64) || CPU(ARM_THUMB2))))
#define ENABLE_COMPARE_AND_SWAP 1
#endif
Modified: trunk/Source/WebCore/ChangeLog (149292 => 149293)
--- trunk/Source/WebCore/ChangeLog 2013-04-29 16:24:18 UTC (rev 149292)
+++ trunk/Source/WebCore/ChangeLog 2013-04-29 16:33:04 UTC (rev 149293)
@@ -1,3 +1,23 @@
+2013-04-29 Patrick Gansterer <[email protected]>
+
+ [WIN] Add WTF_USE_IMLANG_FONT_LINK2
+ https://bugs.webkit.org/show_bug.cgi?id=115198
+
+ Reviewed by Andreas Kling.
+
+ Add this new define to have a central place for switching
+ the IMLangFontLinkType and adop all usages of the type.
+ This makes the usage of the code easier on desktop pcs.
+
+ * platform/graphics/FontCache.h:
+ (WebCore):
+ * platform/graphics/wince/FontCacheWinCE.cpp:
+ (WebCore::currentFontContainsCharacter):
+ (WebCore::createMLangFont):
+ (WebCore::FontCache::getFontDataForCharacters):
+ * platform/graphics/wince/SimpleFontDataWinCE.cpp:
+ (WebCore::SimpleFontData::containsCharacters):
+
2013-04-29 Noam Rosenthal <[email protected]>
Get rid of "non-composited contents" in CoordinatedLayerTreeHost
Modified: trunk/Source/WebCore/platform/graphics/FontCache.h (149292 => 149293)
--- trunk/Source/WebCore/platform/graphics/FontCache.h 2013-04-29 16:24:18 UTC (rev 149292)
+++ trunk/Source/WebCore/platform/graphics/FontCache.h 2013-04-29 16:33:04 UTC (rev 149293)
@@ -55,7 +55,7 @@
class SimpleFontData;
#if PLATFORM(WIN)
-#if !OS(WINCE) || defined(IMLANG_FONT_LINK) && (IMLANG_FONT_LINK == 2)
+#if USE(IMLANG_FONT_LINK2)
typedef IMLangFontLink2 IMLangFontLinkType;
#else
typedef IMLangFontLink IMLangFontLinkType;
@@ -82,12 +82,10 @@
#if PLATFORM(WIN)
IMLangFontLinkType* getFontLinkInterface();
-#if OS(WINCE)
static void comInitialize();
static void comUninitialize();
static IMultiLanguage* getMultiLanguageInterface();
#endif
-#endif
void getTraitsInFamily(const AtomicString&, Vector<unsigned>&);
Modified: trunk/Source/WebCore/platform/graphics/wince/FontCacheWinCE.cpp (149292 => 149293)
--- trunk/Source/WebCore/platform/graphics/wince/FontCacheWinCE.cpp 2013-04-29 16:24:18 UTC (rev 149292)
+++ trunk/Source/WebCore/platform/graphics/wince/FontCacheWinCE.cpp 2013-04-29 16:33:04 UTC (rev 149293)
@@ -64,9 +64,9 @@
return langFontLink;
}
-#if defined(IMLANG_FONT_LINK) && (IMLANG_FONT_LINK == 2)
-static bool currentFontContainsCharacter(IMLangFontLink2* langFontLink, HDC hdc, UChar character)
+static bool currentFontContainsCharacter(IMLangFontLinkType* langFontLink, HDC hdc, HFONT hfont, UChar character, const wchar_t* faceName)
{
+#if USE(IMLANG_FONT_LINK2)
UINT unicodeRanges;
if (S_OK != langFontLink->GetFontUnicodeRanges(hdc, &unicodeRanges, 0))
return false;
@@ -82,12 +82,7 @@
if (i->wcTo >= character)
return i->wcFrom <= character;
}
-
- return false;
-}
#else
-static bool currentFontContainsCharacter(IMLangFontLink* langFontLink, HDC hdc, HFONT hfont, UChar character, const wchar_t* faceName)
-{
DWORD fontCodePages = 0, charCodePages = 0;
HRESULT result = langFontLink->GetFontCodePages(hdc, hfont, &fontCodePages);
if (result != S_OK)
@@ -99,29 +94,25 @@
fontCodePages |= FontPlatformData::getKnownFontCodePages(faceName);
if (fontCodePages & charCodePages)
return true;
+#endif
return false;
}
-#endif
-#if defined(IMLANG_FONT_LINK) && (IMLANG_FONT_LINK == 2)
-static HFONT createMLangFont(IMLangFontLink2* langFontLink, HDC hdc, DWORD codePageMask, UChar character = 0)
+static HFONT createMLangFont(IMLangFontLinkType* langFontLink, HDC hdc, const FontPlatformData& refFont, DWORD codePageMask, UChar character = 0)
{
HFONT mlangFont;
- if (SUCCEEDED(langFontLink->MapFont(hdc, codePageMask, character, &mlangFont)))
- return mlangFont;
- return 0;
-}
+#if USE(IMLANG_FONT_LINK2)
+ HRESULT result = langFontLink->MapFont(hdc, codePageMask, character, &mlangFont);
#else
-static HFONT createMLangFont(IMLangFontLink* langFontLink, HDC hdc, const FontPlatformData& refFont, DWORD codePageMask)
-{
- HFONT mlangFont;
- LRESULT result = langFontLink->MapFont(hdc, codePageMask, refFont.hfont(), &mlangFont);
+ HRESULT result = langFontLink->MapFont(hdc, codePageMask, refFont.hfont(), &mlangFont);
+#endif
- return result == S_OK ? mlangFont : 0;
+ if (SUCCEEDED(result))
+ return mlangFont;
+ return 0;
}
-#endif
static const Vector<DWORD, 4>& getCJKCodePageMasks()
{
@@ -235,11 +226,7 @@
const Vector<DWORD, 4>& CJKCodePageMasks = getCJKCodePageMasks();
unsigned numCodePages = CJKCodePageMasks.size();
for (unsigned i = 0; i < numCodePages; ++i) {
-#if defined(IMLANG_FONT_LINK) && (IMLANG_FONT_LINK == 2)
- hfont = createMLangFont(langFontLink, g_screenDC, CJKCodePageMasks[i]);
-#else
hfont = createMLangFont(langFontLink, g_screenDC, origFont, CJKCodePageMasks[i]);
-#endif
if (!hfont)
continue;
@@ -249,11 +236,7 @@
if (hfont && !(codePages & CJKCodePageMasks[i])) {
// We asked about a code page that is not one of the code pages
// returned by MLang, so the font might not contain the character.
-#if defined(IMLANG_FONT_LINK) && (IMLANG_FONT_LINK == 2)
- if (!currentFontContainsCharacter(langFontLink, g_screenDC, character))
-#else
if (!currentFontContainsCharacter(langFontLink, g_screenDC, hfont, character, name))
-#endif
{
SelectObject(g_screenDC, oldFont);
langFontLink->ReleaseFont(hfont);
@@ -264,11 +247,7 @@
break;
}
} else {
-#if defined(IMLANG_FONT_LINK) && (IMLANG_FONT_LINK == 2)
- hfont = createMLangFont(langFontLink, g_screenDC, codePages, character);
-#else
- hfont = createMLangFont(langFontLink, g_screenDC, origFont, codePages);
-#endif
+ hfont = createMLangFont(langFontLink, g_screenDC, origFont, codePages, character);
SelectObject(g_screenDC, hfont);
GetTextFace(g_screenDC, LF_FACESIZE, name);
}
Modified: trunk/Source/WebCore/platform/graphics/wince/SimpleFontDataWinCE.cpp (149292 => 149293)
--- trunk/Source/WebCore/platform/graphics/wince/SimpleFontDataWinCE.cpp 2013-04-29 16:24:18 UTC (rev 149292)
+++ trunk/Source/WebCore/platform/graphics/wince/SimpleFontDataWinCE.cpp 2013-04-29 16:33:04 UTC (rev 149293)
@@ -87,11 +87,7 @@
// cover a given code page?
// FIXME: in the case that we failed to get the interface, still use the font.
-#if defined(IMLANG_FONT_LINK) && (IMLANG_FONT_LINK == 2)
- IMLangFontLink2* langFontLink = fontCache()->getFontLinkInterface();
-#else
- IMLangFontLink* langFontLink = fontCache()->getFontLinkInterface();
-#endif
+ IMLangFontLinkType* langFontLink = fontCache()->getFontLinkInterface();
if (!langFontLink)
return true;
_______________________________________________ webkit-changes mailing list [email protected] https://lists.webkit.org/mailman/listinfo/webkit-changes
