[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

mitz at apple.com mitz at apple.com
Thu Apr 8 02:22:06 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit c9156d52356d688d9d59254d22743f16ea822b04
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Mar 14 21:44:07 2010 +0000

    WebCore: WebCore part of removing support for legacy versions of Core Graphics
    
    Reviewed by Darin Adler.
    
    * WebCore.vcproj/WebCore.vcproj: Removed FontDatabase.{cpp,h}
    * platform/graphics/win/FontCGWin.cpp:
    (WebCore::Font::drawGlyphs): Removed call to wkCanCreateCGFontWithLOGFONT(),
    as it is now always true.
    * platform/graphics/win/FontCacheWin.cpp:
    (WebCore::FontCache::createFontPlatformData): Ditto.
    * platform/graphics/win/FontCustomPlatformData.cpp:
    (WebCore::FontCustomPlatformData::~FontCustomPlatformData): Updated for
    the removal of m_cgFont.
    (WebCore::FontCustomPlatformData::fontPlatformData): Removed call to
    wkCanCreateCGFontWithLOGFONT(), as it is now always true.
    (WebCore::createFontCustomPlatformData): Ditto. Also updated for change to
    the FontCustomPlatformData constructor.
    * platform/graphics/win/FontCustomPlatformData.h: Removed m_cgFont member.
    (WebCore::FontCustomPlatformData::FontCustomPlatformData): Removed cgFont
    parameter.
    * platform/graphics/win/FontDatabase.cpp: Removed.
    * platform/graphics/win/FontDatabase.h: Removed.
    * platform/graphics/win/FontPlatformDataCGWin.cpp:
    (WebCore::FontPlatformData::platformDataInit): Removed call to
    wkCanCreateCGFontWithLOGFONT(), as it is now always true.
    * platform/win/TemporaryLinkStubs.cpp:
    (WebCore::populateFontDatabase): Removed stub.
    
    WebKit/win: WebKit part of removing support for legacy versions of Core Graphics
    
    Reviewed by Darin Adler.
    
    * WebKitClassFactory.cpp:
    (WebKitClassFactory::WebKitClassFactory): Removed call to populateFontDatabase().
    * WebKitGraphics.cpp:
    (makeFont): Ditto.
    * WebTextRenderer.cpp:
    (WebTextRenderer::registerPrivateFont): Removed call to wkAddFontsAtPath().
    
    WebKitLibraries: WebKitSystemInterface part of removing support for legacy versions of Core Graphics
    
    Reviewed by Darin Adler.
    
    * win/include/WebKitSystemInterface/WebKitSystemInterface.h: Removed
    wkCanCreateCGFontWithLOGFONT(), wkSetFontPlatformInfo(), wkAddFontsInDirectory(),
    wkAddFontsAtPath(), wkAddFontsFromRegistry(), wkAddFontsFromPlist(), and
    wkCreateFontsPlist().
    * win/lib/WebKitSystemInterface.lib: Updated.
    * win/lib/WebKitSystemInterface_debug.lib: Updated.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55975 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9cc89b4..cae94af 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,33 @@
+2010-03-14  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Darin Adler.
+
+        WebCore part of removing support for legacy versions of Core Graphics
+
+        * WebCore.vcproj/WebCore.vcproj: Removed FontDatabase.{cpp,h}
+        * platform/graphics/win/FontCGWin.cpp:
+        (WebCore::Font::drawGlyphs): Removed call to wkCanCreateCGFontWithLOGFONT(),
+        as it is now always true.
+        * platform/graphics/win/FontCacheWin.cpp:
+        (WebCore::FontCache::createFontPlatformData): Ditto.
+        * platform/graphics/win/FontCustomPlatformData.cpp:
+        (WebCore::FontCustomPlatformData::~FontCustomPlatformData): Updated for
+        the removal of m_cgFont.
+        (WebCore::FontCustomPlatformData::fontPlatformData): Removed call to
+        wkCanCreateCGFontWithLOGFONT(), as it is now always true.
+        (WebCore::createFontCustomPlatformData): Ditto. Also updated for change to
+        the FontCustomPlatformData constructor.
+        * platform/graphics/win/FontCustomPlatformData.h: Removed m_cgFont member.
+        (WebCore::FontCustomPlatformData::FontCustomPlatformData): Removed cgFont
+        parameter.
+        * platform/graphics/win/FontDatabase.cpp: Removed.
+        * platform/graphics/win/FontDatabase.h: Removed.
+        * platform/graphics/win/FontPlatformDataCGWin.cpp:
+        (WebCore::FontPlatformData::platformDataInit): Removed call to
+        wkCanCreateCGFontWithLOGFONT(), as it is now always true.
+        * platform/win/TemporaryLinkStubs.cpp:
+        (WebCore::populateFontDatabase): Removed stub.
+
 2010-03-14  Jessie Berlin  <jberlin at webkit.org>
 
         Reviewed by Sam Weinig.
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 9f43bde..3b674c3 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -22883,30 +22883,6 @@
 						</FileConfiguration>
 					</File>
 					<File
-						RelativePath="..\platform\graphics\win\FontDatabase.cpp"
-						>
-						<FileConfiguration
-							Name="Debug_Cairo|Win32"
-							ExcludedFromBuild="true"
-							>
-							<Tool
-								Name="VCCLCompilerTool"
-							/>
-						</FileConfiguration>
-						<FileConfiguration
-							Name="Release_Cairo|Win32"
-							ExcludedFromBuild="true"
-							>
-							<Tool
-								Name="VCCLCompilerTool"
-							/>
-						</FileConfiguration>
-					</File>
-					<File
-						RelativePath="..\platform\graphics\win\FontDatabase.h"
-						>
-					</File>
-					<File
 						RelativePath="..\platform\graphics\win\FontPlatformData.h"
 						>
 					</File>
diff --git a/WebCore/platform/graphics/win/FontCGWin.cpp b/WebCore/platform/graphics/win/FontCGWin.cpp
index 8ed8712..e4eb159 100644
--- a/WebCore/platform/graphics/win/FontCGWin.cpp
+++ b/WebCore/platform/graphics/win/FontCGWin.cpp
@@ -321,12 +321,9 @@ void Font::drawGlyphs(GraphicsContext* graphicsContext, const SimpleFontData* fo
         ASSERT_NOT_REACHED();
     }
 
-    if (font->platformData().useGDI()) {
-        static bool canCreateCGFontWithLOGFONT = wkCanCreateCGFontWithLOGFONT();
-        if (!shouldUseFontSmoothing || !canCreateCGFontWithLOGFONT && (graphicsContext->textDrawingMode() & cTextStroke)) {
-            drawGDIGlyphs(graphicsContext, font, glyphBuffer, from, numGlyphs, point);
-            return;
-        }
+    if (font->platformData().useGDI() && !shouldUseFontSmoothing) {
+        drawGDIGlyphs(graphicsContext, font, glyphBuffer, from, numGlyphs, point);
+        return;
     }
 
     uint32_t oldFontSmoothingStyle = wkSetFontSmoothingStyle(cgContext, shouldUseFontSmoothing);
diff --git a/WebCore/platform/graphics/win/FontCacheWin.cpp b/WebCore/platform/graphics/win/FontCacheWin.cpp
index 8869a90..5bdc3cf 100644
--- a/WebCore/platform/graphics/win/FontCacheWin.cpp
+++ b/WebCore/platform/graphics/win/FontCacheWin.cpp
@@ -517,14 +517,9 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD
     // This masks rounding errors related to the HFONT metrics being  different from the CGFont metrics.
     // FIXME: We will eventually want subpixel precision for GDI mode, but the scaled rendering doesn't
     // look as nice. That may be solvable though.
-#if PLATFORM(CG)
-    bool canCreateCGFontWithLOGFONT = wkCanCreateCGFontWithLOGFONT();
-#else
-    bool canCreateCGFontWithLOGFONT = true;
-#endif
     LONG weight = adjustedGDIFontWeight(toGDIFontWeight(fontDescription.weight()), family);
     HFONT hfont = createGDIFont(family, weight, fontDescription.italic(),
-                                fontDescription.computedPixelSize() * (useGDI ? 1 : 32), useGDI && canCreateCGFontWithLOGFONT);
+                                fontDescription.computedPixelSize() * (useGDI ? 1 : 32), useGDI);
 
     if (!hfont)
         return 0;
diff --git a/WebCore/platform/graphics/win/FontCustomPlatformData.cpp b/WebCore/platform/graphics/win/FontCustomPlatformData.cpp
index b2d1b32..e9f83ab 100644
--- a/WebCore/platform/graphics/win/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/win/FontCustomPlatformData.cpp
@@ -48,7 +48,6 @@ SOFT_LINK(T2embed, TTDeleteEmbeddedFont, LONG, __stdcall, (HANDLE hFontReference
 
 FontCustomPlatformData::~FontCustomPlatformData()
 {
-    CGFontRelease(m_cgFont);
     if (m_fontReference) {
         if (m_name.isNull()) {
             ASSERT(T2embedLibrary());
@@ -61,7 +60,6 @@ FontCustomPlatformData::~FontCustomPlatformData()
 
 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode renderingMode)
 {
-    ASSERT(wkCanCreateCGFontWithLOGFONT() || m_cgFont);
     ASSERT(m_fontReference);
     ASSERT(T2embedLibrary());
 
@@ -88,35 +86,8 @@ FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, b
 
     HFONT hfont = CreateFontIndirect(&logFont);
 
-    if (wkCanCreateCGFontWithLOGFONT()) {
-        RetainPtr<CGFontRef> cgFont(AdoptCF, CGFontCreateWithPlatformFont(&logFont));
-        return FontPlatformData(hfont, cgFont.get(), size, bold, italic, renderingMode == AlternateRenderingMode);
-    }
-
-    wkSetFontPlatformInfo(m_cgFont, &logFont, free);
-    return FontPlatformData(hfont, m_cgFont, size, bold, italic, renderingMode == AlternateRenderingMode);
-}
-
-const void* getData(void* info)
-{
-    SharedBuffer* buffer = static_cast<SharedBuffer*>(info);
-    buffer->ref();
-    return (void*)buffer->data();
-}
-
-void releaseData(void* info, const void* data)
-{
-    static_cast<SharedBuffer*>(info)->deref();
-}
-
-size_t getBytesWithOffset(void *info, void* buffer, size_t offset, size_t count)
-{
-    SharedBuffer* sharedBuffer = static_cast<SharedBuffer*>(info);
-    size_t availBytes = count;
-    if (offset + count > sharedBuffer->size())
-        availBytes -= (offset + count) - sharedBuffer->size();
-    memcpy(buffer, sharedBuffer->data() + offset, availBytes);
-    return availBytes;
+    RetainPtr<CGFontRef> cgFont(AdoptCF, CGFontCreateWithPlatformFont(&logFont));
+    return FontPlatformData(hfont, cgFont.get(), size, bold, italic, renderingMode == AlternateRenderingMode);
 }
 
 // Streams the concatenation of a header and font data.
@@ -196,16 +167,6 @@ FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
     ASSERT_ARG(buffer, buffer);
     ASSERT(T2embedLibrary());
 
-    RetainPtr<CGFontRef> cgFont;
-    if (!wkCanCreateCGFontWithLOGFONT()) {
-        // Get CG to create the font.
-        CGDataProviderDirectAccessCallbacks callbacks = { &getData, &releaseData, &getBytesWithOffset, NULL };
-        RetainPtr<CGDataProviderRef> dataProvider(AdoptCF, CGDataProviderCreateDirectAccess(buffer, buffer->size(), &callbacks));
-        cgFont.adoptCF(CGFontCreateWithDataProvider(dataProvider.get()));
-        if (!cgFont)
-            return 0;
-    }
-
     // Introduce the font to GDI. AddFontMemResourceEx cannot be used, because it will pollute the process's
     // font namespace (Windows has no API for creating an HFONT from data without exposing the font to the
     // entire process first). TTLoadEmbeddedFont lets us override the font family name, so using a unique name
@@ -236,7 +197,7 @@ FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer)
             return 0;
     }
 
-    return new FontCustomPlatformData(cgFont.releaseRef(), fontReference, fontName);
+    return new FontCustomPlatformData(fontReference, fontName);
 }
 
 }
diff --git a/WebCore/platform/graphics/win/FontCustomPlatformData.h b/WebCore/platform/graphics/win/FontCustomPlatformData.h
index 34a9851..f75f12a 100644
--- a/WebCore/platform/graphics/win/FontCustomPlatformData.h
+++ b/WebCore/platform/graphics/win/FontCustomPlatformData.h
@@ -33,9 +33,8 @@ class FontPlatformData;
 class SharedBuffer;
 
 struct FontCustomPlatformData : Noncopyable {
-    FontCustomPlatformData(CGFontRef cgFont, HANDLE fontReference, const String& name)
-        : m_cgFont(cgFont)
-        , m_fontReference(fontReference)
+    FontCustomPlatformData(HANDLE fontReference, const String& name)
+        : m_fontReference(fontReference)
         , m_name(name)
     {
     }
@@ -44,7 +43,6 @@ struct FontCustomPlatformData : Noncopyable {
 
     FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode);
 
-    CGFontRef m_cgFont;
     HANDLE m_fontReference;
     String m_name;
 };
diff --git a/WebCore/platform/graphics/win/FontDatabase.cpp b/WebCore/platform/graphics/win/FontDatabase.cpp
deleted file mode 100644
index 22ad4a6..0000000
--- a/WebCore/platform/graphics/win/FontDatabase.cpp
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * Copyright (C) 2007, 2009 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "FontDatabase.h"
-
-#include "CString.h"
-#include "FileSystem.h"
-#include "PlatformString.h"
-#include <WebKitSystemInterface/WebKitSystemInterface.h>
-#include <shlobj.h>
-#include <wtf/RetainPtr.h>
-
-namespace WebCore {
-
-static String systemFontsDirectory()
-{
-    static bool initialized;
-    static String directory;
-
-    if (!initialized) {
-        initialized = true;
-
-        Vector<UChar> buffer(MAX_PATH);
-        if (FAILED(SHGetFolderPath(0, CSIDL_FONTS | CSIDL_FLAG_CREATE, 0, 0, buffer.data())))
-            return directory;
-        buffer.resize(wcslen(buffer.data()));
-
-        directory = String::adopt(buffer);
-    }
-
-    return directory;
-}
-
-static String fontsPlistPath()
-{
-    static String path = pathByAppendingComponent(localUserSpecificStorageDirectory(), "FontsList.plist");
-    return path;
-}
-
-static bool systemHasFontsNewerThanFontsPlist()
-{
-    WIN32_FILE_ATTRIBUTE_DATA plistAttributes = {0};
-    if (!GetFileAttributesEx(fontsPlistPath().charactersWithNullTermination(), GetFileExInfoStandard, &plistAttributes))
-        return true;
-
-    WIN32_FILE_ATTRIBUTE_DATA fontsDirectoryAttributes = {0};
-    if (!GetFileAttributesEx(systemFontsDirectory().charactersWithNullTermination(), GetFileExInfoStandard, &fontsDirectoryAttributes))
-        return true;
-
-    return CompareFileTime(&plistAttributes.ftLastWriteTime, &fontsDirectoryAttributes.ftLastWriteTime) < 0;
-}
-
-static RetainPtr<CFPropertyListRef> readFontPlist()
-{
-    CString plistPath = fontsPlistPath().utf8();
-
-    RetainPtr<CFURLRef> url(AdoptCF, CFURLCreateFromFileSystemRepresentation(0, reinterpret_cast<const UInt8*>(plistPath.data()), plistPath.length(), false));
-    if (!url)
-        return 0;
-
-    RetainPtr<CFReadStreamRef> stream(AdoptCF, CFReadStreamCreateWithFile(0, url.get()));
-    if (!stream)
-        return 0;
-
-    if (!CFReadStreamOpen(stream.get()))
-        return 0;
-
-    CFPropertyListFormat format = kCFPropertyListBinaryFormat_v1_0 | kCFPropertyListXMLFormat_v1_0;
-    RetainPtr<CFPropertyListRef> plist(AdoptCF, CFPropertyListCreateFromStream(0, stream.get(), 0, kCFPropertyListMutableContainersAndLeaves, &format, 0));
-
-    CFReadStreamClose(stream.get());
-
-    return plist;
-}
-
-static bool populateFontDatabaseFromPlist(CFPropertyListRef plist)
-{
-    if (!plist)
-        return false;
-
-    wkAddFontsFromPlist(plist);
-    return true;
-}
-
-static bool populateFontDatabaseFromFileSystem()
-{
-    RetainPtr<CFStringRef> directory(AdoptCF, systemFontsDirectory().createCFString());
-    if (!directory)
-        return false;
-
-    wkAddFontsInDirectory(directory.get());
-    return true;
-}
-
-static CFStringRef fontFilenamesFromRegistryKey()
-{
-    static CFStringRef key = CFSTR("WebKitFontFilenamesFromRegistry");
-    return key;
-}
-
-static void writeFontDatabaseToPlist(CFPropertyListRef cgFontDBPropertyList, CFPropertyListRef filenamesFromRegistry)
-{
-    if (!cgFontDBPropertyList)
-        return;
-
-    RetainPtr<CFDataRef> data;
-
-    if (!filenamesFromRegistry || CFGetTypeID(cgFontDBPropertyList) != CFDictionaryGetTypeID())
-        data.adoptCF(CFPropertyListCreateXMLData(kCFAllocatorDefault, cgFontDBPropertyList));
-    else {
-        RetainPtr<CFMutableDictionaryRef> dictionary(AdoptCF, CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 2, static_cast<CFDictionaryRef>(cgFontDBPropertyList)));
-        CFDictionarySetValue(dictionary.get(), fontFilenamesFromRegistryKey(), filenamesFromRegistry);
-        data.adoptCF(CFPropertyListCreateXMLData(kCFAllocatorDefault, dictionary.get()));
-    }
-
-    if (!data)
-        return;
-
-    safeCreateFile(fontsPlistPath(), data.get());
-}
-
-static RetainPtr<CFArrayRef> fontFilenamesFromRegistry()
-{
-    RetainPtr<CFMutableArrayRef> filenames(AdoptCF, CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks));
-
-    HKEY key;
-    if (FAILED(RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"), 0, KEY_READ, &key)))
-        return filenames;
-
-    DWORD valueCount;
-    DWORD maxNameLength;
-    DWORD maxValueLength;
-    if (FAILED(RegQueryInfoKey(key, 0, 0, 0, 0, 0, 0, &valueCount, &maxNameLength, &maxValueLength, 0, 0))) {
-        RegCloseKey(key);
-        return filenames;
-    }
-
-    Vector<TCHAR> name(maxNameLength + 1);
-    Vector<BYTE> value(maxValueLength + 1);
-
-    for (size_t i = 0; i < valueCount; ++i) {
-        DWORD nameLength = name.size();
-        DWORD valueLength = value.size();
-        DWORD type;
-        if (FAILED(RegEnumValue(key, i, name.data(), &nameLength, 0, &type, value.data(), &valueLength)))
-            continue;
-        if (type != REG_SZ)
-            continue;
-
-        RetainPtr<CFDataRef> filename(AdoptCF, CFDataCreate(kCFAllocatorDefault, value.data(), valueLength));
-        CFArrayAppendValue(filenames.get(), filename.get());
-    }
-
-    RegCloseKey(key);
-    return filenames;
-}
-
-void populateFontDatabase()
-{
-    static bool initialized;
-    if (initialized)
-        return;
-    initialized = true;
-
-    if (wkCanCreateCGFontWithLOGFONT())
-        return;
-
-    RetainPtr<CFPropertyListRef> propertyList = readFontPlist();
-    RetainPtr<CFArrayRef> lastFilenamesFromRegistry;
-    if (propertyList && CFGetTypeID(propertyList.get()) == CFDictionaryGetTypeID()) {
-        CFDictionaryRef dictionary = static_cast<CFDictionaryRef>(propertyList.get());
-        CFArrayRef array = static_cast<CFArrayRef>(CFDictionaryGetValue(dictionary, fontFilenamesFromRegistryKey()));
-        if (array && CFGetTypeID(array) == CFArrayGetTypeID())
-            lastFilenamesFromRegistry = array;
-    }
-    RetainPtr<CFArrayRef> currentFilenamesFromRegistry = fontFilenamesFromRegistry();
-    bool registryChanged = !lastFilenamesFromRegistry || !CFEqual(lastFilenamesFromRegistry.get(), currentFilenamesFromRegistry.get());
-
-    if (!registryChanged && !systemHasFontsNewerThanFontsPlist()) {
-        if (populateFontDatabaseFromPlist(propertyList.get()))
-            return;
-    }
-
-    if (populateFontDatabaseFromFileSystem()) {
-        wkAddFontsFromRegistry();
-        RetainPtr<CFPropertyListRef> cgFontDBPropertyList(AdoptCF, wkCreateFontsPlist());
-        writeFontDatabaseToPlist(cgFontDBPropertyList.get(), currentFilenamesFromRegistry.get());
-    }
-}
-
-} // namespace WebCore
diff --git a/WebCore/platform/graphics/win/FontDatabase.h b/WebCore/platform/graphics/win/FontDatabase.h
deleted file mode 100644
index 4f76c9e..0000000
--- a/WebCore/platform/graphics/win/FontDatabase.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef FontDatabase_h
-#define FontDatabase_h
-
-namespace WebCore {
-
-    void populateFontDatabase();
-
-} // namespace WebCore
-
-#endif // !defined(FontDatabase_h)
diff --git a/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp b/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp
index d605cf9..ca94a27 100644
--- a/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp
+++ b/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp
@@ -109,29 +109,9 @@ static CFStringRef getPostScriptName(CFStringRef faceName, HDC dc)
 
 void FontPlatformData::platformDataInit(HFONT font, float size, HDC hdc, WCHAR* faceName)
 {
-    if (wkCanCreateCGFontWithLOGFONT()) {
-        LOGFONT logfont;
-        GetObject(font, sizeof(logfont), &logfont);
-        m_cgFont.adoptCF(CGFontCreateWithPlatformFont(&logfont));
-        return;
-    }
-
-    // Try the face name first.  Windows may end up localizing this name, and CG doesn't know about
-    // the localization.  If the create fails, we'll try the PostScript name.
-    RetainPtr<CFStringRef> fullName(AdoptCF, CFStringCreateWithCharacters(NULL, (const UniChar*)faceName, wcslen(faceName)));
-    m_cgFont.adoptCF(CGFontCreateWithFontName(fullName.get()));
-    if (!m_cgFont) {
-        CFStringRef postScriptName = getPostScriptName(fullName.get(), hdc);
-        if (postScriptName) {
-            m_cgFont.adoptCF(CGFontCreateWithFontName(postScriptName));
-            ASSERT(m_cgFont);
-        }
-    }
-    if (m_useGDI) {
-        LOGFONT* logfont = static_cast<LOGFONT*>(malloc(sizeof(LOGFONT)));
-        GetObject(font, sizeof(*logfont), logfont);
-        wkSetFontPlatformInfo(m_cgFont.get(), logfont, free);
-    }
+    LOGFONT logfont;
+    GetObject(font, sizeof(logfont), &logfont);
+    m_cgFont.adoptCF(CGFontCreateWithPlatformFont(&logfont));
 }
 
 FontPlatformData::FontPlatformData(HFONT hfont, CGFontRef font, float size, bool bold, bool oblique, bool useGDI)
diff --git a/WebCore/platform/win/TemporaryLinkStubs.cpp b/WebCore/platform/win/TemporaryLinkStubs.cpp
index 71eed00..d82f21c 100644
--- a/WebCore/platform/win/TemporaryLinkStubs.cpp
+++ b/WebCore/platform/win/TemporaryLinkStubs.cpp
@@ -33,7 +33,4 @@ namespace WebCore {
 // <keygen>
 String signedPublicKeyAndChallengeString(unsigned, const String&, const KURL&) { notImplemented(); return String(); }
 void getSupportedKeySizes(Vector<String>&) { notImplemented(); }
-#if PLATFORM(CAIRO)
-void populateFontDatabase() { /* Not needed for GDI fonts */ }
-#endif
 } // namespace WebCore
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index a04b5e7..b6a3203 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,16 @@
+2010-03-14  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Darin Adler.
+
+        WebKit part of removing support for legacy versions of Core Graphics
+
+        * WebKitClassFactory.cpp:
+        (WebKitClassFactory::WebKitClassFactory): Removed call to populateFontDatabase().
+        * WebKitGraphics.cpp:
+        (makeFont): Ditto.
+        * WebTextRenderer.cpp:
+        (WebTextRenderer::registerPrivateFont): Removed call to wkAddFontsAtPath().
+
 2010-03-12  Enrica Casucci  <enrica at apple.com>
 
         Fixed broken build on Windows.
diff --git a/WebKit/win/WebKitClassFactory.cpp b/WebKit/win/WebKitClassFactory.cpp
index d243588..a9f0125 100644
--- a/WebKit/win/WebKitClassFactory.cpp
+++ b/WebKit/win/WebKitClassFactory.cpp
@@ -58,7 +58,6 @@
 #include "WebWorkersPrivate.h"
 #pragma warning(push, 0)
 #include <JavaScriptCore/InitializeThreading.h>
-#include <WebCore/FontDatabase.h>
 #include <WebCore/SoftLinking.h>
 #pragma warning(pop)
 
@@ -87,7 +86,6 @@ WebKitClassFactory::WebKitClassFactory(CLSID targetClass)
 #endif
 
     JSC::initializeThreading();
-    WebCore::populateFontDatabase();
 
     gClassCount++;
     gClassNameCount.add("WebKitClassFactory");
diff --git a/WebKit/win/WebKitGraphics.cpp b/WebKit/win/WebKitGraphics.cpp
index 03fe903..d7123b4 100644
--- a/WebKit/win/WebKitGraphics.cpp
+++ b/WebKit/win/WebKitGraphics.cpp
@@ -34,7 +34,6 @@
 #pragma warning(push, 0)
 #include <WebCore/CharacterNames.h>
 #include <WebCore/Font.h>
-#include <WebCore/FontDatabase.h>
 #include <WebCore/FontDescription.h>
 #include <WebCore/FontSelector.h>
 #include <WebCore/GraphicsContext.h>
@@ -52,7 +51,6 @@ using namespace WebCore;
 static Font makeFont(const WebFontDescription& description)
 {
     AtomicString::init();
-    populateFontDatabase();
 
     String fontFamilyString(description.family, description.familyLength);
 
diff --git a/WebKit/win/WebTextRenderer.cpp b/WebKit/win/WebTextRenderer.cpp
index 7ff2ff3..6d6d9a3 100644
--- a/WebKit/win/WebTextRenderer.cpp
+++ b/WebKit/win/WebTextRenderer.cpp
@@ -31,12 +31,6 @@
 
 #include "WebKitDLL.h"
 
-#include <CoreFoundation/CFString.h>
-#if PLATFORM(CG)
-#include <WebKitSystemInterface/WebKitSystemInterface.h>
-#endif
-#include <wtf/RetainPtr.h>
-
 WebTextRenderer* WebTextRenderer::createInstance()
 {
     WebTextRenderer* instance = new WebTextRenderer;
@@ -91,9 +85,5 @@ HRESULT STDMETHODCALLTYPE WebTextRenderer::registerPrivateFont(
     if (!AddFontResourceEx(fontFilePath, FR_PRIVATE, 0))
         return E_FAIL;
 
-    RetainPtr<CFStringRef> string(AdoptCF, CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar*>(fontFilePath), static_cast<CFIndex>(wcslen(fontFilePath))));
-#if PLATFORM(CG)
-    wkAddFontsAtPath(string.get());
-#endif
     return S_OK;
 }
diff --git a/WebKitLibraries/ChangeLog b/WebKitLibraries/ChangeLog
index 9bcc7c2..053f302 100644
--- a/WebKitLibraries/ChangeLog
+++ b/WebKitLibraries/ChangeLog
@@ -1,3 +1,16 @@
+2010-03-14  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Darin Adler.
+
+        WebKitSystemInterface part of removing support for legacy versions of Core Graphics
+
+        * win/include/WebKitSystemInterface/WebKitSystemInterface.h: Removed
+        wkCanCreateCGFontWithLOGFONT(), wkSetFontPlatformInfo(), wkAddFontsInDirectory(),
+        wkAddFontsAtPath(), wkAddFontsFromRegistry(), wkAddFontsFromPlist(), and
+        wkCreateFontsPlist().
+        * win/lib/WebKitSystemInterface.lib: Updated.
+        * win/lib/WebKitSystemInterface_debug.lib: Updated.
+
 2010-03-08  Jian Li  <jianli at chromium.org>
 
         Reviewed by Dmitry Titov.
diff --git a/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h b/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
index 4534d6f..445b292 100644
--- a/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
+++ b/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
@@ -61,14 +61,7 @@ void wkRestoreFontSmoothingStyle(CGContextRef cg, uint32_t oldStyle);
 void wkSetCGContextFontRenderingStyle(CGContextRef, bool isSystemFont, bool isPrinterFont, bool usePlatformNativeGlyphs);
 void wkGetGlyphAdvances(CGFontRef, const CGAffineTransform&, bool isSystemFont, bool isPrinterFont, CGGlyph, CGSize& advance);
 void wkGetGlyphs(CGFontRef, const UChar[], CGGlyph[], size_t count);
-bool wkCanCreateCGFontWithLOGFONT();
-void wkSetFontPlatformInfo(CGFontRef, LOGFONT*, void(*)(void*));
 void wkSetUpFontCache(size_t s);
-void wkAddFontsInDirectory(CFStringRef);
-void wkAddFontsAtPath(CFStringRef);
-void wkAddFontsFromRegistry();
-void wkAddFontsFromPlist(CFPropertyListRef);
-CFPropertyListRef wkCreateFontsPlist();
 
 void wkSetPatternBaseCTM(CGContextRef, CGAffineTransform);
 void wkSetPatternPhaseInUserSpace(CGContextRef, CGPoint phasePoint);
diff --git a/WebKitLibraries/win/lib/WebKitSystemInterface.lib b/WebKitLibraries/win/lib/WebKitSystemInterface.lib
index ddcb692..e828307 100644
Binary files a/WebKitLibraries/win/lib/WebKitSystemInterface.lib and b/WebKitLibraries/win/lib/WebKitSystemInterface.lib differ
diff --git a/WebKitLibraries/win/lib/WebKitSystemInterface_debug.lib b/WebKitLibraries/win/lib/WebKitSystemInterface_debug.lib
index 965672f..22b9b57 100644
Binary files a/WebKitLibraries/win/lib/WebKitSystemInterface_debug.lib and b/WebKitLibraries/win/lib/WebKitSystemInterface_debug.lib differ

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list