Title: [163931] trunk/Source
Revision
163931
Author
[email protected]
Date
2014-02-11 19:28:43 -0800 (Tue, 11 Feb 2014)

Log Message

Subpixel rendering: Make GraphicsLayerClient::paintContents's clip rect subpixel based.
https://bugs.webkit.org/show_bug.cgi?id=128460

Reviewed by Simon Fraser.

GraphicsClient::paintContents takes clipRect as FloatRect now so that we can paint on
subpixel position.

No change in functionality.

Source/WebCore:

* platform/graphics/GraphicsLayerClient.h:
* platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
(WebCore::CompositingCoordinator::paintContents):
* platform/graphics/texmap/coordinated/CompositingCoordinator.h:
* rendering/RenderLayer.cpp:
(WebCore::cornerRect):
(WebCore::RenderLayer::scrollCornerRect):
(WebCore::resizerCornerRect):
(WebCore::RenderLayer::scrollCornerAndResizerRect):
(WebCore::RenderLayer::verticalScrollbarStart):
(WebCore::RenderLayer::horizontalScrollbarStart):
(WebCore::RenderLayer::paintResizer):
(WebCore::RenderLayer::hitTestOverflowControls):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintIntoLayer):
(WebCore::RenderLayerBacking::paintContents):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::paintContents):
* rendering/RenderLayerCompositor.h:
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::paint):

Source/WebKit/gtk:

* WebCoreSupport/AcceleratedCompositingContext.h:
* WebCoreSupport/AcceleratedCompositingContextGL.cpp:
(WebKit::AcceleratedCompositingContext::paintContents):

Source/WebKit/win:

* WebView.cpp:
(WebView::paintContents):
* WebView.h:

Source/WebKit2:

* WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
(WebKit::LayerTreeHostGtk::paintContents):
* WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::paintContents):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::paintContents):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (163930 => 163931)


--- trunk/Source/WebCore/ChangeLog	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebCore/ChangeLog	2014-02-12 03:28:43 UTC (rev 163931)
@@ -1,3 +1,39 @@
+2014-02-11  Zalan Bujtas  <[email protected]>
+
+        Subpixel rendering: Make GraphicsLayerClient::paintContents's clip rect subpixel based.
+        https://bugs.webkit.org/show_bug.cgi?id=128460
+
+        Reviewed by Simon Fraser.
+
+        GraphicsClient::paintContents takes clipRect as FloatRect now so that we can paint on
+        subpixel position.
+
+        No change in functionality.
+
+        * platform/graphics/GraphicsLayerClient.h:
+        * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
+        (WebCore::CompositingCoordinator::paintContents):
+        * platform/graphics/texmap/coordinated/CompositingCoordinator.h:
+        * rendering/RenderLayer.cpp:
+        (WebCore::cornerRect):
+        (WebCore::RenderLayer::scrollCornerRect):
+        (WebCore::resizerCornerRect):
+        (WebCore::RenderLayer::scrollCornerAndResizerRect):
+        (WebCore::RenderLayer::verticalScrollbarStart):
+        (WebCore::RenderLayer::horizontalScrollbarStart):
+        (WebCore::RenderLayer::paintResizer):
+        (WebCore::RenderLayer::hitTestOverflowControls):
+        * rendering/RenderLayer.h:
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::paintIntoLayer):
+        (WebCore::RenderLayerBacking::paintContents):
+        * rendering/RenderLayerBacking.h:
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::paintContents):
+        * rendering/RenderLayerCompositor.h:
+        * rendering/RenderWidget.cpp:
+        (WebCore::RenderWidget::paint):
+
 2014-02-11  Antti Koivisto  <[email protected]>
 
         GIF animations should be suspended when outside of viewport

Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h (163930 => 163931)


--- trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h	2014-02-12 03:28:43 UTC (rev 163931)
@@ -29,6 +29,7 @@
 namespace WebCore {
 
 class FloatPoint;
+class FloatRect;
 class GraphicsContext;
 class GraphicsLayer;
 class IntPoint;
@@ -70,7 +71,7 @@
     // Notification that this layer requires a flush before the next display refresh.
     virtual void notifyFlushBeforeDisplayRefresh(const GraphicsLayer*) { }
 
-    virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& inClip) = 0;
+    virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& inClip) = 0;
     virtual void didCommitChangesForLayer(const GraphicsLayer*) const { }
 
     // Provides current transform (taking transform-origin and animations into account). Input matrix has been

Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp (163930 => 163931)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp	2014-02-12 03:28:43 UTC (rev 163931)
@@ -253,9 +253,9 @@
 }
 
 
-void CompositingCoordinator::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const IntRect& clipRect)
+void CompositingCoordinator::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const FloatRect& clipRect)
 {
-    m_client->paintLayerContents(graphicsLayer, graphicsContext, clipRect);
+    m_client->paintLayerContents(graphicsLayer, graphicsContext, enclosingIntRect(clipRect));
 }
 
 std::unique_ptr<GraphicsLayer> CompositingCoordinator::createGraphicsLayer(GraphicsLayerClient* client)

Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h (163930 => 163931)


--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h	2014-02-12 03:28:43 UTC (rev 163931)
@@ -91,7 +91,7 @@
     // GraphicsLayerClient
     virtual void notifyAnimationStarted(const GraphicsLayer*, double time) override;
     virtual void notifyFlushRequired(const GraphicsLayer*) override;
