<!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>[165341] 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/165341">165341</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2014-03-08 16:14:00 -0800 (Sat, 08 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Subpixel rendering: Simple compositing container layer (isSimpleContainerCompositingLayer) paints to wrong position.
https://bugs.webkit.org/show_bug.cgi?id=129861

Reviewed by Simon Fraser.

This patch ensures that both the simple and non-simple cases paint to the same position.
Simple compositing container layer codepath needs to take the fractional device pixel offset
into account when painting. Without the fractional value, the final paint rounding could push the
paint offset to a different position.
retina example:
compositing top-left: 0px 0px.
fractional offset: 0.3px 0.3px
painting coords without offseting: 0px 0px
                   with offseting: 0.5px 0.5px

Source/WebCore:

Tests: compositing/hidpi-simple-container-layer-on-device-pixel.html

* WebCore.exp.in:
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::contentsRect):
(WebCore::GraphicsLayer::setContentsRect):
(WebCore::GraphicsLayer::contentsClippingRect):
(WebCore::GraphicsLayer::setContentsClippingRect):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setContentsRect):
(WebCore::GraphicsLayerCA::setContentsClippingRect):
(WebCore::GraphicsLayerCA::updateContentsRects):
* platform/graphics/ca/GraphicsLayerCA.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
(WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor):
(WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage):
(WebCore::RenderLayerBacking::contentOffsetInCompostingLayer):
(WebCore::RenderLayerBacking::backgroundBoxForPainting):
* rendering/RenderLayerBacking.h:

LayoutTests:

