Changeset 55975 in webkit
- Timestamp:
- Mar 14, 2010 2:44:07 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r55974 r55975 1 2010-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 1 31 2010-03-14 Jessie Berlin <jberlin@webkit.org> 2 32 -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r55928 r55975 22884 22884 </File> 22885 22885 <File 22886 RelativePath="..\platform\graphics\win\FontDatabase.cpp"22887 >22888 <FileConfiguration22889 Name="Debug_Cairo|Win32"22890 ExcludedFromBuild="true"22891 >22892 <Tool22893 Name="VCCLCompilerTool"22894 />22895 </FileConfiguration>22896 <FileConfiguration22897 Name="Release_Cairo|Win32"22898 ExcludedFromBuild="true"22899 >22900 <Tool22901 Name="VCCLCompilerTool"22902 />22903 </FileConfiguration>22904 </File>22905 <File22906 RelativePath="..\platform\graphics\win\FontDatabase.h"22907 >22908 </File>22909 <File22910 22886 RelativePath="..\platform\graphics\win\FontPlatformData.h" 22911 22887 > -
trunk/WebCore/platform/graphics/win/FontCGWin.cpp
r54503 r55975 322 322 } 323 323 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; 330 327 } 331 328 -
trunk/WebCore/platform/graphics/win/FontCacheWin.cpp
r54602 r55975 518 518 // FIXME: We will eventually want subpixel precision for GDI mode, but the scaled rendering doesn't 519 519 // look as nice. That may be solvable though. 520 #if PLATFORM(CG)521 bool canCreateCGFontWithLOGFONT = wkCanCreateCGFontWithLOGFONT();522 #else523 bool canCreateCGFontWithLOGFONT = true;524 #endif525 520 LONG weight = adjustedGDIFontWeight(toGDIFontWeight(fontDescription.weight()), family); 526 521 HFONT hfont = createGDIFont(family, weight, fontDescription.italic(), 527 fontDescription.computedPixelSize() * (useGDI ? 1 : 32), useGDI && canCreateCGFontWithLOGFONT);522 fontDescription.computedPixelSize() * (useGDI ? 1 : 32), useGDI); 528 523 529 524 if (!hfont) -
trunk/WebCore/platform/graphics/win/FontCustomPlatformData.cpp
r52141 r55975 49 49 FontCustomPlatformData::~FontCustomPlatformData() 50 50 { 51 CGFontRelease(m_cgFont);52 51 if (m_fontReference) { 53 52 if (m_name.isNull()) { … … 62 61 FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode renderingMode) 63 62 { 64 ASSERT(wkCanCreateCGFontWithLOGFONT() || m_cgFont);65 63 ASSERT(m_fontReference); 66 64 ASSERT(T2embedLibrary()); … … 89 87 HFONT hfont = CreateFontIndirect(&logFont); 90 88 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); 120 91 } 121 92 … … 197 168 ASSERT(T2embedLibrary()); 198 169 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 209 170 // Introduce the font to GDI. AddFontMemResourceEx cannot be used, because it will pollute the process's 210 171 // font namespace (Windows has no API for creating an HFONT from data without exposing the font to the … … 237 198 } 238 199 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 34 34 35 35 struct 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) 39 38 , m_name(name) 40 39 { … … 45 44 FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode); 46 45 47 CGFontRef m_cgFont;48 46 HANDLE m_fontReference; 49 47 String m_name; -
trunk/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp
r52141 r55975 110 110 void FontPlatformData::platformDataInit(HFONT font, float size, HDC hdc, WCHAR* faceName) 111 111 { 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)); 135 115 } 136 116 -
trunk/WebCore/platform/win/TemporaryLinkStubs.cpp
r38906 r55975 34 34 String signedPublicKeyAndChallengeString(unsigned, const String&, const KURL&) { notImplemented(); return String(); } 35 35 void getSupportedKeySizes(Vector<String>&) { notImplemented(); } 36 #if PLATFORM(CAIRO)37 void populateFontDatabase() { /* Not needed for GDI fonts */ }38 #endif39 36 } // namespace WebCore -
trunk/WebKit/win/ChangeLog
r55947 r55975 1 2010-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 1 14 2010-03-12 Enrica Casucci <enrica@apple.com> 2 15 -
trunk/WebKit/win/WebKitClassFactory.cpp
r53960 r55975 59 59 #pragma warning(push, 0) 60 60 #include <JavaScriptCore/InitializeThreading.h> 61 #include <WebCore/FontDatabase.h>62 61 #include <WebCore/SoftLinking.h> 63 62 #pragma warning(pop) … … 88 87 89 88 JSC::initializeThreading(); 90 WebCore::populateFontDatabase();91 89 92 90 gClassCount++; -
trunk/WebKit/win/WebKitGraphics.cpp
r55112 r55975 35 35 #include <WebCore/CharacterNames.h> 36 36 #include <WebCore/Font.h> 37 #include <WebCore/FontDatabase.h>38 37 #include <WebCore/FontDescription.h> 39 38 #include <WebCore/FontSelector.h> … … 53 52 { 54 53 AtomicString::init(); 55 populateFontDatabase();56 54 57 55 String fontFamilyString(description.family, description.familyLength); -
trunk/WebKit/win/WebTextRenderer.cpp
r40203 r55975 31 31 32 32 #include "WebKitDLL.h" 33 34 #include <CoreFoundation/CFString.h>35 #if PLATFORM(CG)36 #include <WebKitSystemInterface/WebKitSystemInterface.h>37 #endif38 #include <wtf/RetainPtr.h>39 33 40 34 WebTextRenderer* WebTextRenderer::createInstance() … … 92 86 return E_FAIL; 93 87 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 #endif98 88 return S_OK; 99 89 } -
trunk/WebKitLibraries/ChangeLog
r55670 r55975 1 2010-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 1 14 2010-03-08 Jian Li <jianli@chromium.org> 2 15 -
trunk/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
r54943 r55975 62 62 void wkGetGlyphAdvances(CGFontRef, const CGAffineTransform&, bool isSystemFont, bool isPrinterFont, CGGlyph, CGSize& advance); 63 63 void wkGetGlyphs(CGFontRef, const UChar[], CGGlyph[], size_t count); 64 bool wkCanCreateCGFontWithLOGFONT();65 void wkSetFontPlatformInfo(CGFontRef, LOGFONT*, void(*)(void*));66 64 void wkSetUpFontCache(size_t s); 67 void wkAddFontsInDirectory(CFStringRef);68 void wkAddFontsAtPath(CFStringRef);69 void wkAddFontsFromRegistry();70 void wkAddFontsFromPlist(CFPropertyListRef);71 CFPropertyListRef wkCreateFontsPlist();72 65 73 66 void wkSetPatternBaseCTM(CGContextRef, CGAffineTransform);
Note: See TracChangeset
for help on using the changeset viewer.