-    virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& clipRect) override;
+    virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& clipRect) override;
     virtual float deviceScaleFactor() const override;
     virtual float pageScaleFactor() const override;
 

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (163930 => 163931)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2014-02-12 03:28:43 UTC (rev 163931)
@@ -2699,7 +2699,7 @@
 {
     RenderBox* box = renderBox();
     if (!box)
-        return IntRect();
+        return LayoutRect();
     LayoutRect scrollCornerAndResizer = scrollCornerRect();
     if (scrollCornerAndResizer.isEmpty())
         scrollCornerAndResizer = resizerCornerRect(this, box->borderBoxRect());

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (163930 => 163931)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2014-02-12 03:28:43 UTC (rev 163931)
@@ -2127,8 +2127,8 @@
 }
 
 void RenderLayerBacking::paintIntoLayer(const GraphicsLayer* graphicsLayer, GraphicsContext* context,
-                    const IntRect& paintDirtyRect, // In the coords of rootLayer.
-                    PaintBehavior paintBehavior, GraphicsLayerPaintingPhase paintingPhase)
+    const LayoutRect& paintDirtyRect, // In the coords of rootLayer.
+    PaintBehavior paintBehavior, GraphicsLayerPaintingPhase paintingPhase)
 {
     if (paintsIntoWindow() || paintsIntoCompositedAncestor()) {
 #if !PLATFORM(IOS)
@@ -2186,13 +2186,17 @@
 }
 
 // Up-call from compositing layer drawing callback.
-void RenderLayerBacking::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, GraphicsLayerPaintingPhase paintingPhase, const IntRect& clip)
+void RenderLayerBacking::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, GraphicsLayerPaintingPhase paintingPhase, const FloatRect& clip)
 {
 #ifndef NDEBUG
     if (Page* page = renderer().frame().page())
         page->setIsPainting(true);
 #endif
 
+    // The dirtyRect is in the coords of the painting root.
+    LayoutRect dirtyRect(clip);
+    IntRect pixelSnappedRectForIntegralPositionedItems = pixelSnappedIntRect(dirtyRect);
+
     if (graphicsLayer == m_graphicsLayer.get()
         || graphicsLayer == m_foregroundLayer.get()
         || graphicsLayer == m_backgroundLayer.get()
@@ -2200,24 +2204,22 @@
         || graphicsLayer == m_scrollingContentsLayer.get()) {
         InspectorInstrumentation::willPaint(&renderer());
 
-        // The dirtyRect is in the coords of the painting root.
-        IntRect dirtyRect = clip;
         if (!(paintingPhase & GraphicsLayerPaintOverflowContents))
             dirtyRect.intersect(enclosingIntRect(compositedBoundsIncludingMargin()));
 
         // We have to use the same root as for hit testing, because both methods can compute and cache clipRects.
         paintIntoLayer(graphicsLayer, &context, dirtyRect, PaintBehaviorNormal, paintingPhase);
 
-        InspectorInstrumentation::didPaint(&renderer(), &context, clip);
+        InspectorInstrumentation::didPaint(&renderer(), &context, dirtyRect);
     } else if (graphicsLayer == layerForHorizontalScrollbar()) {
-        paintScrollbar(m_owningLayer.horizontalScrollbar(), context, clip);
+        paintScrollbar(m_owningLayer.horizontalScrollbar(), context, pixelSnappedRectForIntegralPositionedItems);
     } else if (graphicsLayer == layerForVerticalScrollbar()) {
-        paintScrollbar(m_owningLayer.verticalScrollbar(), context, clip);
+        paintScrollbar(m_owningLayer.verticalScrollbar(), context, pixelSnappedRectForIntegralPositionedItems);
     } else if (graphicsLayer == layerForScrollCorner()) {
         const LayoutRect& scrollCornerAndResizer = m_owningLayer.scrollCornerAndResizerRect();
         context.save();
         context.translate(-scrollCornerAndResizer.x(), -scrollCornerAndResizer.y());
-        LayoutRect transformedClip = clip;
+        LayoutRect transformedClip = LayoutRect(clip);
         transformedClip.moveBy(scrollCornerAndResizer.location());
         m_owningLayer.paintScrollCorner(&context, IntPoint(), pixelSnappedIntRect(transformedClip));
         m_owningLayer.paintResizer(&context, IntPoint(), transformedClip);

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.h (163930 => 163931)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.h	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.h	2014-02-12 03:28:43 UTC (rev 163931)
@@ -165,7 +165,7 @@
     virtual void notifyFlushRequired(const GraphicsLayer*) override;
     virtual void notifyFlushBeforeDisplayRefresh(const GraphicsLayer*) override;
 
-    virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& clip) override;
+    virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect& clip) override;
 
     virtual float deviceScaleFactor() const override;
     virtual float contentsScaleMultiplierForNewTiles(const GraphicsLayer*) const override;
@@ -283,7 +283,7 @@
     bool hasTiledBackingFlatteningLayer() const { return (m_childContainmentLayer && m_usingTiledCacheLayer); }
     GraphicsLayer* tileCacheFlatteningLayer() const { return m_usingTiledCacheLayer ? m_childContainmentLayer.get() : 0; }
 
-    void paintIntoLayer(const GraphicsLayer*, GraphicsContext*, const IntRect& paintDirtyRect, PaintBehavior, GraphicsLayerPaintingPhase);
+    void paintIntoLayer(const GraphicsLayer*, GraphicsContext*, const LayoutRect& paintDirtyRect, PaintBehavior, GraphicsLayerPaintingPhase);
 
     // Helper function for updateGraphicsLayerGeometry.
     void adjustAncestorCompositingBoundsForFlowThread(IntRect& ancestorCompositingBounds, const RenderLayer* compositingAncestor) const;

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (163930 => 163931)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2014-02-12 03:28:43 UTC (rev 163931)
@@ -2608,17 +2608,18 @@
     context.restore();
 }
 
