<!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>[172681] trunk/Source</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/172681">172681</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2014-08-15 21:03:42 -0700 (Fri, 15 Aug 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Do not use FloatRect::infiniteRect() to flag full repaints.
https://bugs.webkit.org/show_bug.cgi?id=135900

Reviewed by Simon Fraser.

Converting FloatRect::infiniteRect() to IntRect leads to value overflow
and we end up with invalid repaint rectangle. Use a boolean flag to indicate
full repaint request.

Covered by existing tests.

Source/WebCore:

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::GraphicsLayerCA):
(WebCore::GraphicsLayerCA::setNeedsDisplay):
(WebCore::GraphicsLayerCA::setNeedsDisplayInRect):
(WebCore::GraphicsLayerCA::repaintLayerDirtyRects):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::setTileNeedsDisplayInRect):
* platform/graphics/ca/mac/PlatformCALayerMac.h:
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayerMac::setNeedsDisplay):
(PlatformCALayerMac::setNeedsDisplayInRect):

Source/WebKit2:

* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::setNeedsDisplayInRect):
(WebKit::PlatformCALayerRemote::setNeedsDisplay):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
* WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
* WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
(WebKit::PlatformCALayerRemoteCustom::setNeedsDisplayInRect):
(WebKit::PlatformCALayerRemoteCustom::setNeedsDisplay):
* WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
(WebKit::PlatformCALayerRemoteTiledBacking::setNeedsDisplayInRect):
(WebKit::PlatformCALayerRemoteTiledBacking::setNeedsDisplay):
* WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsLayercpp">trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp</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="#trunkSourceWebCoreplatformgraphicscaPlatformCALayerh">trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaTileGridcpp">trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMach">trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMacmm">trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWincpp">trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWinh">trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWinInternalcpp">trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWinInternalh">trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemotecpp">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteh">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteCustomh">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteCustommm">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteTiledBackingcpp">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteTiledBackingh">trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (172680 => 172681)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-08-16 02:57:58 UTC (rev 172680)
+++ trunk/Source/WebCore/ChangeLog        2014-08-16 04:03:42 UTC (rev 172681)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2014-08-15  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
+        Do not use FloatRect::infiniteRect() to flag full repaints.
+        https://bugs.webkit.org/show_bug.cgi?id=135900
+
+        Reviewed by Simon Fraser.
+
+        Converting FloatRect::infiniteRect() to IntRect leads to value overflow
+        and we end up with invalid repaint rectangle. Use a boolean flag to indicate
+        full repaint request.
+
+        Covered by existing tests.
+
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::GraphicsLayerCA):
+        (WebCore::GraphicsLayerCA::setNeedsDisplay):
+        (WebCore::GraphicsLayerCA::setNeedsDisplayInRect):
+        (WebCore::GraphicsLayerCA::repaintLayerDirtyRects):
+        * platform/graphics/ca/GraphicsLayerCA.h:
+        * platform/graphics/ca/PlatformCALayer.h:
+        * platform/graphics/ca/TileGrid.cpp:
+        (WebCore::TileGrid::setTileNeedsDisplayInRect):
+        * platform/graphics/ca/mac/PlatformCALayerMac.h:
+        * platform/graphics/ca/mac/PlatformCALayerMac.mm:
+        (PlatformCALayerMac::setNeedsDisplay):
+        (PlatformCALayerMac::setNeedsDisplayInRect):
+
</ins><span class="cx"> 2014-08-15  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unify the modes style resolution modes SharingRules and StyleInvalidation
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp (172680 => 172681)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp        2014-08-16 02:57:58 UTC (rev 172680)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp        2014-08-16 04:03:42 UTC (rev 172681)
</span><span class="lines">@@ -571,18 +571,19 @@
</span><span class="cx"> 
</span><span class="cx"> void GraphicsLayer::addRepaintRect(const FloatRect&amp; repaintRect)
</span><span class="cx"> {
</span><del>-    if (m_client.isTrackingRepaints()) {
-        FloatRect largestRepaintRect(FloatPoint(), m_size);
-        largestRepaintRect.intersect(repaintRect);
-        RepaintMap::iterator repaintIt = repaintRectMap().find(this);
-        if (repaintIt == repaintRectMap().end()) {
-            Vector&lt;FloatRect&gt; repaintRects;
-            repaintRects.append(largestRepaintRect);
-            repaintRectMap().set(this, repaintRects);
-        } else {
-            Vector&lt;FloatRect&gt;&amp; repaintRects = repaintIt-&gt;value;
-            repaintRects.append(largestRepaintRect);
-        }
</del><ins>+    if (!m_client.isTrackingRepaints())
+        return;
+
+    FloatRect largestRepaintRect(FloatPoint(), m_size);
+    largestRepaintRect.intersect(repaintRect);
+    RepaintMap::iterator repaintIt = repaintRectMap().find(this);
+    if (repaintIt == repaintRectMap().end()) {
+        Vector&lt;FloatRect&gt; repaintRects;
+        repaintRects.append(largestRepaintRect);
+        repaintRectMap().set(this, repaintRects);
+    } else {
+        Vector&lt;FloatRect&gt;&amp; repaintRects = repaintIt-&gt;value;
+        repaintRects.append(largestRepaintRect);
</ins><span class="cx">     }
</span><span class="cx"> }
</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 (172680 => 172681)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2014-08-16 02:57:58 UTC (rev 172680)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2014-08-16 04:03:42 UTC (rev 172681)
</span><span class="lines">@@ -342,6 +342,7 @@
</span><span class="cx">     : GraphicsLayer(client)
</span><span class="cx">     , m_contentsLayerPurpose(NoContentsLayer)
</span><span class="cx">     , m_isPageTiledBackingLayer(false)
</span><ins>+    , m_needsFullRepaint(false)
</ins><span class="cx">     , m_uncommittedChanges(0)
</span><span class="cx">     , m_isCommittingChanges(false)
</span><span class="cx"> {
</span><span class="lines">@@ -709,7 +710,13 @@
</span><span class="cx"> 
</span><span class="cx"> void GraphicsLayerCA::setNeedsDisplay()
</span><span class="cx"> {
</span><del>-    setNeedsDisplayInRect(FloatRect::infiniteRect());
</del><ins>+    if (!drawsContent())
+        return;
+
+    m_needsFullRepaint = true;
+    m_dirtyRects.clear();
+    noteLayerPropertyChanged(DirtyRectsChanged);
+    addRepaintRect(FloatRect(FloatPoint(), m_size));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void GraphicsLayerCA::setNeedsDisplayInRect(const FloatRect&amp; r, ShouldClipToLayer shouldClip)
</span><span class="lines">@@ -717,6 +724,9 @@
</span><span class="cx">     if (!drawsContent())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    if (m_needsFullRepaint)
+        return;
+
</ins><span class="cx">     FloatRect rect(r);
</span><span class="cx">     if (shouldClip == ClipToLayer) {
</span><span class="cx">         FloatRect layerBounds(FloatPoint(), m_size);
</span><span class="lines">@@ -2270,11 +2280,18 @@
</span><span class="cx"> 
</span><span class="cx"> void GraphicsLayerCA::repaintLayerDirtyRects()
</span><span class="cx"> {
</span><ins>+    if (m_needsFullRepaint) {
+        ASSERT(!m_dirtyRects.size());
+        m_layer-&gt;setNeedsDisplay();
+        m_needsFullRepaint = false;
+        return;
+    }
+
</ins><span class="cx">     if (!m_dirtyRects.size())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     for (size_t i = 0; i &lt; m_dirtyRects.size(); ++i)
</span><del>-        m_layer-&gt;setNeedsDisplay(&amp;(m_dirtyRects[i]));
</del><ins>+        m_layer-&gt;setNeedsDisplayInRect(m_dirtyRects[i]);
</ins><span class="cx">     
</span><span class="cx">     m_dirtyRects.clear();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (172680 => 172681)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h        2014-08-16 02:57:58 UTC (rev 172680)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h        2014-08-16 04:03:42 UTC (rev 172681)
</span><span class="lines">@@ -482,7 +482,8 @@
</span><span class="cx">     
</span><span class="cx">     ContentsLayerPurpose m_contentsLayerPurpose;
</span><span class="cx">     bool m_isPageTiledBackingLayer : 1;
</span><del>-    
</del><ins>+    bool m_needsFullRepaint : 1;
+
</ins><span class="cx">     Color m_contentsSolidColor;
</span><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;CGImageRef&gt; m_uncorrectedContentsImage;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaPlatformCALayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h (172680 => 172681)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h        2014-08-16 02:57:58 UTC (rev 172680)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h        2014-08-16 04:03:42 UTC (rev 172681)
</span><span class="lines">@@ -103,7 +103,8 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void animationStarted(const String&amp; key, CFTimeInterval beginTime) = 0;
</span><span class="cx"> 
</span><del>-    virtual void setNeedsDisplay(const FloatRect* dirtyRect = 0) = 0;
</del><ins>+    virtual void setNeedsDisplay() = 0;
+    virtual void setNeedsDisplayInRect(const FloatRect&amp; dirtyRect) = 0;
</ins><span class="cx"> 
</span><span class="cx">     virtual void copyContentsFromLayer(PlatformCALayer*) = 0;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaTileGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp (172680 => 172681)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp        2014-08-16 02:57:58 UTC (rev 172680)
+++ trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp        2014-08-16 04:03:42 UTC (rev 172681)
</span><span class="lines">@@ -152,11 +152,11 @@
</span><span class="cx">     // We could test for intersection with the visible rect. This would reduce painting yet more,
</span><span class="cx">     // but may make scrolling stale tiles into view more frequent.
</span><span class="cx">     if (tileRect.intersects(coverageRectInTileCoords) &amp;&amp; tileLayer-&gt;superlayer()) {
</span><del>-        tileLayer-&gt;setNeedsDisplay(&amp;tileRepaintRect);
</del><ins>+        tileLayer-&gt;setNeedsDisplayInRect(tileRepaintRect);
</ins><span class="cx"> 
</span><span class="cx">         if (m_controller.rootLayer().owner()-&gt;platformCALayerShowRepaintCounter(0)) {
</span><span class="cx">             FloatRect indicatorRect(0, 0, 52, 27);
</span><del>-            tileLayer-&gt;setNeedsDisplay(&amp;indicatorRect);
</del><ins>+            tileLayer-&gt;setNeedsDisplayInRect(indicatorRect);
</ins><span class="cx">         }
</span><span class="cx">     } else
</span><span class="cx">         tileInfo.hasStaleContent = true;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h (172680 => 172681)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h        2014-08-16 02:57:58 UTC (rev 172680)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h        2014-08-16 04:03:42 UTC (rev 172681)
</span><span class="lines">@@ -46,7 +46,8 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void setOwner(PlatformCALayerClient*) override;
</span><span class="cx"> 
</span><del>-    virtual void setNeedsDisplay(const FloatRect* dirtyRect = 0) override;
</del><ins>+    virtual void setNeedsDisplay() override;
+    virtual void setNeedsDisplayInRect(const FloatRect&amp; dirtyRect) override;
</ins><span class="cx"> 
</span><span class="cx">     virtual void copyContentsFromLayer(PlatformCALayer*) override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscamacPlatformCALayerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm (172680 => 172681)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm        2014-08-16 02:57:58 UTC (rev 172680)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm        2014-08-16 04:03:42 UTC (rev 172681)
</span><span class="lines">@@ -331,16 +331,20 @@
</span><span class="cx">         m_owner-&gt;platformCALayerAnimationStarted(beginTime);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerMac::setNeedsDisplay(const FloatRect* dirtyRect)
</del><ins>+void PlatformCALayerMac::setNeedsDisplay()
</ins><span class="cx"> {
</span><span class="cx">     BEGIN_BLOCK_OBJC_EXCEPTIONS
</span><del>-    if (dirtyRect)
-        [m_layer.get() setNeedsDisplayInRect:*dirtyRect];
-    else
-        [m_layer.get() setNeedsDisplay];
</del><ins>+    [m_layer.get() setNeedsDisplay];
</ins><span class="cx">     END_BLOCK_OBJC_EXCEPTIONS
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void PlatformCALayerMac::setNeedsDisplayInRect(const FloatRect&amp; dirtyRect)
+{
+    BEGIN_BLOCK_OBJC_EXCEPTIONS
+    [m_layer.get() setNeedsDisplayInRect:dirtyRect];
+    END_BLOCK_OBJC_EXCEPTIONS
+}
+
</ins><span class="cx"> void PlatformCALayerMac::copyContentsFromLayer(PlatformCALayer* layer)
</span><span class="cx"> {
</span><span class="cx">     BEGIN_BLOCK_OBJC_EXCEPTIONS
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp (172680 => 172681)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp        2014-08-16 02:57:58 UTC (rev 172680)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp        2014-08-16 04:03:42 UTC (rev 172681)
</span><span class="lines">@@ -208,11 +208,16 @@
</span><span class="cx">         m_owner-&gt;platformCALayerAnimationStarted(beginTime);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerWin::setNeedsDisplay(const FloatRect* dirtyRect)
</del><ins>+void PlatformCALayerWin::setNeedsDisplayInRect(const FloatRect&amp; dirtyRect)
</ins><span class="cx"> {
</span><del>-    intern(this)-&gt;setNeedsDisplay(dirtyRect);
</del><ins>+    intern(this)-&gt;setNeedsDisplayInRect(dirtyRect);
</ins><span class="cx"> }
</span><del>-    
</del><ins>+
+void PlatformCALayerWin::setNeedsDisplay()
+{
+    intern(this)-&gt;setNeedsDisplay();
+}
+
</ins><span class="cx"> void PlatformCALayerWin::setNeedsCommit()
</span><span class="cx"> {
</span><span class="cx">     AbstractCACFLayerTreeHost* host = layerTreeHostForLayer(this);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWinh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h (172680 => 172681)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h        2014-08-16 02:57:58 UTC (rev 172680)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h        2014-08-16 04:03:42 UTC (rev 172681)
</span><span class="lines">@@ -37,7 +37,8 @@
</span><span class="cx">     
</span><span class="cx">     ~PlatformCALayerWin();
</span><span class="cx"> 
</span><del>-    virtual void setNeedsDisplay(const FloatRect* dirtyRect = 0) override;
</del><ins>+    virtual void setNeedsDisplayInRect(const FloatRect&amp; dirtyRect) override;
+    virtual void setNeedsDisplay() override;
</ins><span class="cx"> 
</span><span class="cx">     virtual void copyContentsFromLayer(PlatformCALayer*) override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWinInternalcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp (172680 => 172681)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp        2014-08-16 02:57:58 UTC (rev 172680)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp        2014-08-16 04:03:42 UTC (rev 172681)
</span><span class="lines">@@ -160,16 +160,19 @@
</span><span class="cx">         CACFLayerSetNeedsDisplay(owner()-&gt;platformLayer(), 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerWinInternal::setNeedsDisplay(const FloatRect* dirtyRect)
</del><ins>+void PlatformCALayerWinInternal::setNeedsDisplay()
</ins><span class="cx"> {
</span><ins>+    internalSetNeedsDisplay(0);
+}
+
+void PlatformCALayerWinInternal::setNeedsDisplayInRect(const FloatRect&amp; dirtyRect)
+{
</ins><span class="cx">     if (layerTypeIsTiled(m_owner-&gt;layerType())) {
</span><span class="cx">         // FIXME: Only setNeedsDisplay for tiles that are currently visible
</span><span class="cx">         int numTileLayers = tileCount();
</span><del>-        CGRect rect;
-        if (dirtyRect)
-            rect = *dirtyRect;
</del><ins>+        CGRect rect = dirtyRect;
</ins><span class="cx">         for (int i = 0; i &lt; numTileLayers; ++i)
</span><del>-            CACFLayerSetNeedsDisplay(tileAtIndex(i), dirtyRect ? &amp;rect : 0);
</del><ins>+            CACFLayerSetNeedsDisplay(tileAtIndex(i), &amp;rect);
</ins><span class="cx"> 
</span><span class="cx">         if (m_owner-&gt;owner() &amp;&amp; m_owner-&gt;owner()-&gt;platformCALayerShowRepaintCounter(m_owner)) {
</span><span class="cx">             CGRect layerBounds = m_owner-&gt;bounds();
</span><span class="lines">@@ -189,15 +192,15 @@
</span><span class="cx">                     repaintCounterRect.setY(layerBounds.height() - (layerBounds.y() + repaintCounterRect.height()));
</span><span class="cx">                 internalSetNeedsDisplay(&amp;repaintCounterRect);
</span><span class="cx">             }
</span><del>-            if (dirtyRect &amp;&amp; owner()-&gt;owner()-&gt;platformCALayerContentsOrientation() == WebCore::GraphicsLayer::CompositingCoordinatesTopDown) {
-                FloatRect flippedDirtyRect = *dirtyRect;
</del><ins>+            if (owner()-&gt;owner()-&gt;platformCALayerContentsOrientation() == WebCore::GraphicsLayer::CompositingCoordinatesTopDown) {
+                FloatRect flippedDirtyRect = dirtyRect;
</ins><span class="cx">                 flippedDirtyRect.setY(owner()-&gt;bounds().height() - (flippedDirtyRect.y() + flippedDirtyRect.height()));
</span><span class="cx">                 internalSetNeedsDisplay(&amp;flippedDirtyRect);
</span><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        internalSetNeedsDisplay(dirtyRect);
</del><ins>+        internalSetNeedsDisplay(&amp;dirtyRect);
</ins><span class="cx">     }
</span><span class="cx">     owner()-&gt;setNeedsCommit();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscawinPlatformCALayerWinInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.h (172680 => 172681)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.h        2014-08-16 02:57:58 UTC (rev 172680)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.h        2014-08-16 04:03:42 UTC (rev 172681)
</span><span class="lines">@@ -48,7 +48,8 @@
</span><span class="cx">     ~PlatformCALayerWinInternal();
</span><span class="cx"> 
</span><span class="cx">     void displayCallback(CACFLayerRef, CGContextRef);
</span><del>-    void setNeedsDisplay(const FloatRect*);
</del><ins>+    void setNeedsDisplayInRect(const FloatRect&amp;);
+    void setNeedsDisplay();
</ins><span class="cx">     PlatformCALayer* owner() const { return m_owner; }
</span><span class="cx"> 
</span><span class="cx">     void setSublayers(const PlatformCALayerList&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (172680 => 172681)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-08-16 02:57:58 UTC (rev 172680)
+++ trunk/Source/WebKit2/ChangeLog        2014-08-16 04:03:42 UTC (rev 172681)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2014-08-15  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
+        Do not use FloatRect::infiniteRect() to flag full repaints.
+        https://bugs.webkit.org/show_bug.cgi?id=135900
+
+        Reviewed by Simon Fraser.
+
+        Converting FloatRect::infiniteRect() to IntRect leads to value overflow
+        and we end up with invalid repaint rectangle. Use a boolean flag to indicate
+        full repaint request.
+
+        Covered by existing tests.
+
+        * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
+        (WebKit::PlatformCALayerRemote::setNeedsDisplayInRect):
+        (WebKit::PlatformCALayerRemote::setNeedsDisplay):
+        * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
+        * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
+        * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
+        (WebKit::PlatformCALayerRemoteCustom::setNeedsDisplayInRect):
+        (WebKit::PlatformCALayerRemoteCustom::setNeedsDisplay):
+        * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
+        (WebKit::PlatformCALayerRemoteTiledBacking::setNeedsDisplayInRect):
+        (WebKit::PlatformCALayerRemoteTiledBacking::setNeedsDisplay):
+        * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
+
</ins><span class="cx"> 2014-08-15  Alexey Proskuryakov  &lt;ap@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r172660): WebKit2.TerminateTwice asserts
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemotecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp (172680 => 172681)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp        2014-08-16 02:57:58 UTC (rev 172680)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp        2014-08-16 04:03:42 UTC (rev 172681)
</span><span class="lines">@@ -203,19 +203,21 @@
</span><span class="cx">     m_properties.backingStore-&gt;ensureBackingStore(m_properties.bounds.size(), m_properties.contentsScale, m_acceleratesDrawing, m_properties.opaque);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerRemote::setNeedsDisplay(const FloatRect* rect)
</del><ins>+void PlatformCALayerRemote::setNeedsDisplayInRect(const FloatRect&amp; rect)
</ins><span class="cx"> {
</span><span class="cx">     ensureBackingStore();
</span><span class="cx"> 
</span><del>-    if (!rect) {
-        m_properties.backingStore-&gt;setNeedsDisplay();
-        return;
-    }
-
</del><span class="cx">     // FIXME: Need to map this through contentsRect/etc.
</span><del>-    m_properties.backingStore-&gt;setNeedsDisplay(enclosingIntRect(*rect));
</del><ins>+    m_properties.backingStore-&gt;setNeedsDisplay(enclosingIntRect(rect));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void PlatformCALayerRemote::setNeedsDisplay()
+{
+    ensureBackingStore();
+
+    m_properties.backingStore-&gt;setNeedsDisplay();
+}
+
</ins><span class="cx"> void PlatformCALayerRemote::copyContentsFromLayer(PlatformCALayer* layer)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_properties.clonedLayerID == layer-&gt;layerID());
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h (172680 => 172681)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h        2014-08-16 02:57:58 UTC (rev 172680)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h        2014-08-16 04:03:42 UTC (rev 172681)
</span><span class="lines">@@ -51,7 +51,8 @@
</span><span class="cx"> 
</span><span class="cx">     void recursiveBuildTransaction(RemoteLayerTreeContext&amp;, RemoteLayerTreeTransaction&amp;);
</span><span class="cx"> 
</span><del>-    virtual void setNeedsDisplay(const WebCore::FloatRect* dirtyRect = 0) override;
</del><ins>+    virtual void setNeedsDisplayInRect(const WebCore::FloatRect&amp; dirtyRect) override;
+    virtual void setNeedsDisplay() override;
</ins><span class="cx"> 
</span><span class="cx">     virtual void copyContentsFromLayer(PlatformCALayer*) override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteCustomh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h (172680 => 172681)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h        2014-08-16 02:57:58 UTC (rev 172680)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h        2014-08-16 04:03:42 UTC (rev 172681)
</span><span class="lines">@@ -44,7 +44,8 @@
</span><span class="cx"> 
</span><span class="cx">     virtual uint32_t hostingContextID() override;
</span><span class="cx"> 
</span><del>-    virtual void setNeedsDisplay(const WebCore::FloatRect* dirtyRect = 0) override;
</del><ins>+    virtual void setNeedsDisplayInRect(const WebCore::FloatRect&amp; dirtyRect) override;
+    virtual void setNeedsDisplay() override;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     PlatformCALayerRemoteCustom(WebCore::PlatformCALayer::LayerType, PlatformLayer *, WebCore::PlatformCALayerClient* owner, RemoteLayerTreeContext&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteCustommm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm (172680 => 172681)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm        2014-08-16 02:57:58 UTC (rev 172680)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm        2014-08-16 04:03:42 UTC (rev 172681)
</span><span class="lines">@@ -131,15 +131,20 @@
</span><span class="cx">     [m_platformLayer setContents:(id)contents];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerRemoteCustom::setNeedsDisplay(const FloatRect* rect)
</del><ins>+void PlatformCALayerRemoteCustom::setNeedsDisplayInRect(const FloatRect&amp; rect)
</ins><span class="cx"> {
</span><del>-    if (m_providesContents) {
-        if (rect)
-            [m_platformLayer setNeedsDisplayInRect:*rect];
-        else
-            [m_platformLayer setNeedsDisplay];
-    } else
-        PlatformCALayerRemote::setNeedsDisplay(rect);
</del><ins>+    if (m_providesContents)
+        [m_platformLayer setNeedsDisplayInRect:rect];
+    else
+        PlatformCALayerRemote::setNeedsDisplayInRect(rect);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void PlatformCALayerRemoteCustom::setNeedsDisplay()
+{
+    if (m_providesContents)
+        [m_platformLayer setNeedsDisplay];
+    else
+        PlatformCALayerRemote::setNeedsDisplay();
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteTiledBackingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp (172680 => 172681)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp        2014-08-16 02:57:58 UTC (rev 172680)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp        2014-08-16 04:03:42 UTC (rev 172681)
</span><span class="lines">@@ -46,14 +46,16 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PlatformCALayerRemoteTiledBacking::setNeedsDisplay(const FloatRect* dirtyRect)
</del><ins>+void PlatformCALayerRemoteTiledBacking::setNeedsDisplayInRect(const FloatRect&amp; dirtyRect)
</ins><span class="cx"> {
</span><del>-    if (dirtyRect)
-        m_tileController-&gt;setNeedsDisplayInRect(enclosingIntRect(*dirtyRect));
-    else
-        m_tileController-&gt;setNeedsDisplay();
</del><ins>+    m_tileController-&gt;setNeedsDisplayInRect(enclosingIntRect(dirtyRect));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void PlatformCALayerRemoteTiledBacking::setNeedsDisplay()
+{
+    m_tileController-&gt;setNeedsDisplay();
+}
+
</ins><span class="cx"> const WebCore::PlatformCALayerList* PlatformCALayerRemoteTiledBacking::customSublayers() const
</span><span class="cx"> {
</span><span class="cx">     m_customSublayers = m_tileController-&gt;containerLayers();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacPlatformCALayerRemoteTiledBackingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h (172680 => 172681)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h        2014-08-16 02:57:58 UTC (rev 172680)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h        2014-08-16 04:03:42 UTC (rev 172681)
</span><span class="lines">@@ -40,7 +40,8 @@
</span><span class="cx"> 
</span><span class="cx">     virtual WebCore::TiledBacking* tiledBacking() override { return m_tileController.get(); }
</span><span class="cx"> 
</span><del>-    virtual void setNeedsDisplay(const WebCore::FloatRect* dirtyRect = 0) override;
</del><ins>+    virtual void setNeedsDisplayInRect(const WebCore::FloatRect&amp; dirtyRect) override;
+    virtual void setNeedsDisplay() override;
</ins><span class="cx"> 
</span><span class="cx">     virtual const WebCore::PlatformCALayerList* customSublayers() const override;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>