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

simon.fraser at apple.com simon.fraser at apple.com
Wed Dec 22 18:03:20 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 3abeb4f98fc4dd0b05a6df2e7805290a01b8de27
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Dec 6 19:31:12 2010 +0000

    2010-12-06  Simon Fraser  <simon.fraser at apple.com>
    
            Reviewed by Dan Bernstein.
    
            Font antialiasing (smoothing) changes when elements are rendered into compositing layers
            https://bugs.webkit.org/show_bug.cgi?id=23364
    
            Text rendered by Core Graphics over a transparent background looks bad because of
            font smoothing, so turn off smoothing when rendering text into compositing layers.
    
            * platform/graphics/GraphicsContext.h:
            * platform/graphics/cg/GraphicsContextCG.cpp:
            (WebCore::GraphicsContext::setAllowsFontSmoothing):
            * platform/graphics/mac/WebLayer.mm:
            (drawLayerContents):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73379 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 45cf2be..2450ce0 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-12-06  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Font antialiasing (smoothing) changes when elements are rendered into compositing layers
+        https://bugs.webkit.org/show_bug.cgi?id=23364
+
+        Text rendered by Core Graphics over a transparent background looks bad because of 
+        font smoothing, so turn off smoothing when rendering text into compositing layers.
+
+        * platform/graphics/GraphicsContext.h:
+        * platform/graphics/cg/GraphicsContextCG.cpp:
+        (WebCore::GraphicsContext::setAllowsFontSmoothing):
+        * platform/graphics/mac/WebLayer.mm:
+        (drawLayerContents):
+
 2010-12-06  Patrick Gansterer  <paroga at webkit.org>
 
         Reviewed by Andreas Kling.
diff --git a/WebCore/platform/graphics/GraphicsContext.h b/WebCore/platform/graphics/GraphicsContext.h
index 69d9e16..3bda553 100644
--- a/WebCore/platform/graphics/GraphicsContext.h
+++ b/WebCore/platform/graphics/GraphicsContext.h
@@ -193,6 +193,9 @@ namespace WebCore {
         void applyStrokePattern();
         void applyFillPattern();
         void drawPath(const Path&);
+        
+        // Allow font smoothing (LCD antialiasing). Not part of the graphics state.
+        void setAllowsFontSmoothing(bool);
 #endif
 
         void save();
diff --git a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
index cbcb104..dbc070a 100644
--- a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
+++ b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
@@ -1116,6 +1116,12 @@ InterpolationQuality GraphicsContext::imageInterpolationQuality() const
     return InterpolationDefault;
 }
 
+void GraphicsContext::setAllowsFontSmoothing(bool allowsFontSmoothing)
+{
+    CGContextRef context = platformContext();
+    CGContextSetAllowsFontSmoothing(context, allowsFontSmoothing);
+}
+
 void GraphicsContext::setPlatformTextDrawingMode(TextDrawingModeFlags mode)
 {
     if (paintingDisabled())
diff --git a/WebCore/platform/graphics/mac/WebLayer.mm b/WebCore/platform/graphics/mac/WebLayer.mm
index 9bb8212..d357700 100644
--- a/WebCore/platform/graphics/mac/WebLayer.mm
+++ b/WebCore/platform/graphics/mac/WebLayer.mm
@@ -62,6 +62,9 @@ void drawLayerContents(CGContextRef context, CALayer *layer, WebCore::GraphicsLa
 
         GraphicsContext graphicsContext(context);
 
+        // Turn off font smoothing to improve the appearance of text rendered onto a transparent background.
+        graphicsContext.setAllowsFontSmoothing(false);
+        
         // It's important to get the clip from the context, because it may be significantly
         // smaller than the layer bounds (e.g. tiled layers)
         CGRect clipBounds = CGContextGetClipBoundingBox(context);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list