[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:41:45 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 47b96b2801c2e67373e4b8290c4ba028b32fec09
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 15 23:35:49 2010 +0000

    2010-12-15  Simon Fraser  <simon.fraser at apple.com>
    
            Reviewed by Adele Peterson.
    
            WebKit2 in compositing mode no longer has font smoothing
            https://bugs.webkit.org/show_bug.cgi?id=50733
    
            Only turn off font smoothing for layers whose contents are
            not opaque. This allows the root GraphicsLayer in WebKit2 to
            set the opaque flag, and get smoothed text.
    
            * platform/graphics/mac/WebLayer.mm:
            (drawLayerContents):
    
    2010-12-15  Simon Fraser  <simon.fraser at apple.com>
    
            Reviewed by Adele Peterson.
    
            WebKit2 in compositing mode no longer has font smoothing
            https://bugs.webkit.org/show_bug.cgi?id=50733
    
            Tell the root GraphicsLayer that its contents are opaque
            if the WebPage draws its background, and that background
            is not transparent.
    
            The GraphicsLayer then uses the 'contentsOpaque' setting to
            determine whether to use font smoothing.
    
            Add pageBackgroundTransparencyChanged() to DrawingArea
            so that the WebPage can inform the DrawingArea when the
            background transparency changes.
    
            * WebProcess/WebPage/DrawingArea.h:
            (WebKit::DrawingArea::pageBackgroundTransparencyChanged):
            (WebKit::DrawingArea::onPageClose):
            * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
            (WebKit::LayerBackedDrawingArea::LayerBackedDrawingArea):
            (WebKit::LayerBackedDrawingArea::pageBackgroundTransparencyChanged):
            * WebProcess/WebPage/LayerBackedDrawingArea.h:
            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::setDrawsBackground):
            (WebKit::WebPage::setDrawsTransparentBackground):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74152 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7cebca5..4fd7850 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,19 @@
 2010-12-15  Simon Fraser  <simon.fraser at apple.com>
 
+        Reviewed by Adele Peterson.
+
+        WebKit2 in compositing mode no longer has font smoothing
+        https://bugs.webkit.org/show_bug.cgi?id=50733
+
+        Only turn off font smoothing for layers whose contents are
+        not opaque. This allows the root GraphicsLayer in WebKit2 to
+        set the opaque flag, and get smoothed text.
+
+        * platform/graphics/mac/WebLayer.mm:
+        (drawLayerContents):
+
+2010-12-15  Simon Fraser  <simon.fraser at apple.com>
+
         Reviewed by Dan Bernstein.
 
         Allow disabling of font smoothing in compositing layers to be overridden by style
diff --git a/WebCore/platform/graphics/mac/WebLayer.mm b/WebCore/platform/graphics/mac/WebLayer.mm
index 70db44e..128e63b 100644
--- a/WebCore/platform/graphics/mac/WebLayer.mm
+++ b/WebCore/platform/graphics/mac/WebLayer.mm
@@ -63,8 +63,10 @@ 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.setShouldSmoothFonts(false);
+        if (!layerContents->contentsOpaque()) {
+            // Turn off font smoothing to improve the appearance of text rendered onto a transparent background.
+            graphicsContext.setShouldSmoothFonts(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)
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 0224782..1a7a67f 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,32 @@
+2010-12-15  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Adele Peterson.
+
+        WebKit2 in compositing mode no longer has font smoothing
+        https://bugs.webkit.org/show_bug.cgi?id=50733
+        
+        Tell the root GraphicsLayer that its contents are opaque
+        if the WebPage draws its background, and that background
+        is not transparent.
+        
+        The GraphicsLayer then uses the 'contentsOpaque' setting to
+        determine whether to use font smoothing.
+        
+        Add pageBackgroundTransparencyChanged() to DrawingArea
+        so that the WebPage can inform the DrawingArea when the
+        background transparency changes.
+
+        * WebProcess/WebPage/DrawingArea.h:
+        (WebKit::DrawingArea::pageBackgroundTransparencyChanged):
+        (WebKit::DrawingArea::onPageClose):
+        * WebProcess/WebPage/LayerBackedDrawingArea.cpp:
+        (WebKit::LayerBackedDrawingArea::LayerBackedDrawingArea):
+        (WebKit::LayerBackedDrawingArea::pageBackgroundTransparencyChanged):
+        * WebProcess/WebPage/LayerBackedDrawingArea.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::setDrawsBackground):
+        (WebKit::WebPage::setDrawsTransparentBackground):
+
 2010-12-15  Anders Carlsson  <andersca at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/WebKit2/WebProcess/WebPage/DrawingArea.h b/WebKit2/WebProcess/WebPage/DrawingArea.h
