Changeset 55975 in webkit


Ignore:
Timestamp:
Mar 14, 2010 2:44:07 PM (14 years ago)
Author:
mitz@apple.com
Message:

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.
Location:
trunk
Files:
2 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r55974 r55975  
     12010-03-14  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        WebCore part of removing support for legacy versions of Core Graphics
     6
     7        * WebCore.vcproj/WebCore.vcproj: Removed FontDatabase.{cpp,h}
     8        * platform/graphics/win/FontCGWin.cpp:
     9        (WebCore::Font::drawGlyphs): Removed call to wkCanCreateCGFontWithLOGFONT(),
     10        as it is now always true.
     11        * platform/graphics/win/FontCacheWin.cpp:
     12        (WebCore::FontCache::createFontPlatformData): Ditto.
     13        * platform/graphics/win/FontCustomPlatformData.cpp:
     14        (WebCore::FontCustomPlatformData::~FontCustomPlatformData): Updated for
     15        the removal of m_cgFont.
     16        (WebCore::FontCustomPlatformData::fontPlatformData): Removed call to
     17        wkCanCreateCGFontWithLOGFONT(), as it is now always true.
     18        (WebCore::createFontCustomPlatformData): Ditto. Also updated for change to
     19        the FontCustomPlatformData constructor.
     20        * platform/graphics/win/FontCustomPlatformData.h: Removed m_cgFont member.
     21        (WebCore::FontCustomPlatformData::FontCustomPlatformData): Removed cgFont
     22        parameter.
     23        * platform/graphics/win/FontDatabase.cpp: Removed.
     24        * platform/graphics/win/FontDatabase.h: Removed.
     25        * platform/graphics/win/FontPlatformDataCGWin.cpp:
     26        (WebCore::FontPlatformData::platformDataInit): Removed call to
     27        wkCanCreateCGFontWithLOGFONT(), as it is now always true.
     28        * platform/win/TemporaryLinkStubs.cpp:
     29        (WebCore::populateFontDatabase): Removed stub.
     30
    1312010-03-14  Jessie Berlin  <jberlin@webkit.org>
    232
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r55928 r55975  
    2288422884                                        </File>
    2288522885                                        <File
    22886                                                 RelativePath="..\platform\graphics\win\FontDatabase.cpp"
    22887                                                 >
    22888                                                 <FileConfiguration
    22889                                                         Name="Debug_Cairo|Win32"
    22890                                                         ExcludedFromBuild="true"
    22891                                                         >
    22892                                                         <Tool
    22893                                                                 Name="VCCLCompilerTool"
    22894                                                         />
    22895                                                 </FileConfiguration>
    22896                                                 <FileConfiguration
    22897                                                         Name="Release_Cairo|Win32"
    22898                                                         ExcludedFromBuild="true"
    22899                                                         >
    22900                                                         <Tool
    22901                                                                 Name="VCCLCompilerTool"
    22902                                                         />
    22903                                                 </FileConfiguration>
    22904                                         </File>
    22905                                         <File
    22906                                                 RelativePath="..\platform\graphics\win\FontDatabase.h"
    22907                                                 >
    22908                                         </File>
    22909                                         <File
    2291022886                                                RelativePath="..\platform\graphics\win\FontPlatformData.h"
    2291122887                                                >
  • trunk/WebCore/platform/graphics/win/FontCGWin.cpp

    r54503 r55975  
    322322    }
    323323
    324     if (font->platformData().useGDI()) {
    325         static bool canCreateCGFontWithLOGFONT = wkCanCreateCGFontWithLOGFONT();
    326         if (!shouldUseFontSmoothing || !canCreateCGFontWithLOGFONT && (graphicsContext->textDrawingMode() & cTextStroke)) {
    327             drawGDIGlyphs(graphicsContext, font, glyphBuffer, from, numGlyphs, point);
    328             return;
    329         }
     324    if (font->platformData().useGDI() && !shouldUseFontSmoothing) {
     325        drawGDIGlyphs(graphicsContext, font, glyphBuffer, from, numGlyphs, point);
     326        return;
    330327    }
    331328
  • trunk/WebCore/platform/graphics/win/FontCacheWin.cpp

    r54602 r55975  
    518518    // FIXME: We will eventually want subpixel precision for GDI mode, but the scaled rendering doesn't
    519519    // look as nice. That may be solvable though.
    520 #if PLATFORM(CG)
    521     bool canCreateCGFontWithLOGFONT = wkCanCreateCGFontWithLOGFONT();
    522 #else
    523     bool canCreateCGFontWithLOGFONT = true;
    524 #endif
    525520    LONG weight = adjustedGDIFontWeight(toGDIFontWeight(fontDescription.weight()), family);
    526521    HFONT hfont = createGDIFont(family, weight, fontDescription.italic(),
    527                                 fontDescription.computedPixelSize() * (useGDI ? 1 : 32), useGDI && canCreateCGFontWithLOGFONT);
     522                                fontDescription.computedPixelSize() * (useGDI ? 1 : 32), useGDI);
    528523
    529524    if (!hfont)
  • trunk/WebCore/platform/graphics/win/FontCustomPlatformData.cpp

    r52141 r55975  
    4949FontCustomPlatformData::~FontCustomPlatformData()
    5050{
    51     CGFontRelease(m_cgFont);
    5251    if (m_fontReference) {
    5352        if (m_name.isNull()) {
     
    6261FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode renderingMode)
    6362{
    64     ASSERT(wkCanCreateCGFontWithLOGFONT() || m_cgFont);
    6563    ASSERT(m_fontReference);
    6664    ASSERT(T2embedLibrary());
     
    8987    HFONT hfont = CreateFontIndirect(&logFont);
    9088
    91     if (wkCanCreateCGFontWithLOGFONT()) {
    92         RetainPtr<CGFontRef> cgFont(AdoptCF, CGFontCreateWithPlatformFont(&logFont));
    93         return FontPlatformData(hfont, cgFont.get(), size, bold, italic, renderingMode == AlternateRenderingMode);
    94     }
    95 
    96     wkSetFontPlatformInfo(m_cgFont, &logFont, free);
    97     return FontPlatformData(hfont, m_cgFont, size, bold, italic, renderingMode == AlternateRenderingMode);
    98 }
    99 
    100 const void* getData(void* info)
    101 {
    102     SharedBuffer* buffer = static_cast<SharedBuffer*>(info);
    103     buffer->ref();
    104     return (void*)buffer->data();
    105 }
    106 
    107 void releaseData(void* info, const void* data)
    108 {
    109     static_cast<SharedBuffer*>(info)->deref();
    110 }
    111 
    112 size_t getBytesWithOffset(void *info, void* buffer, size_t offset, size_t count)
    113 {
    114     SharedBuffer* sharedBuffer = static_cast<SharedBuffer*>(info);
    115     size_t availBytes = count;
    116     if (offset + count > sharedBuffer->size())
    117         availBytes -= (offset + count) - sharedBuffer->size();
    118     memcpy(buffer, sharedBuffer->data() + offset, availBytes);
    119     return availBytes;
     89    RetainPtr<CGFontRef> cgFont(AdoptCF, CGFontCreateWithPlatformFont(&logFont));
     90    return FontPlatformData(hfont, cgFont.get(), size, bold, italic, renderingMode == AlternateRenderingMode);
    12091}
    12192
     
    197168    ASSERT(T2embedLibrary());
    198169
    199     RetainPtr<CGFontRef> cgFont;
    200     if (!wkCanCreateCGFontWithLOGFONT()) {
    201         // Get CG to create the font.
    202         CGDataProviderDirectAccessCallbacks callbacks = { &getData, &releaseData, &getBytesWithOffset, NULL };
    203         RetainPtr<CGDataProviderRef> dataProvider(AdoptCF, CGDataProviderCreateDirectAccess(buffer, buffer->size(), &callbacks));
    204         cgFont.adoptCF(CGFontCreateWithDataProvider(dataProvider.get()));
    205         if (!cgFont)
    206             return 0;
    207     }
    208 
    209170    // Introduce the font to GDI. AddFontMemResourceEx cannot be used, because it will pollute the process's
    210171    // font namespace (Windows has no API for creating an HFONT from data without exposing the font to the
     
    237198    }
    238199
    239     return new FontCustomPlatformData(cgFont.releaseRef(), fontReference, fontName);
    240 }
    241 
    242 }
     200    return new FontCustomPlatformData(fontReference, fontName);
     201}
     202
     203}
  • trunk/WebCore/platform/graphics/win/FontCustomPlatformData.h

    r37139 r55975  
    3434
    3535struct FontCustomPlatformData : Noncopyable {
    36     FontCustomPlatformData(CGFontRef cgFont, HANDLE fontReference, const String& name)
    37         : m_cgFont(cgFont)
    38         , m_fontReference(fontReference)
     36    FontCustomPlatformData(HANDLE fontReference, const String& name)
     37        : m_fontReference(fontReference)
    3938        , m_name(name)
    4039    {
     
    4544    FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode);
    4645
    47     CGFontRef m_cgFont;
    4846    HANDLE m_fontReference;
    4947    String m_name;
  • trunk/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp

    r52141 r55975  
    110110void FontPlatformData::platformDataInit(HFONT font, float size, HDC hdc, WCHAR* faceName)
    111111{
    112     if (wkCanCreateCGFontWithLOGFONT()) {
    113         LOGFONT logfont;
    114         GetObject(font, sizeof(logfont), &logfont);
    115         m_cgFont.adoptCF(CGFontCreateWithPlatformFont(&logfont));
    116         return;
    117     }
    118 
    119     // Try the face name first.  Windows may end up localizing this name, and CG doesn't know about
    120     // the localization.  If the create fails, we'll try the PostScript name.
    121     RetainPtr<CFStringRef> fullName(AdoptCF, CFStringCreateWithCharacters(NULL, (const UniChar*)faceName, wcslen(faceName)));
    122     m_cgFont.adoptCF(CGFontCreateWithFontName(fullName.get()));
    123     if (!m_cgFont) {
    124         CFStringRef postScriptName = getPostScriptName(fullName.get(), hdc);
    125         if (postScriptName) {
    126             m_cgFont.adoptCF(CGFontCreateWithFontName(postScriptName));
    127             ASSERT(m_cgFont);
    128         }
    129     }
    130     if (m_useGDI) {
    131         LOGFONT* logfont = static_cast<LOGFONT*>(malloc(sizeof(LOGFONT)));
    132         GetObject(font, sizeof(*logfont), logfont);
    133         wkSetFontPlatformInfo(m_cgFont.get(), logfont, free);
    134     }
     112    LOGFONT logfont;
     113    GetObject(font, sizeof(logfont), &logfont);
     114    m_cgFont.adoptCF(CGFontCreateWithPlatformFont(&logfont));
    135115}
    136116
  • trunk/WebCore/platform/win/TemporaryLinkStubs.cpp

    r38906 r55975  
    3434String signedPublicKeyAndChallengeString(unsigned, const String&, const KURL&) { notImplemented(); return String(); }
    3535void getSupportedKeySizes(Vector<String>&) { notImplemented(); }
    36 #if PLATFORM(CAIRO)
    37 void populateFontDatabase() { /* Not needed for GDI fonts */ }
    38 #endif
    3936} // namespace WebCore
  • trunk/WebKit/win/ChangeLog

    r55947 r55975  
     12010-03-14  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        WebKit part of removing support for legacy versions of Core Graphics
     6
     7        * WebKitClassFactory.cpp:
     8        (WebKitClassFactory::WebKitClassFactory): Removed call to populateFontDatabase().
     9        * WebKitGraphics.cpp:
     10        (makeFont): Ditto.
     11        * WebTextRenderer.cpp:
     12        (WebTextRenderer::registerPrivateFont): Removed call to wkAddFontsAtPath().
     13
    1142010-03-12  Enrica Casucci  <enrica@apple.com>
    215
  • trunk/WebKit/win/WebKitClassFactory.cpp

    r53960 r55975  
    5959#pragma warning(push, 0)
    6060#include <JavaScriptCore/InitializeThreading.h>
    61 #include <WebCore/FontDatabase.h>
    6261#include <WebCore/SoftLinking.h>
    6362#pragma warning(pop)
     
    8887
    8988    JSC::initializeThreading();
    90     WebCore::populateFontDatabase();
    9189
    9290    gClassCount++;
  • trunk/WebKit/win/WebKitGraphics.cpp

    r55112 r55975  
    3535#include <WebCore/CharacterNames.h>
    3636#include <WebCore/Font.h>
    37 #include <WebCore/FontDatabase.h>
    3837#include <WebCore/FontDescription.h>
    3938#include <WebCore/FontSelector.h>
     
    5352{
    5453    AtomicString::init();
    55     populateFontDatabase();
    5654
    5755    String fontFamilyString(description.family, description.familyLength);
  • trunk/WebKit/win/WebTextRenderer.cpp

    r40203 r55975  
    3131
    3232#include "WebKitDLL.h"
    33 
    34 #include <CoreFoundation/CFString.h>
    35 #if PLATFORM(CG)
    36 #include <WebKitSystemInterface/WebKitSystemInterface.h>
    37 #endif
    38 #include <wtf/RetainPtr.h>
    3933
    4034WebTextRenderer* WebTextRenderer::createInstance()
     
    9286        return E_FAIL;
    9387
    94     RetainPtr<CFStringRef> string(AdoptCF, CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar*>(fontFilePath), static_cast<CFIndex>(wcslen(fontFilePath))));
    95 #if PLATFORM(CG)
    96     wkAddFontsAtPath(string.get());
    97 #endif
    9888    return S_OK;
    9989}
  • trunk/WebKitLibraries/ChangeLog

    r55670 r55975  
     12010-03-14  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        WebKitSystemInterface part of removing support for legacy versions of Core Graphics
     6
     7        * win/include/WebKitSystemInterface/WebKitSystemInterface.h: Removed
     8        wkCanCreateCGFontWithLOGFONT(), wkSetFontPlatformInfo(), wkAddFontsInDirectory(),
     9        wkAddFontsAtPath(), wkAddFontsFromRegistry(), wkAddFontsFromPlist(), and
     10        wkCreateFontsPlist().
     11        * win/lib/WebKitSystemInterface.lib: Updated.
     12        * win/lib/WebKitSystemInterface_debug.lib: Updated.
     13
    1142010-03-08  Jian Li  <jianli@chromium.org>
    215
  • trunk/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h

    r54943 r55975  
    6262void wkGetGlyphAdvances(CGFontRef, const CGAffineTransform&, bool isSystemFont, bool isPrinterFont, CGGlyph, CGSize& advance);
    6363void wkGetGlyphs(CGFontRef, const UChar[], CGGlyph[], size_t count);
    64 bool wkCanCreateCGFontWithLOGFONT();
    65 void wkSetFontPlatformInfo(CGFontRef, LOGFONT*, void(*)(void*));
    6664void wkSetUpFontCache(size_t s);
    67 void wkAddFontsInDirectory(CFStringRef);
    68 void wkAddFontsAtPath(CFStringRef);
    69 void wkAddFontsFromRegistry();
    70 void wkAddFontsFromPlist(CFPropertyListRef);
    71 CFPropertyListRef wkCreateFontsPlist();
    7265
    7366void wkSetPatternBaseCTM(CGContextRef, CGAffineTransform);
Note: See TracChangeset for help on using the changeset viewer.