-void RenderLayerCompositor::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, GraphicsLayerPaintingPhase, const IntRect& clip)
+void RenderLayerCompositor::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, GraphicsLayerPaintingPhase, const FloatRect& clip)
 {
+    IntRect pixelSnappedRectForIntegralPositionedItems = pixelSnappedIntRect(LayoutRect(clip));
     if (graphicsLayer == layerForHorizontalScrollbar())
-        paintScrollbar(m_renderView.frameView().horizontalScrollbar(), context, clip);
+        paintScrollbar(m_renderView.frameView().horizontalScrollbar(), context, pixelSnappedRectForIntegralPositionedItems);
     else if (graphicsLayer == layerForVerticalScrollbar())
-        paintScrollbar(m_renderView.frameView().verticalScrollbar(), context, clip);
+        paintScrollbar(m_renderView.frameView().verticalScrollbar(), context, pixelSnappedRectForIntegralPositionedItems);
     else if (graphicsLayer == layerForScrollCorner()) {
         const IntRect& scrollCorner = m_renderView.frameView().scrollCornerRect();
         context.save();
         context.translate(-scrollCorner.x(), -scrollCorner.y());
-        IntRect transformedClip = clip;
+        IntRect transformedClip = pixelSnappedRectForIntegralPositionedItems;
         transformedClip.moveBy(scrollCorner.location());
         m_renderView.frameView().paintScrollCorner(&context, transformedClip);
         context.restore();

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (163930 => 163931)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h	2014-02-12 03:28:43 UTC (rev 163931)
@@ -307,7 +307,7 @@
     // GraphicsLayerClient implementation
     virtual void notifyAnimationStarted(const GraphicsLayer*, double) override { }
     virtual void notifyFlushRequired(const GraphicsLayer*) override;
-    virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect&) override;
+    virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect&) override;
 
     virtual bool isTrackingRepaints() const override;
     

Modified: trunk/Source/WebKit/gtk/ChangeLog (163930 => 163931)


--- trunk/Source/WebKit/gtk/ChangeLog	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebKit/gtk/ChangeLog	2014-02-12 03:28:43 UTC (rev 163931)
@@ -1,3 +1,19 @@
+2014-02-11  Zalan Bujtas  <[email protected]>
+
+        Subpixel rendering: Make GraphicsLayerClient::paintContents's clip rect subpixel based.
+        https://bugs.webkit.org/show_bug.cgi?id=128460
+
+        Reviewed by Simon Fraser.
+
+        GraphicsClient::paintContents takes clipRect as FloatRect now so that we can paint on
+        subpixel position.
+
+        No change in functionality.
+
+        * WebCoreSupport/AcceleratedCompositingContext.h:
+        * WebCoreSupport/AcceleratedCompositingContextGL.cpp:
+        (WebKit::AcceleratedCompositingContext::paintContents):
+
 2014-02-10  Carlos Garcia Campos  <[email protected]>
 
         [GLIB] Add GUniqueOutPtr and use it instead of GOwnPtr

Modified: trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContext.h (163930 => 163931)


--- trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContext.h	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContext.h	2014-02-12 03:28:43 UTC (rev 163931)
@@ -19,6 +19,7 @@
 #ifndef AcceleratedCompositingContext_h
 #define AcceleratedCompositingContext_h
 
+#include "FloatRect.h"
 #include "GraphicsLayer.h"
 #include "GraphicsLayerClient.h"
 #include "IntRect.h"
@@ -58,7 +59,7 @@
     // GraphicsLayerClient
     virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time);
     virtual void notifyFlushRequired(const WebCore::GraphicsLayer*);
-    virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& rectToPaint);
+    virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& rectToPaint);
 
     void initialize();
 

Modified: trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContextGL.cpp (163930 => 163931)


--- trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContextGL.cpp	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContextGL.cpp	2014-02-12 03:28:43 UTC (rev 163931)
@@ -396,11 +396,11 @@
 
 }
 
-void AcceleratedCompositingContext::paintContents(const GraphicsLayer*, GraphicsContext& context, GraphicsLayerPaintingPhase, const IntRect& rectToPaint)
+void AcceleratedCompositingContext::paintContents(const GraphicsLayer*, GraphicsContext& context, GraphicsLayerPaintingPhase, const FloatRect& rectToPaint)
 {
     context.save();
     context.clip(rectToPaint);
-    core(m_webView)->mainFrame().view()->paint(&context, rectToPaint);
+    core(m_webView)->mainFrame().view()->paint(&context, enclosingIntRect(rectToPaint));
     context.restore();
 }
 