index 6b5c50e..f6c97d2 100644
--- a/WebKit2/WebProcess/WebPage/DrawingArea.h
+++ b/WebKit2/WebProcess/WebPage/DrawingArea.h
@@ -56,8 +56,10 @@ public:
     virtual void setNeedsDisplay(const WebCore::IntRect&) = 0;
     virtual void display() = 0;
 
-    virtual void onPageClose() { }
+    virtual void pageBackgroundTransparencyChanged() { }
 
+    virtual void onPageClose() { }
+    
 #if USE(ACCELERATED_COMPOSITING)
     virtual void attachCompositingContext() = 0;
     virtual void detachCompositingContext() = 0;
diff --git a/WebKit2/WebProcess/WebPage/LayerBackedDrawingArea.cpp b/WebKit2/WebProcess/WebPage/LayerBackedDrawingArea.cpp
index 2a4a2bb..65c5cb7 100644
--- a/WebKit2/WebProcess/WebPage/LayerBackedDrawingArea.cpp
+++ b/WebKit2/WebProcess/WebPage/LayerBackedDrawingArea.cpp
@@ -47,6 +47,8 @@ LayerBackedDrawingArea::LayerBackedDrawingArea(DrawingAreaInfo::Identifier ident
 {
     m_backingLayer = GraphicsLayer::create(this);
     m_backingLayer->setDrawsContent(true);
+    m_backingLayer->setContentsOpaque(webPage->drawsBackground() && !webPage->drawsTransparentBackground());
+
 #ifndef NDEBUG
     m_backingLayer->setName("DrawingArea backing layer");
 #endif
@@ -98,6 +100,11 @@ void LayerBackedDrawingArea::display()
         return;
 }
 
+void LayerBackedDrawingArea::pageBackgroundTransparencyChanged()
+{
+    m_backingLayer->setContentsOpaque(m_webPage->drawsBackground() && !m_webPage->drawsTransparentBackground());
+}
+
 void LayerBackedDrawingArea::scheduleDisplay()
 {
 }
diff --git a/WebKit2/WebProcess/WebPage/LayerBackedDrawingArea.h b/WebKit2/WebProcess/WebPage/LayerBackedDrawingArea.h
index 61f869b..d049a60 100644
--- a/WebKit2/WebProcess/WebPage/LayerBackedDrawingArea.h
+++ b/WebKit2/WebProcess/WebPage/LayerBackedDrawingArea.h
@@ -62,6 +62,8 @@ public:
     virtual void setNeedsDisplay(const WebCore::IntRect&);
     virtual void display();
 
+    virtual void pageBackgroundTransparencyChanged();
+
     virtual void attachCompositingContext();
     virtual void detachCompositingContext();
     virtual void setRootCompositingLayer(WebCore::GraphicsLayer*);
diff --git a/WebKit2/WebProcess/WebPage/WebPage.cpp b/WebKit2/WebProcess/WebPage/WebPage.cpp
index de4f099..1604015 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -808,6 +808,7 @@ void WebPage::setDrawsBackground(bool drawsBackground)
             view->setTransparent(!drawsBackground);
     }
 
+    m_drawingArea->pageBackgroundTransparencyChanged();
     m_drawingArea->setNeedsDisplay(IntRect(IntPoint(0, 0), m_viewSize));
 }
 
@@ -824,6 +825,7 @@ void WebPage::setDrawsTransparentBackground(bool drawsTransparentBackground)
             view->setBaseBackgroundColor(backgroundColor);
     }
 
+    m_drawingArea->pageBackgroundTransparencyChanged();
     m_drawingArea->setNeedsDisplay(IntRect(IntPoint(0, 0), m_viewSize));
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list