Changeset 63595 in webkit
- Timestamp:
- Jul 16, 2010, 4:03:40 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r63594 r63595 1 2010-07-16 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Part of <rdar://problem/7233974> Deprecate +[WebView _setShouldUseFontSmoothing:] 6 https://bugs.webkit.org/show_bug.cgi?id=29355 7 8 * WebCore.exp.in: Updated. 9 * platform/graphics/Font.cpp: 10 (WebCore::Font::Font): Added a font smoothing mode parameter to the constructor. 11 Set the font smoothing mode in the font description. 12 * platform/graphics/Font.h: 13 1 14 2010-07-16 Satish Sampath <satish@chromium.org> 2 15 -
trunk/WebCore/WebCore.exp.in
r63521 r63595 483 483 __ZN7WebCore4Font18shouldUseSmoothingEv 484 484 __ZN7WebCore4Font21setShouldUseSmoothingEb 485 __ZN7WebCore4FontC1ERKNS_16FontPlatformDataEb 485 __ZN7WebCore4FontC1ERKNS_16FontPlatformDataEbNS_17FontSmoothingModeE 486 486 __ZN7WebCore4FontC1Ev 487 487 __ZN7WebCore4FontaSERKS0_ -
trunk/WebCore/platform/graphics/Font.cpp
r61253 r63595 73 73 } 74 74 75 Font::Font(const FontPlatformData& fontData, bool isPrinterFont )75 Font::Font(const FontPlatformData& fontData, bool isPrinterFont, FontSmoothingMode fontSmoothingMode) 76 76 : m_fontList(FontFallbackList::create()) 77 77 , m_letterSpacing(0) … … 81 81 { 82 82 m_fontDescription.setUsePrinterFont(isPrinterFont); 83 m_fontDescription.setFontSmoothing(fontSmoothingMode); 83 84 m_fontList->setPlatformFont(fontData); 84 85 } -
trunk/WebCore/platform/graphics/Font.h
r63570 r63595 77 77 Font(const FontDescription&, short letterSpacing, short wordSpacing); 78 78 // This constructor is only used if the platform wants to start with a native font. 79 Font(const FontPlatformData&, bool isPrinting );79 Font(const FontPlatformData&, bool isPrinting, FontSmoothingMode = AutoSmoothing); 80 80 ~Font(); 81 81 -
trunk/WebKit/mac/ChangeLog
r63591 r63595 1 2010-07-16 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Part of <rdar://problem/7233974> Deprecate +[WebView _setShouldUseFontSmoothing:] 6 https://bugs.webkit.org/show_bug.cgi?id=29355 7 8 * Misc/WebKitNSStringExtras.h: 9 * Misc/WebKitNSStringExtras.mm: 10 (-[NSString _web_drawAtPoint:font:textColor:]): Now calls through to 11 -_web_drawAtPoint:font:textColor:allowingFontSmoothing: passing YES for the last 12 parameter. 13 (-[NSString _web_drawAtPoint:font:textColor:allowingFontSmoothing:]): Added 14 allowingFontSmoothing:. If font smoothing is not allowed, sets the font smoothing 15 mode to antialiased. Otherwise, sets it to auto. 16 (-[NSString _web_drawDoubledAtPoint:withTopColor:bottomColor:font:]): Instead of 17 changing the font smoothing setting in the graphics context, call 18 -_web_drawAtPoint:font:textColor:allowingFontSmoothing: passing NO for the last 19 parameter. 20 1 21 2010-07-16 Anders Carlsson <andersca@apple.com> 2 22 -
trunk/WebKit/mac/Misc/WebKitNSStringExtras.h
r43721 r63595 33 33 @interface NSString (WebKitExtras) 34 34 35 - (void)_web_drawAtPoint:(NSPoint)point font:(NSFont *)font textColor:(NSColor *)textColor allowingFontSmoothing:(BOOL)fontSmoothingIsAllowed; 35 36 - (void)_web_drawAtPoint:(NSPoint)point font:(NSFont *)font textColor:(NSColor *)textColor; 36 37 - (void)_web_drawDoubledAtPoint:(NSPoint)textPoint withTopColor:(NSColor *)topColor bottomColor:(NSColor *)bottomColor font:(NSFont *)font; -
trunk/WebKit/mac/Misc/WebKitNSStringExtras.mm
r50760 r63595 63 63 - (void)_web_drawAtPoint:(NSPoint)point font:(NSFont *)font textColor:(NSColor *)textColor 64 64 { 65 // FIXME: Would be more efficient to change this to C++ and use Vector<UChar, 2048>. 65 [self _web_drawAtPoint:point font:font textColor:textColor allowingFontSmoothing:YES]; 66 } 67 68 - (void)_web_drawAtPoint:(NSPoint)point font:(NSFont *)font textColor:(NSColor *)textColor allowingFontSmoothing:(BOOL)fontSmoothingIsAllowed 69 { 66 70 unsigned length = [self length]; 67 71 Vector<UniChar, 2048> buffer(length); 68 72 69 73 [self getCharacters:buffer.data()]; 70 74 71 75 if (canUseFastRenderer(buffer.data(), length)) { 72 76 // The following is a half-assed attempt to match AppKit's rounding rules for drawAtPoint. … … 85 89 CGContextScaleCTM(cgContext, 1, -1); 86 90 87 Font webCoreFont(FontPlatformData(font), ![nsContext isDrawingToScreen] );91 Font webCoreFont(FontPlatformData(font), ![nsContext isDrawingToScreen], fontSmoothingIsAllowed ? AutoSmoothing : Antialiased); 88 92 TextRun run(buffer.data(), length); 89 93 run.disableRoundingHacks(); … … 117 121 { 118 122 // turn off font smoothing so translucent text draws correctly (Radar 3118455) 119 [NSGraphicsContext saveGraphicsState]; 120 CGContextSetShouldSmoothFonts(static_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]), false); 121 [self _web_drawAtPoint:textPoint 122 font:font 123 textColor:bottomColor]; 123 [self _web_drawAtPoint:textPoint font:font textColor:bottomColor allowingFontSmoothing:NO]; 124 124 125 125 textPoint.y += 1; 126 [self _web_drawAtPoint:textPoint 127 font:font 128 textColor:topColor]; 129 [NSGraphicsContext restoreGraphicsState]; 126 [self _web_drawAtPoint:textPoint font:font textColor:topColor allowingFontSmoothing:NO]; 130 127 } 131 128
Note:
See TracChangeset
for help on using the changeset viewer.