* compositing/hidpi-simple-container-layer-on-device-pixel-expected.html: Added.
* compositing/hidpi-simple-container-layer-on-device-pixel.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="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsLayerh">trunk/Source/WebCore/platform/graphics/GraphicsLayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp">trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAh">trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstexmapGraphicsLayerTextureMappercpp">trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstexmapGraphicsLayerTextureMapperh">trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstexmapTextureMapperLayercpp">trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstexmapTextureMapperLayerh">trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstexmapcoordinatedCoordinatedGraphicsLayercpp">trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstexmapcoordinatedCoordinatedGraphicsLayerh">trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstexmapcoordinatedCoordinatedGraphicsStateh">trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerBackingcpp">trunk/Source/WebCore/rendering/RenderLayerBacking.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerBackingh">trunk/Source/WebCore/rendering/RenderLayerBacking.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscompositinghidpisimplecontainerlayerondevicepixelexpectedhtml">trunk/LayoutTests/compositing/hidpi-simple-container-layer-on-device-pixel-expected.html</a></li>
<li><a href="#trunkLayoutTestscompositinghidpisimplecontainerlayerondevicepixelhtml">trunk/LayoutTests/compositing/hidpi-simple-container-layer-on-device-pixel.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (165340 => 165341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-03-08 22:33:43 UTC (rev 165340)
+++ trunk/LayoutTests/ChangeLog        2014-03-09 00:14:00 UTC (rev 165341)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2014-03-08  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
+        Subpixel rendering: Simple compositing container layer (isSimpleContainerCompositingLayer) paints to wrong position.
+        https://bugs.webkit.org/show_bug.cgi?id=129861
+
+        Reviewed by Simon Fraser.
+
+        This patch ensures that both the simple and non-simple cases paint to the same position.
+        Simple compositing container layer codepath needs to take the fractional device pixel offset
+        into account when painting. Without the fractional value, the final paint rounding could push the
+        paint offset to a different position.
+        retina example:
+        compositing top-left: 0px 0px.
+        fractional offset: 0.3px 0.3px
+        painting coords without offseting: 0px 0px
+                           with offseting: 0.5px 0.5px
+
+        * compositing/hidpi-simple-container-layer-on-device-pixel-expected.html: Added.
+        * compositing/hidpi-simple-container-layer-on-device-pixel.html: Added.
+
</ins><span class="cx"> 2014-03-08  Martin Robinson  &lt;mrobinson@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Skip tests on GTK+ for unimplemented features
</span></span></pre></div>
<a id="trunkLayoutTestscompositinghidpisimplecontainerlayerondevicepixelexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/compositing/hidpi-simple-container-layer-on-device-pixel-expected.html (0 => 165341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/compositing/hidpi-simple-container-layer-on-device-pixel-expected.html                                (rev 0)
+++ trunk/LayoutTests/compositing/hidpi-simple-container-layer-on-device-pixel-expected.html        2014-03-09 00:14:00 UTC (rev 165341)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;This tests that simple compositing container layer takes fractional device pixel into account when painting.
+Simple and non-simple codepath should paint on the same positions.&lt;/title&gt;
+&lt;head&gt;
+&lt;style&gt;
+  div {
+    background: green;
+    width: 10px;
+    height: 10px;
+    position: absolute;
+  }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p id=&quot;container&quot;&gt;&lt;/p&gt;
+&lt;script&gt;
+  var container = document.getElementById(&quot;container&quot;);
+  adjustment = 0.1;
+  for (i = 0; i &lt; 10; ++i) {
+    adjustment+=0.1;
+    for (j = 0; j &lt; 10; ++j) {
+      var e = document.createElement(&quot;div&quot;);
+      e.style.top = (11 * i + j * adjustment) + &quot;px&quot;;
+      e.style.left = (11 * j + i * adjustment) + &quot;px&quot;;
+      container.appendChild(e);
+    }
+  }
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscompositinghidpisimplecontainerlayerondevicepixelhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/compositing/hidpi-simple-container-layer-on-device-pixel.html (0 => 165341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/compositing/hidpi-simple-container-layer-on-device-pixel.html                                (rev 0)
+++ trunk/LayoutTests/compositing/hidpi-simple-container-layer-on-device-pixel.html        2014-03-09 00:14:00 UTC (rev 165341)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;This tests that simple compositing container layer takes fractional device pixel into account when painting.
+Simple and non-simple codepath should paint on the same positions.&lt;/title&gt;
+&lt;head&gt;
+&lt;style&gt;
+  div {
+    background: green;
+    width: 10px;
+    height: 10px;
+    position: absolute;
+    -webkit-transform: translateZ(0);
+  }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p id=&quot;container&quot;&gt;&lt;/p&gt;
+&lt;script&gt;
+  var container = document.getElementById(&quot;container&quot;);
+  adjustment = 0.1;
+  for (i = 0; i &lt; 10; ++i) {
+    adjustment+=0.1;
+    for (j = 0; j &lt; 10; ++j) {
+      var e = document.createElement(&quot;div&quot;);
+      e.style.top = (11 * i + j * adjustment) + &quot;px&quot;;
+      e.style.left = (11 * j + i * adjustment) + &quot;px&quot;;
+      container.appendChild(e);
+    }
+  }
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (165340 => 165341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-03-08 22:33:43 UTC (rev 165340)
+++ trunk/Source/WebCore/ChangeLog        2014-03-09 00:14:00 UTC (rev 165341)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2014-03-08  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
+        Subpixel rendering: Simple compositing container layer (isSimpleContainerCompositingLayer) paints to wrong position.
+        https://bugs.webkit.org/show_bug.cgi?id=129861
+
+        Reviewed by Simon Fraser.
+
+        This patch ensures that both the simple and non-simple cases paint to the same position.
+        Simple compositing container layer codepath needs to take the fractional device pixel offset
+        into account when painting. Without the fractional value, the final paint rounding could push the
+        paint offset to a different position.
+        retina example:
+        compositing top-left: 0px 0px.
+        fractional offset: 0.3px 0.3px
+        painting coords without offseting: 0px 0px
+                           with offseting: 0.5px 0.5px
+
+        Tests: compositing/hidpi-simple-container-layer-on-device-pixel.html
+
+        * WebCore.exp.in:
+        * platform/graphics/GraphicsLayer.h:
+        (WebCore::GraphicsLayer::contentsRect):
+        (WebCore::GraphicsLayer::setContentsRect):
+        (WebCore::GraphicsLayer::contentsClippingRect):
+        (WebCore::GraphicsLayer::setContentsClippingRect):
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::setContentsRect):
+        (WebCore::GraphicsLayerCA::setContentsClippingRect):
+        (WebCore::GraphicsLayerCA::updateContentsRects):
+        * platform/graphics/ca/GraphicsLayerCA.h:
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
+        (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor):
+        (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage):
+        (WebCore::RenderLayerBacking::contentOffsetInCompostingLayer):
+        (WebCore::RenderLayerBacking::backgroundBoxForPainting):
+        * rendering/RenderLayerBacking.h:
+
</ins><span class="cx"> 2014-03-08  Oliver Hunt  &lt;oliver@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         SerializedScriptValue may move Identifiers between worlds
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (165340 => 165341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-03-08 22:33:43 UTC (rev 165340)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-03-09 00:14:00 UTC (rev 165341)
</span><span class="lines">@@ -536,7 +536,7 @@
</span><span class="cx"> __ZN7WebCore15GraphicsLayerCA15layerDidDisplayEP7CALayer
</span><span class="cx"> __ZN7WebCore15GraphicsLayerCA15removeAnimationERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore15GraphicsLayerCA15setBoundsOriginERKNS_10FloatPointE
</span><del>-__ZN7WebCore15GraphicsLayerCA15setContentsRectERKNS_7IntRectE
</del><ins>+__ZN7WebCore15GraphicsLayerCA15setContentsRectERKNS_9FloatRectE
</ins><span class="cx"> __ZN7WebCore15GraphicsLayerCA15setDrawsContentEb
</span><span class="cx"> __ZN7WebCore15GraphicsLayerCA15setNeedsDisplayEv
</span><span class="cx"> __ZN7WebCore15GraphicsLayerCA15willBeDestroyedEv
</span><span class="lines">@@ -562,7 +562,7 @@
</span><span class="cx"> __ZN7WebCore15GraphicsLayerCA21setBackfaceVisibilityEb
</span><span class="cx"> __ZN7WebCore15GraphicsLayerCA21setNeedsDisplayInRectERKNS_9FloatRectENS_13GraphicsLayer17ShouldClipToLayerE
</span><span class="cx"> __ZN7WebCore15GraphicsLayerCA21setShowRepaintCounterEb
</span><del>-__ZN7WebCore15GraphicsLayerCA23setContentsClippingRectERKNS_7IntRectE
</del><ins>+__ZN7WebCore15GraphicsLayerCA23setContentsClippingRectERKNS_9FloatRectE
</ins><span class="cx"> __ZN7WebCore15GraphicsLayerCA23setContentsNeedsDisplayEv
</span><span class="cx"> __ZN7WebCore15GraphicsLayerCA23setContentsToSolidColorERKNS_5ColorE
</span><span class="cx"> __ZN7WebCore15GraphicsLayerCA23setDebugBackgroundColorERKNS_5ColorE
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (165340 => 165341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h        2014-03-08 22:33:43 UTC (rev 165340)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h        2014-03-09 00:14:00 UTC (rev 165341)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include &quot;Color.h&quot;
</span><span class="cx"> #include &quot;FloatPoint.h&quot;
</span><span class="cx"> #include &quot;FloatPoint3D.h&quot;
</span><ins>+#include &quot;FloatRect.h&quot;
</ins><span class="cx"> #include &quot;FloatSize.h&quot;
</span><span class="cx"> #include &quot;GraphicsLayerClient.h&quot;
</span><span class="cx"> #include &quot;IntRect.h&quot;
</span><span class="lines">@@ -59,7 +60,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class FloatRect;
</del><span class="cx"> class GraphicsContext;
</span><span class="cx"> class GraphicsLayerFactory;
</span><span class="cx"> class Image;
</span><span class="lines">@@ -376,11 +376,11 @@
</span><span class="cx">     bool hasContentsTiling() const { return !m_contentsTileSize.isEmpty(); }
</span><span class="cx"> 
</span><span class="cx">     // Set that the position/size of the contents (image or video).
</span><del>-    IntRect contentsRect() const { return m_contentsRect; }
-    virtual void setContentsRect(const IntRect&amp; r) { m_contentsRect = r; }
</del><ins>+    FloatRect contentsRect() const { return m_contentsRect; }
+    virtual void setContentsRect(const FloatRect&amp; r) { m_contentsRect = r; }
</ins><span class="cx"> 
</span><del>-    IntRect contentsClippingRect() const { return m_contentsClippingRect; }
-    virtual void setContentsClippingRect(const IntRect&amp; r) { m_contentsClippingRect = r; }
</del><ins>+    FloatRect contentsClippingRect() const { return m_contentsClippingRect; }
+    virtual void setContentsClippingRect(const FloatRect&amp; r) { m_contentsClippingRect = r; }
</ins><span class="cx"> 
</span><span class="cx">     // Transitions are identified by a special animation name that cannot clash with a keyframe identifier.
</span><span class="cx">     static String animationNameForTransition(AnimatedPropertyID);
</span><span class="lines">@@ -604,8 +604,8 @@
</span><span class="cx">     GraphicsLayer* m_replicatedLayer; // For a replica layer, a reference to the original layer.
</span><span class="cx">     FloatPoint m_replicatedLayerPosition; // For a replica layer, the position of the replica.
</span><span class="cx"> 
</span><del>-    IntRect m_contentsRect;
-    IntRect m_contentsClippingRect;
</del><ins>+    FloatRect m_contentsRect;
+    FloatRect m_contentsClippingRect;
</ins><span class="cx">     IntPoint m_contentsTilePhase;
</span><span class="cx">     IntSize m_contentsTileSize;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (165340 => 165341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2014-03-08 22:33:43 UTC (rev 165340)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2014-03-09 00:14:00 UTC (rev 165341)
</span><span class="lines">@@ -764,7 +764,7 @@
</span><span class="cx">     noteLayerPropertyChanged(ContentsNeedsDisplay);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void GraphicsLayerCA::setContentsRect(const IntRect&amp; rect)
</del><ins>+void GraphicsLayerCA::setContentsRect(const FloatRect&amp; rect)
</ins><span class="cx"> {
</span><span class="cx">     if (rect == m_contentsRect)
</span><span class="cx">         return;
</span><span class="lines">@@ -773,7 +773,7 @@
</span><span class="cx">     noteLayerPropertyChanged(ContentsRectsChanged);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void GraphicsLayerCA::setContentsClippingRect(const IntRect&amp; rect)
</del><ins>+void GraphicsLayerCA::setContentsClippingRect(const FloatRect&amp; rect)
</ins><span class="cx"> {
</span><span class="cx">     if (rect == m_contentsClippingRect)
</span><span class="cx">         return;
</span><span class="lines">@@ -2038,7 +2038,7 @@
</span><span class="cx">         clippingOrigin = m_contentsClippingRect.location();
</span><span class="cx">         clippingBounds.setSize(m_contentsClippingRect.size());
</span><span class="cx"> 
</span><del>-        contentOrigin = toLayoutPoint(m_contentsRect.location() - m_contentsClippingRect.location());
</del><ins>+        contentOrigin = FloatPoint(m_contentsRect.location() - m_contentsClippingRect.location());
</ins><span class="cx"> 
</span><span class="cx">         m_contentsClippingLayer-&gt;setPosition(clippingOrigin);
</span><span class="cx">         m_contentsClippingLayer-&gt;setBounds(clippingBounds);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (165340 => 165341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h        2014-03-08 22:33:43 UTC (rev 165340)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h        2014-03-09 00:14:00 UTC (rev 165341)
</span><span class="lines">@@ -111,8 +111,8 @@
</span><span class="cx">     virtual void setNeedsDisplayInRect(const FloatRect&amp;, ShouldClipToLayer = ClipToLayer);
</span><span class="cx">     virtual void setContentsNeedsDisplay();
</span><span class="cx">     
</span><del>-    virtual void setContentsRect(const IntRect&amp;);
-    virtual void setContentsClippingRect(const IntRect&amp;) override;
</del><ins>+    virtual void setContentsRect(const FloatRect&amp;) override;
+    virtual void setContentsClippingRect(const FloatRect&amp;) override;
</ins><span class="cx">     
</span><span class="cx">     virtual void suspendAnimations(double time);
</span><span class="cx">     virtual void resumeAnimations();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicstexmapGraphicsLayerTextureMappercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp (165340 => 165341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp        2014-03-08 22:33:43 UTC (rev 165340)
+++ trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp        2014-03-09 00:14:00 UTC (rev 165341)
</span><span class="lines">@@ -328,7 +328,7 @@
</span><span class="cx"> 
</span><span class="cx"> /* \reimp (GraphicsLayer.h)
</span><span class="cx"> */
</span><del>-void GraphicsLayerTextureMapper::setContentsRect(const IntRect&amp; value)
</del><ins>+void GraphicsLayerTextureMapper::setContentsRect(const FloatRect&amp; value)
</ins><span class="cx"> {
</span><span class="cx">     if (value == contentsRect())
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicstexmapGraphicsLayerTextureMapperh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h (165340 => 165341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h        2014-03-08 22:33:43 UTC (rev 165340)
+++ trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h        2014-03-09 00:14:00 UTC (rev 165341)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx">     virtual void setContentsOpaque(bool b);
</span><span class="cx">     virtual void setBackfaceVisibility(bool b);
</span><span class="cx">     virtual void setOpacity(float opacity);
</span><del>-    virtual void setContentsRect(const IntRect&amp; r);
</del><ins>+    virtual void setContentsRect(const FloatRect&amp;);
</ins><span class="cx">     virtual void setReplicatedByLayer(GraphicsLayer*);
</span><span class="cx">     virtual void setContentsToImage(Image*);
</span><span class="cx">     virtual void setContentsToSolidColor(const Color&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicstexmapTextureMapperLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp (165340 => 165341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp        2014-03-08 22:33:43 UTC (rev 165340)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp        2014-03-09 00:14:00 UTC (rev 165341)
</span><span class="lines">@@ -565,7 +565,7 @@
</span><span class="cx">     m_currentTransform.setChildrenTransform(childrenTransform);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TextureMapperLayer::setContentsRect(const IntRect&amp; contentsRect)
</del><ins>+void TextureMapperLayer::setContentsRect(const FloatRect&amp; contentsRect)
</ins><span class="cx"> {
</span><span class="cx">     if (contentsRect == m_state.contentsRect)
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicstexmapTextureMapperLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h (165340 => 165341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h        2014-03-08 22:33:43 UTC (rev 165340)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h        2014-03-09 00:14:00 UTC (rev 165341)
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx">     void setPreserves3D(bool);
</span><span class="cx">     void setTransform(const TransformationMatrix&amp;);
</span><span class="cx">     void setChildrenTransform(const TransformationMatrix&amp;);
</span><del>-    void setContentsRect(const IntRect&amp;);
</del><ins>+    void setContentsRect(const FloatRect&amp;);
</ins><span class="cx">     void setMasksToBounds(bool);
</span><span class="cx">     void setDrawsContent(bool);
</span><span class="cx">     bool drawsContent() const { return m_state.drawsContent; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicstexmapcoordinatedCoordinatedGraphicsLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp (165340 => 165341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp        2014-03-08 22:33:43 UTC (rev 165340)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp        2014-03-09 00:14:00 UTC (rev 165341)
</span><span class="lines">@@ -334,7 +334,7 @@
</span><span class="cx">     didChangeLayerState();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CoordinatedGraphicsLayer::setContentsRect(const IntRect&amp; r)
</del><ins>+void CoordinatedGraphicsLayer::setContentsRect(const FloatRect&amp; r)
</ins><span class="cx"> {
</span><span class="cx">     if (contentsRect() == r)
</span><span class="cx">         return;
</span><span class="lines">@@ -822,7 +822,7 @@
</span><span class="cx"> bool CoordinatedGraphicsLayer::imageBackingVisible()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_coordinatedImageBacking);
</span><del>-    return tiledBackingStoreVisibleRect().intersects(contentsRect());
</del><ins>+    return tiledBackingStoreVisibleRect().intersects(IntRect(contentsRect()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CoordinatedGraphicsLayer::releaseImageBackingIfNeeded()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicstexmapcoordinatedCoordinatedGraphicsLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h (165340 => 165341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h        2014-03-08 22:33:43 UTC (rev 165340)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h        2014-03-09 00:14:00 UTC (rev 165341)
</span><span class="lines">@@ -84,7 +84,7 @@
</span><span class="cx">     virtual void setContentsOpaque(bool) override;
</span><span class="cx">     virtual void setBackfaceVisibility(bool) override;
</span><span class="cx">     virtual void setOpacity(float) override;
</span><del>-    virtual void setContentsRect(const IntRect&amp;) override;
</del><ins>+    virtual void setContentsRect(const FloatRect&amp;) override;
</ins><span class="cx">     virtual void setContentsTilePhase(const IntPoint&amp;) override;
</span><span class="cx">     virtual void setContentsTileSize(const IntSize&amp;) override;
</span><span class="cx">     virtual void setContentsToImage(Image*) override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicstexmapcoordinatedCoordinatedGraphicsStateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h (165340 => 165341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h        2014-03-08 22:33:43 UTC (rev 165340)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h        2014-03-09 00:14:00 UTC (rev 165341)
</span><span class="lines">@@ -141,7 +141,7 @@
</span><span class="cx">     FloatSize size;
</span><span class="cx">     TransformationMatrix transform;
</span><span class="cx">     TransformationMatrix childrenTransform;
</span><del>-    IntRect contentsRect;
</del><ins>+    FloatRect contentsRect;
</ins><span class="cx">     IntPoint contentsTilePhase;
</span><span class="cx">     IntSize contentsTileSize;
</span><span class="cx">     float opacity;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerBackingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (165340 => 165341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp        2014-03-08 22:33:43 UTC (rev 165340)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp        2014-03-09 00:14:00 UTC (rev 165341)
</span><span class="lines">@@ -1556,7 +1556,7 @@
</span><span class="cx"> 
</span><span class="cx">     // An unset (invalid) color will remove the solid color.
</span><span class="cx">     m_graphicsLayer-&gt;setContentsToSolidColor(backgroundColor);
</span><del>-    IntRect contentsRect = backgroundBox();
</del><ins>+    FloatRect contentsRect = backgroundBoxForPainting();
</ins><span class="cx">     m_graphicsLayer-&gt;setContentsRect(contentsRect);
</span><span class="cx">     m_graphicsLayer-&gt;setContentsClippingRect(contentsRect);
</span><span class="cx">     didUpdateContentsRect = true;
</span><span class="lines">@@ -1609,7 +1609,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    IntRect destRect = backgroundBox();
</del><ins>+    IntRect destRect = pixelSnappedIntRect(LayoutRect(backgroundBoxForPainting()));
</ins><span class="cx">     IntPoint phase;
</span><span class="cx">     IntSize tileSize;
</span><span class="cx"> 
</span><span class="lines">@@ -1945,7 +1945,7 @@
</span><span class="cx"> // Return the offset from the top-left of this compositing layer at which the renderer's contents are painted.
</span><span class="cx"> LayoutSize RenderLayerBacking::contentOffsetInCompostingLayer() const
</span><span class="cx"> {
</span><del>-    return LayoutSize(-m_compositedBounds.x(), -m_compositedBounds.y());
</del><ins>+    return LayoutSize(-m_compositedBounds.x(), -m_compositedBounds.y()) + m_devicePixelFractionFromRenderer;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> LayoutRect RenderLayerBacking::contentsBox() const
</span><span class="lines">@@ -1987,14 +1987,14 @@
</span><span class="cx">     return LayoutRect();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntRect RenderLayerBacking::backgroundBox() const
</del><ins>+FloatRect RenderLayerBacking::backgroundBoxForPainting() const
</ins><span class="cx"> {
</span><span class="cx">     if (!renderer().isBox())
</span><del>-        return IntRect();
</del><ins>+        return FloatRect();
</ins><span class="cx"> 
</span><span class="cx">     LayoutRect backgroundBox = backgroundRectForBox(toRenderBox(renderer()));
</span><span class="cx">     backgroundBox.move(contentOffsetInCompostingLayer());
</span><del>-    return pixelSnappedIntRect(backgroundBox);
</del><ins>+    return pixelSnappedForPainting(backgroundBox, deviceScaleFactor());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> GraphicsLayer* RenderLayerBacking::parentForSublayers() const
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerBackingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.h (165340 => 165341)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerBacking.h        2014-03-08 22:33:43 UTC (rev 165340)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.h        2014-03-09 00:14:00 UTC (rev 165341)
</span><span class="lines">@@ -194,7 +194,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     LayoutRect contentsBox() const;
</span><del>-    IntRect backgroundBox() const;
</del><span class="cx">     
</span><span class="cx">     // For informative purposes only.
</span><span class="cx">     CompositingLayerType compositingLayerType() const;
</span><span class="lines">@@ -215,6 +214,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> private:
</span><ins>+    FloatRect backgroundBoxForPainting() const;
+
</ins><span class="cx">     void createPrimaryGraphicsLayer();
</span><span class="cx">     void destroyGraphicsLayers();
</span><span class="cx">     
</span></span></pre>
</div>
</div>

</body>
</html>