Changeset 39736 in webkit
- Timestamp:
- Jan 8, 2009 7:45:20 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r39734 r39736 1 2009-01-08 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Adam Roben. 4 5 - use native glyph support in Core Graphics when available 6 7 * platform/graphics/win/FontCGWin.cpp: 8 (WebCore::Font::drawGlyphs): Changed to use drawGDIGlyphs() only if 9 native glyph support is not available or stroking is required. Changed 10 to pass the font's useGDI() flag to wkSetCGContextFontRenderingStyle to 11 request the use of native glyphs. 12 * platform/graphics/win/FontCustomPlatformData.cpp: 13 (WebCore::FontCustomPlatformData::fontPlatformData): Added a call to 14 wkSetFontPlatformInfo to attach the LOGFONT to the CGFont. 15 * platform/graphics/win/FontPlatformDataCGWin.cpp: 16 (WebCore::FontPlatformData::platformDataInit): Ditto. 17 1 18 2009-01-08 Peter Kasting <pkasting@google.com> 2 19 -
trunk/WebCore/platform/graphics/win/FontCGWin.cpp
r39635 r39736 1 1 /* 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 295 295 int from, int numGlyphs, const FloatPoint& point) const 296 296 { 297 if (font->m_font.useGDI()) {298 drawGDIGlyphs(graphicsContext, font, glyphBuffer, from, numGlyphs, point);299 return;300 }301 302 297 CGContextRef cgContext = graphicsContext->platformContext(); 298 299 if (font->platformData().useGDI()) { 300 static bool canUsePlatformNativeGlyphs = wkCanUsePlatformNativeGlyphs(); 301 if (!canUsePlatformNativeGlyphs || (graphicsContext->textDrawingMode() & cTextStroke)) { 302 drawGDIGlyphs(graphicsContext, font, glyphBuffer, from, numGlyphs, point); 303 return; 304 } 305 } 303 306 304 307 uint32_t oldFontSmoothingStyle = wkSetFontSmoothingStyle(cgContext, WebCoreShouldUseFontSmoothing()); … … 323 326 324 327 CGContextSetFontSize(cgContext, platformData.size()); 325 wkSetCGContextFontRenderingStyle(cgContext, font->isSystemFont(), false );328 wkSetCGContextFontRenderingStyle(cgContext, font->isSystemFont(), false, font->platformData().useGDI()); 326 329 327 330 IntSize shadowSize; -
trunk/WebCore/platform/graphics/win/FontCustomPlatformData.cpp
r37139 r39736 1 1 /* 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. 3 3 * 4 4 * This library is free software; you can redistribute it and/or … … 28 28 #include "SoftLinking.h" 29 29 #include <ApplicationServices/ApplicationServices.h> 30 #include <WebKitSystemInterface/WebKitSystemInterface.h> 30 31 #include <wtf/RetainPtr.h> 31 32 … … 65 66 ASSERT(T2embedLibrary()); 66 67 67 LOGFONT logFont; 68 static bool canUsePlatformNativeGlyphs = wkCanUsePlatformNativeGlyphs(); 69 LOGFONT _logFont; 70 71 LOGFONT& logFont = canUsePlatformNativeGlyphs ? *static_cast<LOGFONT*>(malloc(sizeof(LOGFONT))) : _logFont; 68 72 if (m_name.isNull()) 69 73 TTGetNewFontName(&m_fontReference, logFont.lfFaceName, LF_FACESIZE, 0, 0); … … 87 91 88 92 HFONT hfont = CreateFontIndirect(&logFont); 93 if (canUsePlatformNativeGlyphs) 94 wkSetFontPlatformInfo(m_cgFont, &logFont, free); 89 95 return FontPlatformData(hfont, m_cgFont, size, bold, italic, renderingMode == AlternateRenderingMode); 90 96 } -
trunk/WebCore/platform/graphics/win/FontPlatformDataCGWin.cpp
r31507 r39736 3 3 * FontMac.cpp, FontWin.cpp and Font.cpp. 4 4 * 5 * Copyright (C) 2006, 2007, 2008 Apple Inc.5 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. 6 6 * 7 7 * This library is free software; you can redistribute it and/or … … 28 28 #include "StringHash.h" 29 29 #include <ApplicationServices/ApplicationServices.h> 30 #include <WebKitSystemInterface/WebKitSystemInterface.h> 30 31 #include <wtf/HashMap.h> 31 32 #include <wtf/RetainPtr.h> … … 120 121 } 121 122 } 123 if (m_useGDI && wkCanUsePlatformNativeGlyphs()) { 124 LOGFONT* logfont = static_cast<LOGFONT*>(malloc(sizeof(LOGFONT))); 125 GetObject(font, sizeof(*logfont), logfont); 126 wkSetFontPlatformInfo(m_cgFont.get(), logfont, free); 127 } 122 128 } 123 129 -
trunk/WebKit/win/ChangeLog
r39735 r39736 1 2009-01-08 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Adam Roben. 4 5 - WebPreferences changes to support Core Graphics native glyph drawing 6 7 * Interfaces/IWebPreferencesPrivate.idl: Added font smoothing contrast 8 getter and setter. 9 * WebPreferenceKeysPrivate.h: Added 10 WebKitFontSmoothingContrastPreferenceKey. 11 * WebPreferences.cpp: 12 (WebPreferences::initializeDefaultSettings): Initialized 13 WebKitFontSmoothingContrastPreferenceKey to 2. 14 (WebPreferences::setFloatValue): Added. 15 (WebPreferences::setFontSmoothing): Changed to map 16 FontSmoothingTypeWindows to FontSmoothingTypeMedium. 17 (WebPreferences::fontSmoothingContrast): Added. 18 (WebPreferences::setFontSmoothingContrast): Added. Calls 19 wkSetFontSmoothingContrast(). 20 * WebPreferences.h: 21 1 22 2009-01-08 Steve Falkenburg <sfalken@apple.com> 2 23 -
trunk/WebKit/win/Interfaces/IWebPreferencesPrivate.idl
r39227 r39736 1 1 /* 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 66 66 67 67 HRESULT setLocalStorageEnabled([in] BOOL enabled); 68 HRESULT localStorageEnabled([out, retval] BOOL *enabled); 68 HRESULT localStorageEnabled([out, retval] BOOL* enabled); 69 70 HRESULT setFontSmoothingContrast([in] float contrast); 71 HRESULT fontSmoothingContrast([out, retval] float* contrast); 69 72 } -
trunk/WebKit/win/WebPreferenceKeysPrivate.h
r39227 r39736 1 1 /* 2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 92 92 // Windows-specific keys 93 93 #define WebKitFontSmoothingTypePreferenceKey "WebKitFontSmoothingType" // default: FontSmoothingTypeMedium (2) 94 #define WebKitFontSmoothingContrastPreferenceKey "WebKitFontSmoothingContrast" // default: "2" 94 95 #define WebKitCookieStorageAcceptPolicyPreferenceKey "WebKitCookieStorageAcceptPolicy" // default: WebKitCookieStorageAcceptPolicyOnlyFromMainDocumentDomain 95 96 -
trunk/WebKit/win/WebPreferences.cpp
r39227 r39736 1 1 /* 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 224 224 CFDictionaryAddValue(defaults, CFSTR(WebKitIconDatabaseEnabledPreferenceKey), kCFBooleanTrue); 225 225 CFDictionaryAddValue(defaults, CFSTR(WebKitFontSmoothingTypePreferenceKey), CFSTR("2")); 226 CFDictionaryAddValue(defaults, CFSTR(WebKitFontSmoothingContrastPreferenceKey), CFSTR("2")); 226 227 CFDictionaryAddValue(defaults, CFSTR(WebKitCookieStorageAcceptPolicyPreferenceKey), CFSTR("2")); 227 228 CFDictionaryAddValue(defaults, CFSTR(WebContinuousSpellCheckingEnabledPreferenceKey), kCFBooleanFalse); … … 330 331 { 331 332 if (integerValueForKey(key) == value) 333 return; 334 335 setValueForKey(key, cfNumber(value).get()); 336 337 postPreferencesChangesNotification(); 338 } 339 340 void WebPreferences::setFloatValue(CFStringRef key, float value) 341 { 342 if (floatValueForKey(key) == value) 332 343 return; 333 344 … … 966 977 setIntegerValue(CFSTR(WebKitFontSmoothingTypePreferenceKey), smoothingType); 967 978 if (smoothingType == FontSmoothingTypeWindows) 968 smoothingType = FontSmoothingType Standard;979 smoothingType = FontSmoothingTypeMedium; 969 980 wkSetFontSmoothingLevel((int)smoothingType); 981 return S_OK; 982 } 983 984 HRESULT STDMETHODCALLTYPE WebPreferences::fontSmoothingContrast( 985 /* [retval][out] */ float* contrast) 986 { 987 *contrast = floatValueForKey(CFSTR(WebKitFontSmoothingContrastPreferenceKey)); 988 return S_OK; 989 } 990 991 HRESULT STDMETHODCALLTYPE WebPreferences::setFontSmoothingContrast( 992 /* [in] */ float contrast) 993 { 994 setFloatValue(CFSTR(WebKitFontSmoothingContrastPreferenceKey), contrast); 995 wkSetFontSmoothingContrast(contrast); 970 996 return S_OK; 971 997 } -
trunk/WebKit/win/WebPreferences.h
r39227 r39736 1 1 /* 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 339 339 /* [retval][out] */ BOOL *zoomsTextOnly); 340 340 341 virtual HRESULT STDMETHODCALLTYPE fontSmoothingContrast( 342 /* [retval][out] */ float* contrast); 343 344 virtual HRESULT STDMETHODCALLTYPE setFontSmoothingContrast( 345 /* [in] */ float contrast); 346 341 347 // WebPreferences 342 348 … … 374 380 void setIntegerValue(CFStringRef key, int value); 375 381 void setBoolValue(CFStringRef key, BOOL value); 382 void setFloatValue(CFStringRef key, float value); 376 383 void setLongLongValue(CFStringRef key, LONGLONG value); 377 384 static WebPreferences* getInstanceForIdentifier(BSTR identifier); -
trunk/WebKitLibraries/ChangeLog
r38319 r39736 1 2009-01-08 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Adam Roben. 4 5 - WebKitSystemInterface changes to support Core Graphics native glyph drawing 6 7 * win/include/WebKitSystemInterface/WebKitSystemInterface.h: 8 * win/lib/WebKitSystemInterface.lib: 9 * win/lib/WebKitSystemInterface_debug.lib: 10 1 11 2008-11-11 Ada Chan <adachan@apple.com> 2 12 -
trunk/WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
r33431 r39736 1 1 /* 2 * Copyright (C) 2007 Apple Inc. All rights reserved.2 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 46 46 void wkSetFontSmoothingLevel(int type); 47 47 int wkGetFontSmoothingLevel(); 48 void wkSetFontSmoothingContrast(CGFloat); 49 CGFloat wkGetFontSmoothingContrast(); 48 50 uint32_t wkSetFontSmoothingStyle(CGContextRef cg, bool fontAllowsSmoothing); 49 51 void wkRestoreFontSmoothingStyle(CGContextRef cg, uint32_t oldStyle); 50 void wkSetCGContextFontRenderingStyle(CGContextRef, bool isSystemFont, bool isPrinterFont); 52 bool wkCanUsePlatformNativeGlyphs(); 53 void wkSetCGContextFontRenderingStyle(CGContextRef, bool isSystemFont, bool isPrinterFont, bool usePlatformNativeGlyphs); 51 54 void wkGetGlyphAdvances(CGFontRef, const CGAffineTransform&, bool isSystemFont, bool isPrinterFont, CGGlyph, CGSize& advance); 52 55 void wkGetGlyphs(CGFontRef, const UChar[], CGGlyph[], size_t count); 56 void wkSetFontPlatformInfo(CGFontRef, LOGFONT*, void(*)(void*)); 53 57 void wkSetUpFontCache(size_t s); 54 58 void wkAddFontsInDirectory(CFStringRef);
Note: See TracChangeset
for help on using the changeset viewer.