Title: [164412] trunk/Source
Revision
164412
Author
[email protected]
Date
2014-02-19 20:13:28 -0800 (Wed, 19 Feb 2014)

Log Message

Subpixel rendering: Make GraphicsLayer::paintGraphicsLayerContents()'s cliprect FloatRect based.
https://bugs.webkit.org/show_bug.cgi?id=128911

Reviewed by Simon Fraser.

Switching from IntRect to FloatRect makes device pixel position clipping possible.

Covered by existing tests.

* WebCore.exp.in:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::paintGraphicsLayerContents):
* platform/graphics/GraphicsLayer.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::platformCALayerPaintContents):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayerClient.h:
* platform/graphics/ca/mac/TileController.h:
* platform/graphics/ca/mac/TileController.mm:
(WebCore::TileController::platformCALayerPaintContents):
* platform/graphics/mac/WebLayer.mm:
(WebCore::drawLayerContents):
(-[WebSimpleLayer drawInContext:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (164411 => 164412)


--- trunk/Source/WebCore/ChangeLog	2014-02-20 03:39:17 UTC (rev 164411)
+++ trunk/Source/WebCore/ChangeLog	2014-02-20 04:13:28 UTC (rev 164412)
@@ -1,5 +1,31 @@
 2014-02-19  Zalan Bujtas  <[email protected]>
 
+        Subpixel rendering: Make GraphicsLayer::paintGraphicsLayerContents()'s cliprect FloatRect based.
+        https://bugs.webkit.org/show_bug.cgi?id=128911
+
+        Reviewed by Simon Fraser.
+
+        Switching from IntRect to FloatRect makes device pixel position clipping possible.
+
+        Covered by existing tests.
+
+        * WebCore.exp.in:
+        * platform/graphics/GraphicsLayer.cpp:
+        (WebCore::GraphicsLayer::paintGraphicsLayerContents):
+        * platform/graphics/GraphicsLayer.h:
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::platformCALayerPaintContents):
+        * platform/graphics/ca/GraphicsLayerCA.h:
+        * platform/graphics/ca/PlatformCALayerClient.h:
+        * platform/graphics/ca/mac/TileController.h:
+        * platform/graphics/ca/mac/TileController.mm:
+        (WebCore::TileController::platformCALayerPaintContents):
+        * platform/graphics/mac/WebLayer.mm:
+        (WebCore::drawLayerContents):
+        (-[WebSimpleLayer drawInContext:]):
+
+2014-02-19  Zalan Bujtas  <[email protected]>
+
         Subpixel rendering: (RenderLayer)Pass non-css-pixel-snapped dirty rects to PaintInfo when painting renderer().
         https://bugs.webkit.org/show_bug.cgi?id=128913
 

Modified: trunk/Source/WebCore/WebCore.exp.in (164411 => 164412)


--- trunk/Source/WebCore/WebCore.exp.in	2014-02-20 03:39:17 UTC (rev 164411)
+++ trunk/Source/WebCore/WebCore.exp.in	2014-02-20 04:13:28 UTC (rev 164412)
@@ -566,7 +566,7 @@
 __ZN7WebCore15GraphicsLayerCA23setContentsToSolidColorERKNS_5ColorE
 __ZN7WebCore15GraphicsLayerCA23setDebugBackgroundColorERKNS_5ColorE
 __ZN7WebCore15GraphicsLayerCA26setMaintainsPixelAlignmentEb
-__ZN7WebCore15GraphicsLayerCA28platformCALayerPaintContentsEPNS_15PlatformCALayerERNS_15GraphicsContextERKNS_7IntRectE
+__ZN7WebCore15GraphicsLayerCA28platformCALayerPaintContentsEPNS_15PlatformCALayerERNS_15GraphicsContextERKNS_9FloatRectE
 __ZN7WebCore15GraphicsLayerCA30deviceOrPageScaleFactorChangedEv
 __ZN7WebCore15GraphicsLayerCA31platformCALayerAnimationStartedEd
 __ZN7WebCore15GraphicsLayerCA37flushCompositingStateForThisLayerOnlyEv
@@ -1884,7 +1884,7 @@
 __ZTVN7WebCore28InspectorFrontendClientLocal8SettingsE
 __ZTVN7WebCore31BasicColorMatrixFilterOperationE
 __ZTVN7WebCore37BasicComponentTransferFilterOperationE
-__ZThn???_N7WebCore15GraphicsLayerCA28platformCALayerPaintContentsEPNS_15PlatformCALayerERNS_15GraphicsContextERKNS_7IntRectE
+__ZThn???_N7WebCore15GraphicsLayerCA28platformCALayerPaintContentsEPNS_15PlatformCALayerERNS_15GraphicsContextERKNS_9FloatRectE
 __ZThn???_N7WebCore15GraphicsLayerCA31platformCALayerAnimationStartedEd
 __ZThn???_N7WebCore15GraphicsLayerCA40platformCALayerSetNeedsToRevalidateTilesEv
 __ZThn???_NK7WebCore15GraphicsLayerCA32platformCALayerDeviceScaleFactorEv

Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp (164411 => 164412)


--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp	2014-02-20 03:39:17 UTC (rev 164411)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp	2014-02-20 04:13:28 UTC (rev 164412)
@@ -324,13 +324,13 @@
     m_backgroundColor = color;
 }
 
