<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[170563] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/170563">170563</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2014-06-27 18:34:27 -0700 (Fri, 27 Jun 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Subpixel rendering: Background clipping with subpixel behaves differently when composited.
https://bugs.webkit.org/show_bug.cgi?id=134422

Reviewed by Simon Fraser.

Adjust cliprect with the subpixel offset from the graphics layer the same way we do it for painting.
It ensures that cliprect starts from the right position when graphics layer is not on the same
coordinates as the associated render layer.

Source/WebCore:
Test: compositing/hidpi-compositing-layer-with-subpixel-offset-accumulation-clipping.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::clipToRect):
(WebCore::RenderLayer::paintLayer):
(WebCore::RenderLayer::applyFilters):
(WebCore::RenderLayer::paintTransformedLayerIntoFragments):
(WebCore::RenderLayer::paintBackgroundForFragments):
(WebCore::RenderLayer::paintForegroundForFragments):
(WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
(WebCore::RenderLayer::paintOutlineForFragments):
(WebCore::RenderLayer::paintMaskForFragments):
(WebCore::RenderLayer::paintOverflowControlsForFragments):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayer.h:

LayoutTests:
* compositing/hidpi-compositing-layer-with-subpixel-offset-accumulation-clipping-expected.html: Added.
* compositing/hidpi-compositing-layer-with-subpixel-offset-accumulation-clipping.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerh">trunk/Source/WebCore/rendering/RenderLayer.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscompositinghidpicompositinglayerwithsubpixeloffsetaccumulationclippingexpectedhtml">trunk/LayoutTests/compositing/hidpi-compositing-layer-with-subpixel-offset-accumulation-clipping-expected.html</a></li>
<li><a href="#trunkLayoutTestscompositinghidpicompositinglayerwithsubpixeloffsetaccumulationclippinghtml">trunk/LayoutTests/compositing/hidpi-compositing-layer-with-subpixel-offset-accumulation-clipping.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (170562 => 170563)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-06-28 00:19:41 UTC (rev 170562)
+++ trunk/LayoutTests/ChangeLog        2014-06-28 01:34:27 UTC (rev 170563)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-06-27  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
+        Subpixel rendering: Background clipping with subpixel behaves differently when composited.
+        https://bugs.webkit.org/show_bug.cgi?id=134422
+
+        Reviewed by Simon Fraser.
+
+        Adjust cliprect with the subpixel offset from the graphics layer the same way we do it for painting.
+        It ensures that cliprect starts from the right position when graphics layer is not on the same
+        coordinates as the associated render layer.
+
+        * compositing/hidpi-compositing-layer-with-subpixel-offset-accumulation-clipping-expected.html: Added.
+        * compositing/hidpi-compositing-layer-with-subpixel-offset-accumulation-clipping.html: Added.
+
</ins><span class="cx"> 2014-06-27  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed gardening; fix whitespace issues in the W3C Media Source expected results.
</span></span></pre></div>
<a id="trunkLayoutTestscompositinghidpicompositinglayerwithsubpixeloffsetaccumulationclippingexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/compositing/hidpi-compositing-layer-with-subpixel-offset-accumulation-clipping-expected.html (0 => 170563)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/compositing/hidpi-compositing-layer-with-subpixel-offset-accumulation-clipping-expected.html                                (rev 0)
+++ trunk/LayoutTests/compositing/hidpi-compositing-layer-with-subpixel-offset-accumulation-clipping-expected.html        2014-06-28 01:34:27 UTC (rev 170563)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;title&gt;This tests that clipping on composited layer works properly..&lt;/title&gt;
+    &lt;style&gt;
+        .container {
+            position: relative;
+            margin: 10px;
+            width: 200px;
+            height: 200px;
+            padding: 0.5px;
+            border: 0.5px solid black;
+            overflow: hidden;
+            display: inline-block;
+        }
+        
+        .contents {
+            width: 200px;
+            height: 300px;
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div class=&quot;container&quot;&gt;
+        &lt;div class=&quot;contents&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+
+    &lt;div class=&quot;container&quot; style=&quot;left: 0.3px; top: 0.3px;&quot;&gt;
+        &lt;div class=&quot;contents&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+
+    &lt;div class=&quot;container&quot; style=&quot;left: 0.15px; top: 0.15px;&quot;&gt;
+        &lt;div class=&quot;contents&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+
+    &lt;div class=&quot;container&quot; style=&quot;left: 0.6px; top: 0.6px;&quot;&gt;
+        &lt;div class=&quot;contents&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+
+    &lt;div class=&quot;container&quot; style=&quot;left: 0.8px; top: 0.8px;&quot;&gt;
+        &lt;div class=&quot;contents&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscompositinghidpicompositinglayerwithsubpixeloffsetaccumulationclippinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/compositing/hidpi-compositing-layer-with-subpixel-offset-accumulation-clipping.html (0 => 170563)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/compositing/hidpi-compositing-layer-with-subpixel-offset-accumulation-clipping.html                                (rev 0)
+++ trunk/LayoutTests/compositing/hidpi-compositing-layer-with-subpixel-offset-accumulation-clipping.html        2014-06-28 01:34:27 UTC (rev 170563)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;title&gt;This tests that clipping on composited layer works properly..&lt;/title&gt;
+    &lt;style&gt;
+        .container {
+            position: relative;
+            margin: 10px;
+            width: 200px;
+            height: 200px;
+            padding: 0.5px;
+            border: 0.5px solid black;
+            overflow: hidden;
+            -webkit-transform: translateZ(0);
+            display: inline-block;
+        }
+        
+        .contents {
+            width: 200px;
+            height: 300px;
+            background-color: blue;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div class=&quot;container&quot;&gt;
+        &lt;div class=&quot;contents&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+
+    &lt;div class=&quot;container&quot; style=&quot;left: 0.3px; top: 0.3px;&quot;&gt;
+        &lt;div class=&quot;contents&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+
+    &lt;div class=&quot;container&quot; style=&quot;left: 0.15px; top: 0.15px;&quot;&gt;
+        &lt;div class=&quot;contents&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+
+    &lt;div class=&quot;container&quot; style=&quot;left: 0.6px; top: 0.6px;&quot;&gt;
+        &lt;div class=&quot;contents&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+
+    &lt;div class=&quot;container&quot; style=&quot;left: 0.8px; top: 0.8px;&quot;&gt;
+        &lt;div class=&quot;contents&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (170562 => 170563)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-06-28 00:19:41 UTC (rev 170562)
+++ trunk/Source/WebCore/ChangeLog        2014-06-28 01:34:27 UTC (rev 170563)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2014-06-27  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
+        Subpixel rendering: Background clipping with subpixel behaves differently when composited.
+        https://bugs.webkit.org/show_bug.cgi?id=134422
+
+        Reviewed by Simon Fraser.
+
+        Adjust cliprect with the subpixel offset from the graphics layer the same way we do it for painting.
+        It ensures that cliprect starts from the right position when graphics layer is not on the same
+        coordinates as the associated render layer.
+
+        Test: compositing/hidpi-compositing-layer-with-subpixel-offset-accumulation-clipping.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::clipToRect):
+        (WebCore::RenderLayer::paintLayer):
+        (WebCore::RenderLayer::applyFilters):
+        (WebCore::RenderLayer::paintTransformedLayerIntoFragments):
+        (WebCore::RenderLayer::paintBackgroundForFragments):
+        (WebCore::RenderLayer::paintForegroundForFragments):
+        (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
+        (WebCore::RenderLayer::paintOutlineForFragments):
+        (WebCore::RenderLayer::paintMaskForFragments):
+        (WebCore::RenderLayer::paintOverflowControlsForFragments):
+        (WebCore::RenderLayer::calculateClipRects):
+        * rendering/RenderLayer.h:
+
</ins><span class="cx"> 2014-06-27  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win] Implement parts of the AVFOUNDATION_LOADER_DELEGATE logic for Windows
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (170562 => 170563)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-06-28 00:19:41 UTC (rev 170562)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-06-28 01:34:27 UTC (rev 170563)
</span><span class="lines">@@ -3563,13 +3563,14 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderLayer::clipToRect(RenderLayer* rootLayer, GraphicsContext* context, const LayoutRect&amp; paintDirtyRect, const ClipRect&amp; clipRect,
-                             BorderRadiusClippingRule rule)
</del><ins>+void RenderLayer::clipToRect(const LayerPaintingInfo&amp; paintingInfo, GraphicsContext* context, const ClipRect&amp; clipRect, BorderRadiusClippingRule rule)
</ins><span class="cx"> {
</span><span class="cx">     float deviceScaleFactor = renderer().document().deviceScaleFactor();
</span><del>-    if (clipRect.rect() != paintDirtyRect || clipRect.hasRadius()) {
</del><ins>+    if (clipRect.rect() != paintingInfo.paintDirtyRect || clipRect.hasRadius()) {
</ins><span class="cx">         context-&gt;save();
</span><del>-        context-&gt;clip(pixelSnappedForPainting(clipRect.rect(), deviceScaleFactor));
</del><ins>+        LayoutRect adjustedClipRect = clipRect.rect();
+        adjustedClipRect.move(paintingInfo.subPixelAccumulation);
+        context-&gt;clip(pixelSnappedForPainting(adjustedClipRect, deviceScaleFactor));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!clipRect.hasRadius())
</span><span class="lines">@@ -3580,10 +3581,12 @@
</span><span class="cx">     // containing block chain so we check that also.
</span><span class="cx">     for (RenderLayer* layer = rule == IncludeSelfForBorderRadius ? this : parent(); layer; layer = layer-&gt;parent()) {
</span><span class="cx">         if (layer-&gt;renderer().hasOverflowClip() &amp;&amp; layer-&gt;renderer().style().hasBorderRadius() &amp;&amp; inContainingBlockChain(this, layer)) {
</span><del>-            context-&gt;clipRoundedRect(layer-&gt;renderer().style().getRoundedInnerBorderFor(LayoutRect(toLayoutPoint(layer-&gt;offsetFromAncestor(rootLayer)), layer-&gt;size())).pixelSnappedRoundedRectForPainting(deviceScaleFactor));
</del><ins>+            LayoutRect adjustedClipRect = LayoutRect(toLayoutPoint(layer-&gt;offsetFromAncestor(paintingInfo.rootLayer)), layer-&gt;size());
+            adjustedClipRect.move(paintingInfo.subPixelAccumulation);
+            context-&gt;clipRoundedRect(layer-&gt;renderer().style().getRoundedInnerBorderFor(adjustedClipRect).pixelSnappedRoundedRectForPainting(deviceScaleFactor));
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (layer == rootLayer)
</del><ins>+        if (layer == paintingInfo.rootLayer)
</ins><span class="cx">             break;
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -3717,7 +3720,7 @@
</span><span class="cx">             clipRect.intersect(paintingInfo.paintDirtyRect);
</span><span class="cx">         
</span><span class="cx">             // Push the parent coordinate space's clip.
</span><del>-            parent()-&gt;clipToRect(paintingInfo.rootLayer, context, paintingInfo.paintDirtyRect, clipRect);
</del><ins>+            parent()-&gt;clipToRect(paintingInfo, context, clipRect);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         paintLayerByApplyingTransform(context, paintingInfo, paintFlags);
</span><span class="lines">@@ -3908,7 +3911,7 @@
</span><span class="cx">     // Apply the correct clipping (ie. overflow: hidden).
</span><span class="cx">     // FIXME: It is incorrect to just clip to the damageRect here once multiple fragments are involved.
</span><span class="cx">     ClipRect backgroundRect = layerFragments.isEmpty() ? ClipRect() : layerFragments[0].backgroundRect;
</span><del>-    clipToRect(paintingInfo.rootLayer, originalContext, paintingInfo.paintDirtyRect, backgroundRect);
</del><ins>+    clipToRect(paintingInfo, originalContext, backgroundRect);
</ins><span class="cx">     filterPainter-&gt;applyFilterEffect(originalContext);
</span><span class="cx">     restoreClip(originalContext, paintingInfo.paintDirtyRect, backgroundRect);
</span><span class="cx">     return originalContext;
</span><span class="lines">@@ -4358,7 +4361,7 @@
</span><span class="cx">             clipRect.intersect(parentClipRect);
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        parent()-&gt;clipToRect(paintingInfo.rootLayer, context, paintingInfo.paintDirtyRect, clipRect);
</del><ins>+        parent()-&gt;clipToRect(paintingInfo, context, clipRect);
</ins><span class="cx">         paintLayerByApplyingTransform(context, paintingInfo, paintFlags, fragment.paginationOffset);
</span><span class="cx">         parent()-&gt;restoreClip(context, paintingInfo.paintDirtyRect, clipRect);
</span><span class="cx">     }
</span><span class="lines">@@ -4380,7 +4383,7 @@
</span><span class="cx">         if (localPaintingInfo.clipToDirtyRect) {
</span><span class="cx">             // Paint our background first, before painting any child layers.
</span><span class="cx">             // Establish the clip used to paint our background.
</span><del>-            clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.paintDirtyRect, fragment.backgroundRect, DoNotIncludeSelfForBorderRadius); // Background painting will handle clipping to self.
</del><ins>+            clipToRect(localPaintingInfo, context, fragment.backgroundRect, DoNotIncludeSelfForBorderRadius); // Background painting will handle clipping to self.
</ins><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         // Paint the background.
</span><span class="lines">@@ -4415,7 +4418,7 @@
</span><span class="cx">     ClipRect clippedRect;
</span><span class="cx">     if (shouldClip) {
</span><span class="cx">         clippedRect = layerFragments[0].foregroundRect;
</span><del>-        clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.paintDirtyRect, clippedRect);
</del><ins>+        clipToRect(localPaintingInfo, context, clippedRect);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     // We have to loop through every fragment multiple times, since we have to repaint in each specific phase in order for
</span><span class="lines">@@ -4433,7 +4436,7 @@
</span><span class="cx">             
</span><span class="cx">             if (!layerFragments[0].outlineRect.isEmpty()) {
</span><span class="cx">                 clippedRect = layerFragments[0].outlineRect;
</span><del>-                clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.paintDirtyRect, clippedRect);
</del><ins>+                clipToRect(localPaintingInfo, context, clippedRect);
</ins><span class="cx">             } else
</span><span class="cx">                 shouldClip = false;
</span><span class="cx">         }
</span><span class="lines">@@ -4456,7 +4459,7 @@
</span><span class="cx">             continue;
</span><span class="cx">         
</span><span class="cx">         if (shouldClip)
</span><del>-            clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.paintDirtyRect, fragment.foregroundRect);
</del><ins>+            clipToRect(localPaintingInfo, context, fragment.foregroundRect);
</ins><span class="cx">     
</span><span class="cx">         PaintInfo paintInfo(context, fragment.foregroundRect.rect(), phase, paintBehavior, subtreePaintRootForRenderer, nullptr, nullptr, &amp;localPaintingInfo.rootLayer-&gt;renderer());
</span><span class="cx">         if (phase == PaintPhaseForeground)
</span><span class="lines">@@ -4478,7 +4481,7 @@
</span><span class="cx">     
</span><span class="cx">         // Paint our own outline
</span><span class="cx">         PaintInfo paintInfo(context, fragment.outlineRect.rect(), PaintPhaseSelfOutline, paintBehavior, subtreePaintRootForRenderer, nullptr, nullptr, &amp;localPaintingInfo.rootLayer-&gt;renderer());
</span><del>-        clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.paintDirtyRect, fragment.outlineRect, DoNotIncludeSelfForBorderRadius);
</del><ins>+        clipToRect(localPaintingInfo, context, fragment.outlineRect, DoNotIncludeSelfForBorderRadius);
</ins><span class="cx">         renderer().paint(paintInfo, toLayoutPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subPixelAccumulation));
</span><span class="cx">         restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.outlineRect);
</span><span class="cx">     }
</span><span class="lines">@@ -4493,7 +4496,7 @@
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         if (localPaintingInfo.clipToDirtyRect)
</span><del>-            clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.paintDirtyRect, fragment.backgroundRect, DoNotIncludeSelfForBorderRadius); // Mask painting will handle clipping to self.
</del><ins>+            clipToRect(localPaintingInfo, context, fragment.backgroundRect, DoNotIncludeSelfForBorderRadius); // Mask painting will handle clipping to self.
</ins><span class="cx">         
</span><span class="cx">         // Paint the mask.
</span><span class="cx">         // FIXME: Eventually we will collect the region from the fragment itself instead of just from the paint info.
</span><span class="lines">@@ -4509,7 +4512,7 @@
</span><span class="cx"> {
</span><span class="cx">     for (size_t i = 0; i &lt; layerFragments.size(); ++i) {
</span><span class="cx">         const LayerFragment&amp; fragment = layerFragments.at(i);
</span><del>-        clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.paintDirtyRect, fragment.backgroundRect);
</del><ins>+        clipToRect(localPaintingInfo, context, fragment.backgroundRect);
</ins><span class="cx">         paintOverflowControls(context, roundedIntPoint(toLayoutPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subPixelAccumulation)),
</span><span class="cx">             pixelSnappedIntRect(fragment.backgroundRect.rect()), true);
</span><span class="cx">         restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.backgroundRect);
</span><span class="lines">@@ -6696,7 +6699,7 @@
</span><span class="cx">         bool shouldClip = (clipRect != LayoutRect::infiniteRect());
</span><span class="cx">         // Optimize clipping for the single fragment case.
</span><span class="cx">         if (shouldClip)
</span><del>-            clipToRect(paintingInfo.rootLayer, context, paintingInfo.paintDirtyRect, clipRect);
</del><ins>+            clipToRect(paintingInfo, context, clipRect);
</ins><span class="cx"> 
</span><span class="cx">         flowThreadLayer-&gt;paintNamedFlowThreadInsideRegion(context, flowFragment, paintingInfo.paintDirtyRect, fragment.layerBounds.location() + paintingInfo.subPixelAccumulation, paintingInfo.paintBehavior, paintFlags);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.h (170562 => 170563)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.h        2014-06-28 00:19:41 UTC (rev 170562)
+++ trunk/Source/WebCore/rendering/RenderLayer.h        2014-06-28 01:34:27 UTC (rev 170563)
</span><span class="lines">@@ -891,6 +891,25 @@
</span><span class="cx"> private:
</span><span class="cx">     enum CollectLayersBehavior { StopAtStackingContexts, StopAtStackingContainers };
</span><span class="cx"> 
</span><ins>+    struct LayerPaintingInfo {
+        LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect&amp; inDirtyRect, PaintBehavior inPaintBehavior, const LayoutSize&amp; inSubPixelAccumulation, RenderObject* inSubtreePaintRoot = nullptr, OverlapTestRequestMap* inOverlapTestRequests = nullptr)
+            : rootLayer(inRootLayer)
+            , subtreePaintRoot(inSubtreePaintRoot)
+            , paintDirtyRect(inDirtyRect)
+            , subPixelAccumulation(inSubPixelAccumulation)
+            , overlapTestRequests(inOverlapTestRequests)
+            , paintBehavior(inPaintBehavior)
+            , clipToDirtyRect(true)
+        { }
+        RenderLayer* rootLayer;
+        RenderObject* subtreePaintRoot; // only paint descendants of this object
+        LayoutRect paintDirtyRect; // relative to rootLayer;
+        LayoutSize subPixelAccumulation;
+        OverlapTestRequestMap* overlapTestRequests; // May be null.
+        PaintBehavior paintBehavior;
+        bool clipToDirtyRect;
+    };
+
</ins><span class="cx">     void updateZOrderLists();
</span><span class="cx">     void rebuildZOrderLists();
</span><span class="cx">     void rebuildZOrderLists(CollectLayersBehavior, std::unique_ptr&lt;Vector&lt;RenderLayer*&gt;&gt;&amp;, std::unique_ptr&lt;Vector&lt;RenderLayer*&gt;&gt;&amp;);
</span><span class="lines">@@ -915,8 +934,7 @@
</span><span class="cx">     void computeRepaintRectsIncludingDescendants();
</span><span class="cx">     void clearRepaintRects();
</span><span class="cx"> 
</span><del>-    void clipToRect(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect&amp; paintDirtyRect, const ClipRect&amp;,
-                    BorderRadiusClippingRule = IncludeSelfForBorderRadius);
</del><ins>+    void clipToRect(const LayerPaintingInfo&amp;, GraphicsContext*, const ClipRect&amp;, BorderRadiusClippingRule = IncludeSelfForBorderRadius);
</ins><span class="cx">     void restoreClip(GraphicsContext*, const LayoutRect&amp; paintDirtyRect, const ClipRect&amp;);
</span><span class="cx"> 
</span><span class="cx">     bool shouldRepaintAfterLayout() const;
</span><span class="lines">@@ -967,25 +985,6 @@
</span><span class="cx"> 
</span><span class="cx">     void updateCompositingAndLayerListsIfNeeded();
</span><span class="cx"> 
</span><del>-    struct LayerPaintingInfo {
-        LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect&amp; inDirtyRect, PaintBehavior inPaintBehavior, const LayoutSize&amp; inSubPixelAccumulation, RenderObject* inSubtreePaintRoot = nullptr, OverlapTestRequestMap* inOverlapTestRequests = nullptr)
-            : rootLayer(inRootLayer)
-            , subtreePaintRoot(inSubtreePaintRoot)
-            , paintDirtyRect(inDirtyRect)
-            , subPixelAccumulation(inSubPixelAccumulation)
-            , overlapTestRequests(inOverlapTestRequests)
-            , paintBehavior(inPaintBehavior)
-            , clipToDirtyRect(true)
-        { }
-        RenderLayer* rootLayer;
-        RenderObject* subtreePaintRoot; // only paint descendants of this object
-        LayoutRect paintDirtyRect; // relative to rootLayer;
-        LayoutSize subPixelAccumulation;
-        OverlapTestRequestMap* overlapTestRequests; // May be null.
-        PaintBehavior paintBehavior;
-        bool clipToDirtyRect;
-    };
-
</del><span class="cx">     bool setupFontSubpixelQuantization(GraphicsContext*, bool&amp; didQuantizeFonts);
</span><span class="cx">     bool setupClipPath(GraphicsContext*, const LayerPaintingInfo&amp;, const LayoutSize&amp; offsetFromRoot, LayoutRect&amp; rootRelativeBounds, bool&amp; rootRelativeBoundsComputed);
</span><span class="cx"> #if ENABLE(CSS_FILTERS)
</span></span></pre>
</div>
</div>

</body>
</html>