Modified: trunk/Source/WebKit/win/ChangeLog (163930 => 163931)


--- trunk/Source/WebKit/win/ChangeLog	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebKit/win/ChangeLog	2014-02-12 03:28:43 UTC (rev 163931)
@@ -1,3 +1,19 @@
+2014-02-11  Zalan Bujtas  <[email protected]>
+
+        Subpixel rendering: Make GraphicsLayerClient::paintContents's clip rect subpixel based.
+        https://bugs.webkit.org/show_bug.cgi?id=128460
+
+        Reviewed by Simon Fraser.
+
+        GraphicsClient::paintContents takes clipRect as FloatRect now so that we can paint on
+        subpixel position.
+
+        No change in functionality.
+
+        * WebView.cpp:
+        (WebView::paintContents):
+        * WebView.h:
+
 2014-02-11  Alex Christensen  <[email protected]>
 
         Fixed pointer truncation on Win64.

Modified: trunk/Source/WebKit/win/WebView.cpp (163930 => 163931)


--- trunk/Source/WebKit/win/WebView.cpp	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebKit/win/WebView.cpp	2014-02-12 03:28:43 UTC (rev 163931)
@@ -6730,7 +6730,7 @@
     flushPendingGraphicsLayerChangesSoon();
 }
 
-void WebView::paintContents(const GraphicsLayer*, GraphicsContext& context, GraphicsLayerPaintingPhase, const IntRect& inClip)
+void WebView::paintContents(const GraphicsLayer*, GraphicsContext& context, GraphicsLayerPaintingPhase, const FloatRect& inClip)
 {
     Frame* frame = core(m_mainFrame);
     if (!frame)
@@ -6738,7 +6738,7 @@
 
     context.save();
     context.clip(inClip);
-    frame->view()->paint(&context, inClip);
+    frame->view()->paint(&context, enclosingIntRect(inClip));
     context.restore();
 }
 

Modified: trunk/Source/WebKit/win/WebView.h (163930 => 163931)


--- trunk/Source/WebKit/win/WebView.h	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebKit/win/WebView.h	2014-02-12 03:28:43 UTC (rev 163931)
@@ -1019,7 +1019,7 @@
     // GraphicsLayerClient
     virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time);
     virtual void notifyFlushRequired(const WebCore::GraphicsLayer*);
-    virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& inClip);
+    virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& inClip);
 
     // CACFLayerTreeHostClient
     virtual void flushPendingGraphicsLayerChanges();

Modified: trunk/Source/WebKit2/ChangeLog (163930 => 163931)


--- trunk/Source/WebKit2/ChangeLog	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebKit2/ChangeLog	2014-02-12 03:28:43 UTC (rev 163931)
@@ -1,3 +1,25 @@
+2014-02-11  Zalan Bujtas  <[email protected]>
+
+        Subpixel rendering: Make GraphicsLayerClient::paintContents's clip rect subpixel based.
+        https://bugs.webkit.org/show_bug.cgi?id=128460
+
+        Reviewed by Simon Fraser.
+
+        GraphicsClient::paintContents takes clipRect as FloatRect now so that we can paint on
+        subpixel position.
+
+        No change in functionality.
+
+        * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
+        (WebKit::LayerTreeHostGtk::paintContents):
+        * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::paintContents):
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::paintContents):
+
 2014-02-11  Sam Weinig  <[email protected]>
 
         [WebKit2, JSC] Add user default to disable the JIT

Modified: trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp (163930 => 163931)


--- trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp	2014-02-12 03:28:43 UTC (rev 163931)
@@ -272,16 +272,16 @@
 {
 }
 
