[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

mitz at apple.com mitz at apple.com
Wed Dec 22 11:17:51 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit c5a2df3732fc32f8fc85c619b0fd5087737a741c
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jul 16 23:03:40 2010 +0000

    Part of <rdar://problem/7233974> Deprecate +[WebView _setShouldUseFontSmoothing:]
    https://bugs.webkit.org/show_bug.cgi?id=29355
    
    Reviewed by Sam Weinig.
    
    WebCore:
    
    * WebCore.exp.in: Updated.
    * platform/graphics/Font.cpp:
    (WebCore::Font::Font): Added a font smoothing mode parameter to the constructor.
    Set the font smoothing mode in the font description.
    * platform/graphics/Font.h:
    
    WebKit/mac:
    
    * Misc/WebKitNSStringExtras.h:
    * Misc/WebKitNSStringExtras.mm:
    (-[NSString _web_drawAtPoint:font:textColor:]): Now calls through to
    -_web_drawAtPoint:font:textColor:allowingFontSmoothing: passing YES for the last
    parameter.
    (-[NSString _web_drawAtPoint:font:textColor:allowingFontSmoothing:]): Added
    allowingFontSmoothing:. If font smoothing is not allowed, sets the font smoothing
    mode to antialiased. Otherwise, sets it to auto.
    (-[NSString _web_drawDoubledAtPoint:withTopColor:bottomColor:font:]): Instead of
    changing the font smoothing setting in the graphics context, call
    -_web_drawAtPoint:font:textColor:allowingFontSmoothing: passing NO for the last
    parameter.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63595 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index fbc0725..6dedd16 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-07-16  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Part of <rdar://problem/7233974> Deprecate +[WebView _setShouldUseFontSmoothing:]
+        https://bugs.webkit.org/show_bug.cgi?id=29355
+
+        * WebCore.exp.in: Updated.
+        * platform/graphics/Font.cpp:
+        (WebCore::Font::Font): Added a font smoothing mode parameter to the constructor.
+        Set the font smoothing mode in the font description.
+        * platform/graphics/Font.h:
+
 2010-07-16  Satish Sampath  <satish at chromium.org>
 
         Reviewed by Anders Carlsson.
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index a4ed7ce..e310a2d 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -482,7 +482,7 @@ __ZN7WebCore3macERKNS_23AuthenticationChallengeE
 __ZN7WebCore4Font11setCodePathENS0_8CodePathE
 __ZN7WebCore4Font18shouldUseSmoothingEv
 __ZN7WebCore4Font21setShouldUseSmoothingEb
-__ZN7WebCore4FontC1ERKNS_16FontPlatformDataEb
+__ZN7WebCore4FontC1ERKNS_16FontPlatformDataEbNS_17FontSmoothingModeE
 __ZN7WebCore4FontC1Ev
 __ZN7WebCore4FontaSERKS0_
 __ZN7WebCore4Icon18createIconForFilesERKN3WTF6VectorINS_6StringELm0EEE
diff --git a/WebCore/platform/graphics/Font.cpp b/WebCore/platform/graphics/Font.cpp
index 0351f7b..61f5707 100644
--- a/WebCore/platform/graphics/Font.cpp
+++ b/WebCore/platform/graphics/Font.cpp
@@ -72,7 +72,7 @@ Font::Font(const FontDescription& fd, short letterSpacing, short wordSpacing)
 {
 }
 
-Font::Font(const FontPlatformData& fontData, bool isPrinterFont)
+Font::Font(const FontPlatformData& fontData, bool isPrinterFont, FontSmoothingMode fontSmoothingMode)
     : m_fontList(FontFallbackList::create())
     , m_letterSpacing(0)
     , m_wordSpacing(0)
@@ -80,6 +80,7 @@ Font::Font(const FontPlatformData& fontData, bool isPrinterFont)
     , m_needsTranscoding(fontTranscoder().needsTranscoding(family().family().string()))
 {
     m_fontDescription.setUsePrinterFont(isPrinterFont);
+    m_fontDescription.setFontSmoothing(fontSmoothingMode);
     m_fontList->setPlatformFont(fontData);
 }
 
diff --git a/WebCore/platform/graphics/Font.h b/WebCore/platform/graphics/Font.h
index c7cd3ac..d6cf140 100644
--- a/WebCore/platform/graphics/Font.h
+++ b/WebCore/platform/graphics/Font.h
@@ -76,7 +76,7 @@ public:
     Font();
     Font(const FontDescription&, short letterSpacing, short wordSpacing);
     // This constructor is only used if the platform wants to start with a native font.
-    Font(const FontPlatformData&, bool isPrinting);
+    Font(const FontPlatformData&, bool isPrinting, FontSmoothingMode = AutoSmoothing);
     ~Font();
 
     Font(const Font&);
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index ec861e6..f8ae25e 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,23 @@
+2010-07-16  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Part of <rdar://problem/7233974> Deprecate +[WebView _setShouldUseFontSmoothing:]
+        https://bugs.webkit.org/show_bug.cgi?id=29355
+
+        * Misc/WebKitNSStringExtras.h:
+        * Misc/WebKitNSStringExtras.mm:
+        (-[NSString _web_drawAtPoint:font:textColor:]): Now calls through to
+        -_web_drawAtPoint:font:textColor:allowingFontSmoothing: passing YES for the last
+        parameter.
+        (-[NSString _web_drawAtPoint:font:textColor:allowingFontSmoothing:]): Added
+        allowingFontSmoothing:. If font smoothing is not allowed, sets the font smoothing
+        mode to antialiased. Otherwise, sets it to auto.
+        (-[NSString _web_drawDoubledAtPoint:withTopColor:bottomColor:font:]): Instead of
+        changing the font smoothing setting in the graphics context, call
+        -_web_drawAtPoint:font:textColor:allowingFontSmoothing: passing NO for the last
+        parameter.
+
 2010-07-16  Anders Carlsson  <andersca at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/WebKit/mac/Misc/WebKitNSStringExtras.h b/WebKit/mac/Misc/WebKitNSStringExtras.h
index f252430..ddc49f0 100644
--- a/WebKit/mac/Misc/WebKitNSStringExtras.h
+++ b/WebKit/mac/Misc/WebKitNSStringExtras.h
@@ -32,6 +32,7 @@ extern NSString *WebKitLocalCacheDefaultsKey;
 
 @interface NSString (WebKitExtras)
 
+- (void)_web_drawAtPoint:(NSPoint)point font:(NSFont *)font textColor:(NSColor *)textColor allowingFontSmoothing:(BOOL)fontSmoothingIsAllowed;
 - (void)_web_drawAtPoint:(NSPoint)point font:(NSFont *)font textColor:(NSColor *)textColor;
 - (void)_web_drawDoubledAtPoint:(NSPoint)textPoint withTopColor:(NSColor *)topColor bottomColor:(NSColor *)bottomColor font:(NSFont *)font;
 
diff --git a/WebKit/mac/Misc/WebKitNSStringExtras.mm b/WebKit/mac/Misc/WebKitNSStringExtras.mm
index da46630..8fc12bd 100644
--- a/WebKit/mac/Misc/WebKitNSStringExtras.mm
+++ b/WebKit/mac/Misc/WebKitNSStringExtras.mm
@@ -62,12 +62,16 @@ static BOOL canUseFastRenderer(const UniChar *buffer, unsigned length)
 
 - (void)_web_drawAtPoint:(NSPoint)point font:(NSFont *)font textColor:(NSColor *)textColor
 {
-    // FIXME: Would be more efficient to change this to C++ and use Vector<UChar, 2048>.
+    [self _web_drawAtPoint:point font:font textColor:textColor allowingFontSmoothing:YES];
+}
+
+- (void)_web_drawAtPoint:(NSPoint)point font:(NSFont *)font textColor:(NSColor *)textColor allowingFontSmoothing:(BOOL)fontSmoothingIsAllowed
+{
     unsigned length = [self length];
     Vector<UniChar, 2048> buffer(length);
 
     [self getCharacters:buffer.data()];
-    
+
     if (canUseFastRenderer(buffer.data(), length)) {
         // The following is a half-assed attempt to match AppKit's rounding rules for drawAtPoint.
         // It's probably incorrect for high DPI.
@@ -84,7 +88,7 @@ static BOOL canUseFastRenderer(const UniChar *buffer, unsigned length)
         if (!flipped)
             CGContextScaleCTM(cgContext, 1, -1);
 
-        Font webCoreFont(FontPlatformData(font), ![nsContext isDrawingToScreen]);
+        Font webCoreFont(FontPlatformData(font), ![nsContext isDrawingToScreen], fontSmoothingIsAllowed ? AutoSmoothing : Antialiased);
         TextRun run(buffer.data(), length);
         run.disableRoundingHacks();
 
@@ -116,17 +120,10 @@ static BOOL canUseFastRenderer(const UniChar *buffer, unsigned length)
                      font:(NSFont *)font
 {
     // turn off font smoothing so translucent text draws correctly (Radar 3118455)
-    [NSGraphicsContext saveGraphicsState];
-    CGContextSetShouldSmoothFonts(static_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]), false);
-    [self _web_drawAtPoint:textPoint
-                      font:font
-                 textColor:bottomColor];
+    [self _web_drawAtPoint:textPoint font:font textColor:bottomColor allowingFontSmoothing:NO];
 
     textPoint.y += 1;
-    [self _web_drawAtPoint:textPoint
-                      font:font
-                 textColor:topColor];
-    [NSGraphicsContext restoreGraphicsState];
+    [self _web_drawAtPoint:textPoint font:font textColor:topColor allowingFontSmoothing:NO];
 }
 
 - (float)_web_widthWithFont:(NSFont *)font

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list