-void GraphicsLayer::paintGraphicsLayerContents(GraphicsContext& context, const IntRect& clip)
+void GraphicsLayer::paintGraphicsLayerContents(GraphicsContext& context, const FloatRect& clip)
 {
     if (m_client) {
         IntSize offset = offsetFromRenderer();
         context.translate(-offset);
 
-        IntRect clipRect(clip);
+        FloatRect clipRect(clip);
         clipRect.move(offset);
 
         m_client->paintContents(this, context, m_paintingPhase, clipRect);

Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (164411 => 164412)


--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h	2014-02-20 03:39:17 UTC (rev 164411)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h	2014-02-20 04:13:28 UTC (rev 164412)
@@ -411,7 +411,7 @@
     virtual bool hasContentsLayer() const { return false; }
 
     // Callback from the underlying graphics system to draw layer contents.
-    void paintGraphicsLayerContents(GraphicsContext&, const IntRect& clip);
+    void paintGraphicsLayerContents(GraphicsContext&, const FloatRect& clip);
     // Callback from the underlying graphics system when the layer has been displayed
     virtual void layerDidDisplay(PlatformLayer*) { }
     

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (164411 => 164412)


--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2014-02-20 03:39:17 UTC (rev 164411)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp	2014-02-20 04:13:28 UTC (rev 164412)
@@ -186,7 +186,7 @@
 
     virtual void platformCALayerAnimationStarted(CFTimeInterval beginTime) { }
     virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const { return GraphicsLayer::CompositingCoordinatesBottomUp; }
-    virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const IntRect& inClip) { }
+    virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&) { }
     virtual bool platformCALayerShowDebugBorders() const { return false; }
     virtual bool platformCALayerShowRepaintCounter(PlatformCALayer*) const { return false; }
     virtual int platformCALayerIncrementRepaintCount(PlatformCALayer*) { return 0; }

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (164411 => 164412)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2014-02-20 03:39:17 UTC (rev 164411)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2014-02-20 04:13:28 UTC (rev 164412)
@@ -1274,7 +1274,7 @@
     return isShowingRepaintCounter();
 }
 
-void GraphicsLayerCA::platformCALayerPaintContents(PlatformCALayer*, GraphicsContext& context, const IntRect& clip)
+void GraphicsLayerCA::platformCALayerPaintContents(PlatformCALayer*, GraphicsContext& context, const FloatRect& clip)
 {
     paintGraphicsLayerContents(context, clip);
 }

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (164411 => 164412)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h	2014-02-20 03:39:17 UTC (rev 164411)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h	2014-02-20 04:13:28 UTC (rev 164412)
@@ -181,7 +181,7 @@
 
     virtual void platformCALayerAnimationStarted(CFTimeInterval beginTime);
     virtual CompositingCoordinatesOrientation platformCALayerContentsOrientation() const { return contentsOrientation(); }
-    virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const IntRect& clip);
+    virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect& clip);
     virtual bool platformCALayerShowDebugBorders() const { return isShowingDebugBorder(); }
     virtual bool platformCALayerShowRepaintCounter(PlatformCALayer*) const;
     virtual int platformCALayerIncrementRepaintCount(PlatformCALayer*) { return incrementRepaintCount(); }

Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h (164411 => 164412)


--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h	2014-02-20 03:39:17 UTC (rev 164411)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h	2014-02-20 04:13:28 UTC (rev 164412)
@@ -48,7 +48,7 @@
 
     virtual void platformCALayerAnimationStarted(CFTimeInterval beginTime) = 0;
     virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const = 0;