-void LayerTreeHostGtk::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const IntRect& clipRect)
+void LayerTreeHostGtk::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const FloatRect& clipRect)
 {
     if (graphicsLayer == m_nonCompositedContentLayer.get()) {
-        m_webPage->drawRect(graphicsContext, clipRect);
+        m_webPage->drawRect(graphicsContext, enclosingIntRect(clipRect));
         return;
     }
 
     for (auto& pageOverlayLayer : m_pageOverlayLayers) {
         if (pageOverlayLayer.value.get() == graphicsLayer) {
-            m_webPage->drawPageOverlay(pageOverlayLayer.key, graphicsContext, clipRect);
+            m_webPage->drawPageOverlay(pageOverlayLayer.key, graphicsContext, enclosingIntRect(clipRect));
             break;
         }
     }

Modified: trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h (163930 => 163931)


--- trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h	2014-02-12 03:28:43 UTC (rev 163931)
@@ -79,7 +79,7 @@
     // GraphicsLayerClient
     virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time);
     virtual void notifyFlushRequired(const WebCore::GraphicsLayer*);
-    virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect);
+    virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& clipRect);
     virtual void didCommitChangesForLayer(const WebCore::GraphicsLayer*) const { }
 
     void createPageOverlayLayer(PageOverlay*);

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h (163930 => 163931)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h	2014-02-12 03:28:43 UTC (rev 163931)
@@ -80,7 +80,7 @@
     // WebCore::GraphicsLayerClient
     virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time) override { }
     virtual void notifyFlushRequired(const WebCore::GraphicsLayer*) override { }
-    virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect) override;
+    virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& clipRect) override;
     virtual float deviceScaleFactor() const override;
     virtual void didCommitChangesForLayer(const WebCore::GraphicsLayer*) const override { }
 #if PLATFORM(IOS)

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm (163930 => 163931)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm	2014-02-12 03:28:43 UTC (rev 163931)
@@ -189,11 +189,11 @@
     scheduleCompositingLayerFlush();
 }
 
-void RemoteLayerTreeDrawingArea::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const IntRect& clipRect)
+void RemoteLayerTreeDrawingArea::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const FloatRect& clipRect)
 {
     for (const auto& overlayAndLayer : m_pageOverlayLayers) {
         if (overlayAndLayer.value.get() == graphicsLayer) {
-            m_webPage->drawPageOverlay(overlayAndLayer.key, graphicsContext, clipRect);
+            m_webPage->drawPageOverlay(overlayAndLayer.key, graphicsContext, enclosingIntRect(clipRect));
             break;
         }
     }

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h (163930 => 163931)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h	2014-02-12 03:28:43 UTC (rev 163931)
@@ -94,7 +94,7 @@
     // WebCore::GraphicsLayerClient
     virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time) override;
     virtual void notifyFlushRequired(const WebCore::GraphicsLayer*) override;
-    virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect) override;
+    virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::FloatRect& clipRect) override;
     virtual float deviceScaleFactor() const override;
     virtual void didCommitChangesForLayer(const WebCore::GraphicsLayer*) const override;
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (163930 => 163931)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2014-02-12 03:23:55 UTC (rev 163930)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2014-02-12 03:28:43 UTC (rev 163931)
@@ -356,11 +356,11 @@
 {
 }
 
-void TiledCoreAnimationDrawingArea::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const IntRect& clipRect)
+void TiledCoreAnimationDrawingArea::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, GraphicsLayerPaintingPhase, const FloatRect& clipRect)
 {
     for (auto it = m_pageOverlayLayers.begin(), end = m_pageOverlayLayers.end(); it != end; ++it) {
         if (it->value.get() == graphicsLayer) {
-            m_webPage->drawPageOverlay(it->key, graphicsContext, clipRect);
+            m_webPage->drawPageOverlay(it->key, graphicsContext, enclosingIntRect(clipRect));
             break;
         }
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to