-    virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const IntRect& inClip) = 0;
+    virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect& inClip) = 0;
     virtual bool platformCALayerShowDebugBorders() const = 0;
     virtual bool platformCALayerShowRepaintCounter(PlatformCALayer*) const = 0;
     virtual int platformCALayerIncrementRepaintCount(PlatformCALayer*) = 0;

Modified: trunk/Source/WebCore/platform/graphics/ca/mac/TileController.h (164411 => 164412)


--- trunk/Source/WebCore/platform/graphics/ca/mac/TileController.h	2014-02-20 03:39:17 UTC (rev 164411)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/TileController.h	2014-02-20 04:13:28 UTC (rev 164412)
@@ -138,7 +138,7 @@
     virtual bool platformCALayerRespondsToLayoutChanges() const override { return false; }
     virtual void platformCALayerAnimationStarted(CFTimeInterval) override { }
     virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const override { return GraphicsLayer::CompositingCoordinatesTopDown; }
-    virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const IntRect&) override;
+    virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&) override;
     virtual bool platformCALayerShowDebugBorders() const override;
     virtual bool platformCALayerShowRepaintCounter(PlatformCALayer*) const override;
     virtual int platformCALayerIncrementRepaintCount(PlatformCALayer*) override;

Modified: trunk/Source/WebCore/platform/graphics/ca/mac/TileController.mm (164411 => 164412)


--- trunk/Source/WebCore/platform/graphics/ca/mac/TileController.mm	2014-02-20 03:39:17 UTC (rev 164411)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/TileController.mm	2014-02-20 04:13:28 UTC (rev 164412)
@@ -171,7 +171,7 @@
         tileInfo.hasStaleContent = true;
 }
 
-void TileController::platformCALayerPaintContents(PlatformCALayer* platformCALayer, GraphicsContext& context, const IntRect&)
+void TileController::platformCALayerPaintContents(PlatformCALayer* platformCALayer, GraphicsContext& context, const FloatRect&)
 {
 #if PLATFORM(IOS)
     if (pthread_main_np())

Modified: trunk/Source/WebCore/platform/graphics/mac/WebLayer.mm (164411 => 164412)


--- trunk/Source/WebCore/platform/graphics/mac/WebLayer.mm	2014-02-20 03:39:17 UTC (rev 164411)
+++ trunk/Source/WebCore/platform/graphics/mac/WebLayer.mm	2014-02-20 04:13:28 UTC (rev 164412)
@@ -134,7 +134,7 @@
         GraphicsContextStateSaver stateSaver(graphicsContext);
         graphicsContext.clip(rect);
 
-        layerContents->platformCALayerPaintContents(platformCALayer, graphicsContext, enclosingIntRect(rect));
+        layerContents->platformCALayerPaintContents(platformCALayer, graphicsContext, rect);
     }
 
 #if PLATFORM(IOS)
@@ -274,7 +274,7 @@
         graphicsContext.setIsAcceleratedContext(layer->acceleratesDrawing());
 
         FloatRect clipBounds = CGContextGetClipBoundingBox(context);
-        layer->owner()->platformCALayerPaintContents(layer, graphicsContext, enclosingIntRect(clipBounds));
+        layer->owner()->platformCALayerPaintContents(layer, graphicsContext, clipBounds);
     }
 }
 

Modified: trunk/Source/WebKit/win/FullscreenVideoController.cpp (164411 => 164412)


--- trunk/Source/WebKit/win/FullscreenVideoController.cpp	2014-02-20 03:39:17 UTC (rev 164411)
+++ trunk/Source/WebKit/win/FullscreenVideoController.cpp	2014-02-20 04:13:28 UTC (rev 164412)
@@ -186,7 +186,7 @@
 
     virtual void platformCALayerAnimationStarted(CFTimeInterval beginTime) { }
     virtual GraphicsLayer::CompositingCoordinatesOrientation platformCALayerContentsOrientation() const { return GraphicsLayer::CompositingCoordinatesBottomUp; }
-    virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const IntRect& inClip) { }
+    virtual void platformCALayerPaintContents(PlatformCALayer*, GraphicsContext&, const FloatRect&) { }
     virtual bool platformCALayerShowDebugBorders() const { return false; }
     virtual bool platformCALayerShowRepaintCounter(PlatformCALayer*) const { return false; }
     virtual int platformCALayerIncrementRepaintCount(PlatformCALayer*) { return 0; }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to