<!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>[245794] trunk/Source/WebCore</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/245794">245794</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2019-05-27 09:06:06 -0700 (Mon, 27 May 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move GraphicsLayerCA::adjustTiledLayerVisibleRect() to TileController
https://bugs.webkit.org/show_bug.cgi?id=198266

Reviewed by Zalan Bujtas.

GraphicsLayerCA::adjustTiledLayerVisibleRect() was computing tile coverage for a
TiledBacking, just like TileController::adjustTileCoverageRect(), so move the code
into TileController as a first step to unifying more of this code. It's currently
used for tiled compositing layers, including overflow:scroll, and tiled layers
whose coverage may be affected by animations, so it's general-purpose.

TileController::adjustTileCoverageRect() is used for scrollable things, so rename
it to adjustTileCoverageRectForScrolling().

No behavior change.

* platform/graphics/TiledBacking.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::adjustCoverageRect const):
(WebCore::GraphicsLayerCA::adjustTiledLayerVisibleRect): Deleted.
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::adjustTileCoverageRect const):
(WebCore::TileController::adjustTileCoverageRectForScrolling const):
* platform/graphics/ca/TileController.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsTiledBackingh">trunk/Source/WebCore/platform/graphics/TiledBacking.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="#trunkSourceWebCoreplatformgraphicscaTileControllercpp">trunk/Source/WebCore/platform/graphics/ca/TileController.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaTileControllerh">trunk/Source/WebCore/platform/graphics/ca/TileController.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (245793 => 245794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-05-27 16:00:42 UTC (rev 245793)
+++ trunk/Source/WebCore/ChangeLog      2019-05-27 16:06:06 UTC (rev 245794)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2019-05-26  Simon Fraser  <simon.fraser@apple.com>
+
+        Move GraphicsLayerCA::adjustTiledLayerVisibleRect() to TileController
+        https://bugs.webkit.org/show_bug.cgi?id=198266
+
+        Reviewed by Zalan Bujtas.
+
+        GraphicsLayerCA::adjustTiledLayerVisibleRect() was computing tile coverage for a
+        TiledBacking, just like TileController::adjustTileCoverageRect(), so move the code
+        into TileController as a first step to unifying more of this code. It's currently
+        used for tiled compositing layers, including overflow:scroll, and tiled layers
+        whose coverage may be affected by animations, so it's general-purpose.
+
+        TileController::adjustTileCoverageRect() is used for scrollable things, so rename
+        it to adjustTileCoverageRectForScrolling().
+
+        No behavior change.
+
+        * platform/graphics/TiledBacking.h:
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::adjustCoverageRect const):
+        (WebCore::GraphicsLayerCA::adjustTiledLayerVisibleRect): Deleted.
+        * platform/graphics/ca/GraphicsLayerCA.h:
+        * platform/graphics/ca/TileController.cpp:
+        (WebCore::TileController::adjustTileCoverageRect const):
+        (WebCore::TileController::adjustTileCoverageRectForScrolling const):
+        * platform/graphics/ca/TileController.h:
+
</ins><span class="cx"> 2019-05-27  Simon Fraser  <simon.fraser@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Fix Apple Internal builds after r245788.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsTiledBackingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/TiledBacking.h (245793 => 245794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/TiledBacking.h    2019-05-27 16:00:42 UTC (rev 245793)
+++ trunk/Source/WebCore/platform/graphics/TiledBacking.h       2019-05-27 16:06:06 UTC (rev 245794)
</span><span class="lines">@@ -95,7 +95,8 @@
</span><span class="cx">     virtual void setTileCoverage(TileCoverage) = 0;
</span><span class="cx">     virtual TileCoverage tileCoverage() const = 0;
</span><span class="cx"> 
</span><del>-    virtual void adjustTileCoverageRect(FloatRect& coverageRect, const FloatSize& newSize, const FloatRect& previousVisibleRect, const FloatRect& currentVisibleRect, float contentsScale) const = 0;
</del><ins>+    virtual FloatRect adjustTileCoverageRect(const FloatRect& coverageRect, const FloatRect& previousVisibleRect, const FloatRect& currentVisibleRect, bool sizeChanged) const = 0;
+    virtual FloatRect adjustTileCoverageRectForScrolling(const FloatRect& coverageRect, const FloatSize& newSize, const FloatRect& previousVisibleRect, const FloatRect& currentVisibleRect, float contentsScale) const = 0;
</ins><span class="cx"> 
</span><span class="cx">     virtual void willStartLiveResize() = 0;
</span><span class="cx">     virtual void didEndLiveResize() = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (245793 => 245794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp    2019-05-27 16:00:42 UTC (rev 245793)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp       2019-05-27 16:06:06 UTC (rev 245794)
</span><span class="lines">@@ -1443,16 +1443,14 @@
</span><span class="cx"> {
</span><span class="cx">     FloatRect coverageRect = rects.coverageRect;
</span><span class="cx"> 
</span><del>-    // FIXME: TileController's computeTileCoverageRect() code should move here, and we should unify these different
-    // ways of computing coverage.
</del><span class="cx">     switch (type()) {
</span><span class="cx">     case Type::PageTiledBacking:
</span><del>-        tiledBacking()->adjustTileCoverageRect(coverageRect, size(), oldVisibleRect, rects.visibleRect, pageScaleFactor() * deviceScaleFactor());
</del><ins>+        coverageRect = tiledBacking()->adjustTileCoverageRectForScrolling(coverageRect, size(), oldVisibleRect, rects.visibleRect, pageScaleFactor() * deviceScaleFactor());
</ins><span class="cx">         break;
</span><span class="cx">     case Type::Normal:
</span><span class="cx">     case Type::ScrolledContents:
</span><span class="cx">         if (m_layer->layerType() == PlatformCALayer::LayerTypeTiledBackingLayer)
</span><del>-            coverageRect.unite(adjustTiledLayerVisibleRect(tiledBacking(), oldVisibleRect, rects.visibleRect, m_sizeAtLastCoverageRectUpdate, m_size));
</del><ins>+            coverageRect = tiledBacking()->adjustTileCoverageRect(coverageRect, oldVisibleRect, rects.visibleRect, size() != m_sizeAtLastCoverageRectUpdate);
</ins><span class="cx">         break;
</span><span class="cx">     default:
</span><span class="cx">         break;
</span><span class="lines">@@ -2499,70 +2497,6 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-FloatRect GraphicsLayerCA::adjustTiledLayerVisibleRect(TiledBacking* tiledBacking, const FloatRect& oldVisibleRect, const FloatRect& newVisibleRect, const FloatSize& oldSize, const FloatSize& newSize)
-{
-    // If the old visible rect is empty, we have no information about how the visible area is changing
-    // (maybe the layer was just created), so don't attempt to expand. Also don't attempt to expand
-    // if the size changed or the rects don't overlap.
-    if (oldVisibleRect.isEmpty() || newSize != oldSize || !newVisibleRect.intersects(oldVisibleRect))
-        return newVisibleRect;
-
-    if (MemoryPressureHandler::singleton().isUnderMemoryPressure())
-        return newVisibleRect;
-
-    const float paddingMultiplier = 2;
-
-    float leftEdgeDelta = paddingMultiplier * (newVisibleRect.x() - oldVisibleRect.x());
-    float rightEdgeDelta = paddingMultiplier * (newVisibleRect.maxX() - oldVisibleRect.maxX());
-
-    float topEdgeDelta = paddingMultiplier * (newVisibleRect.y() - oldVisibleRect.y());
-    float bottomEdgeDelta = paddingMultiplier * (newVisibleRect.maxY() - oldVisibleRect.maxY());
-    
-    FloatRect existingTileBackingRect = tiledBacking->visibleRect();
-    FloatRect expandedRect = newVisibleRect;
-
-    // More exposed on left side.
-    if (leftEdgeDelta < 0) {
-        float newLeft = expandedRect.x() + leftEdgeDelta;
-        // Pad to the left, but don't reduce padding that's already in the backing store (since we're still exposing to the left).
-        if (newLeft < existingTileBackingRect.x())
-            expandedRect.shiftXEdgeTo(newLeft);
-        else
-            expandedRect.shiftXEdgeTo(existingTileBackingRect.x());
-    }
-
-    // More exposed on right.
-    if (rightEdgeDelta > 0) {
-        float newRight = expandedRect.maxX() + rightEdgeDelta;
-        // Pad to the right, but don't reduce padding that's already in the backing store (since we're still exposing to the right).
-        if (newRight > existingTileBackingRect.maxX())
-            expandedRect.setWidth(newRight - expandedRect.x());
-        else
-            expandedRect.setWidth(existingTileBackingRect.maxX() - expandedRect.x());
-    }
-
-    // More exposed at top.
-    if (topEdgeDelta < 0) {
-        float newTop = expandedRect.y() + topEdgeDelta;
-        if (newTop < existingTileBackingRect.y())
-            expandedRect.shiftYEdgeTo(newTop);
-        else
-            expandedRect.shiftYEdgeTo(existingTileBackingRect.y());
-    }
-
-    // More exposed on bottom.
-    if (bottomEdgeDelta > 0) {
-        float newBottom = expandedRect.maxY() + bottomEdgeDelta;
-        if (newBottom > existingTileBackingRect.maxY())
-            expandedRect.setHeight(newBottom - expandedRect.y());
-        else
-            expandedRect.setHeight(existingTileBackingRect.maxY() - expandedRect.y());
-    }
-    
-    expandedRect.intersect(tiledBacking->boundsWithoutMargin());
-    return expandedRect;
-}
-
</del><span class="cx"> void GraphicsLayerCA::updateTiles()
</span><span class="cx"> {
</span><span class="cx">     if (!m_layer->usesTiledBackingLayer())
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (245793 => 245794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h      2019-05-27 16:00:42 UTC (rev 245793)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h 2019-05-27 16:06:06 UTC (rev 245794)
</span><span class="lines">@@ -323,8 +323,6 @@
</span><span class="cx"> 
</span><span class="cx">     void setVisibleAndCoverageRects(const VisibleAndCoverageRects&, bool isViewportConstrained);
</span><span class="cx">     
</span><del>-    static FloatRect adjustTiledLayerVisibleRect(TiledBacking*, const FloatRect& oldVisibleRect, const FloatRect& newVisibleRect, const FloatSize& oldSize, const FloatSize& newSize);
-
</del><span class="cx">     bool recursiveVisibleRectChangeRequiresFlush(const CommitState&, const TransformState&) const;
</span><span class="cx">     
</span><span class="cx">     bool isPageTiledBackingLayer() const { return type() == Type::PageTiledBacking; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaTileControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.cpp (245793 => 245794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/TileController.cpp     2019-05-27 16:00:42 UTC (rev 245793)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.cpp        2019-05-27 16:06:06 UTC (rev 245794)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> #include "VelocityData.h"
</span><span class="cx"> #include <utility>
</span><span class="cx"> #include <wtf/MainThread.h>
</span><ins>+#include <wtf/MemoryPressureHandler.h>
</ins><span class="cx"> #include <wtf/text/TextStream.h>
</span><span class="cx"> 
</span><span class="cx"> #if HAVE(IOSURFACE)
</span><span class="lines">@@ -45,7 +46,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS_FAMILY)
</span><span class="cx"> #include "TileControllerMemoryHandlerIOS.h"
</span><del>-#include <wtf/MemoryPressureHandler.h>
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -386,22 +386,81 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-void TileController::adjustTileCoverageRect(FloatRect& coverageRect, const FloatSize& newSize, const FloatRect& previousVisibleRect, const FloatRect& visibleRect, float contentsScale) const
</del><ins>+FloatRect TileController::adjustTileCoverageRect(const FloatRect& coverageRect, const FloatRect& previousVisibleRect, const FloatRect& currentVisibleRect, bool sizeChanged) const
</ins><span class="cx"> {
</span><del>-    // If the page is not in a window (for example if it's in a background tab), we limit the tile coverage rect to the visible rect.
-    if (!m_isInWindow) {
-        coverageRect = visibleRect;
-        return;
</del><ins>+    // If the old visible rect is empty, we have no information about how the visible area is changing
+    // (maybe the layer was just created), so don't attempt to expand. Also don't attempt to expand
+    // if the size changed or the rects don't overlap.
+    if (previousVisibleRect.isEmpty() || sizeChanged  || !currentVisibleRect.intersects(previousVisibleRect))
+        return unionRect(coverageRect, currentVisibleRect);
+
+    if (MemoryPressureHandler::singleton().isUnderMemoryPressure())
+        return unionRect(coverageRect, currentVisibleRect);
+
+    const float paddingMultiplier = 2;
+
+    float leftEdgeDelta = paddingMultiplier * (currentVisibleRect.x() - previousVisibleRect.x());
+    float rightEdgeDelta = paddingMultiplier * (currentVisibleRect.maxX() - previousVisibleRect.maxX());
+
+    float topEdgeDelta = paddingMultiplier * (currentVisibleRect.y() - previousVisibleRect.y());
+    float bottomEdgeDelta = paddingMultiplier * (currentVisibleRect.maxY() - previousVisibleRect.maxY());
+    
+    FloatRect expandedRect = currentVisibleRect;
+
+    // More exposed on left side.
+    if (leftEdgeDelta < 0) {
+        float newLeft = expandedRect.x() + leftEdgeDelta;
+        // Pad to the left, but don't reduce padding that's already in the backing store (since we're still exposing to the left).
+        if (newLeft < previousVisibleRect.x())
+            expandedRect.shiftXEdgeTo(newLeft);
+        else
+            expandedRect.shiftXEdgeTo(previousVisibleRect.x());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // More exposed on right.
+    if (rightEdgeDelta > 0) {
+        float newRight = expandedRect.maxX() + rightEdgeDelta;
+        // Pad to the right, but don't reduce padding that's already in the backing store (since we're still exposing to the right).
+        if (newRight > previousVisibleRect.maxX())
+            expandedRect.setWidth(newRight - expandedRect.x());
+        else
+            expandedRect.setWidth(previousVisibleRect.maxX() - expandedRect.x());
+    }
+
+    // More exposed at top.
+    if (topEdgeDelta < 0) {
+        float newTop = expandedRect.y() + topEdgeDelta;
+        if (newTop < previousVisibleRect.y())
+            expandedRect.shiftYEdgeTo(newTop);
+        else
+            expandedRect.shiftYEdgeTo(previousVisibleRect.y());
+    }
+
+    // More exposed on bottom.
+    if (bottomEdgeDelta > 0) {
+        float newBottom = expandedRect.maxY() + bottomEdgeDelta;
+        if (newBottom > previousVisibleRect.maxY())
+            expandedRect.setHeight(newBottom - expandedRect.y());
+        else
+            expandedRect.setHeight(previousVisibleRect.maxY() - expandedRect.y());
+    }
+    
+    expandedRect.intersect(boundsWithoutMargin());
+    return unionRect(coverageRect, expandedRect);
+}
+
+FloatRect TileController::adjustTileCoverageRectForScrolling(const FloatRect& coverageRect, const FloatSize& newSize, const FloatRect& previousVisibleRect, const FloatRect& visibleRect, float contentsScale) const
+{
+    // If the page is not in a window (for example if it's in a background tab), we limit the tile coverage rect to the visible rect.
+    if (!m_isInWindow)
+        return visibleRect;
+
</ins><span class="cx"> #if PLATFORM(IOS_FAMILY)
</span><span class="cx">     // FIXME: unify the iOS and Mac code.
</span><span class="cx">     UNUSED_PARAM(previousVisibleRect);
</span><span class="cx">     
</span><del>-    if (m_tileCoverage == CoverageForVisibleArea || MemoryPressureHandler::singleton().isUnderMemoryPressure()) {
-        coverageRect = visibleRect;
-        return;
-    }
</del><ins>+    if (m_tileCoverage == CoverageForVisibleArea || MemoryPressureHandler::singleton().isUnderMemoryPressure())
+        return visibleRect;
</ins><span class="cx"> 
</span><span class="cx">     double horizontalMargin = kDefaultTileSize / contentsScale;
</span><span class="cx">     double verticalMargin = kDefaultTileSize / contentsScale;
</span><span class="lines">@@ -428,9 +487,8 @@
</span><span class="cx"> 
</span><span class="cx">     if (!m_velocity.horizontalVelocity && !m_velocity.verticalVelocity) {
</span><span class="cx">         if (m_velocity.scaleChangeRate > 0) {
</span><del>-            coverageRect = visibleRect;
</del><span class="cx">             LOG_WITH_STREAM(Tiling, stream << "TileController " << this << " computeTileCoverageRect - zooming, coverage is visible rect " << coverageRect);
</span><del>-            return;
</del><ins>+            return visibleRect;
</ins><span class="cx">         }
</span><span class="cx">         futureRect.setWidth(futureRect.width() + horizontalMargin);
</span><span class="cx">         futureRect.setHeight(futureRect.height() + verticalMargin);
</span><span class="lines">@@ -452,7 +510,7 @@
</span><span class="cx"> 
</span><span class="cx">     LOG_WITH_STREAM(Tiling, stream << "TileController " << this << " computeTileCoverageRect - coverage " << coverageRect << " expanded to " << unionRect(coverageRect, futureRect) << " velocity " << m_velocity);
</span><span class="cx"> 
</span><del>-    coverageRect.unite(futureRect);
</del><ins>+    return unionRect(coverageRect, futureRect);
</ins><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(contentsScale);
</span><span class="cx"> 
</span><span class="lines">@@ -479,7 +537,7 @@
</span><span class="cx">     
</span><span class="cx">     FloatRect coverage = expandRectWithinRect(visibleRect, coverageSize, coverageBounds);
</span><span class="cx">     LOG_WITH_STREAM(Tiling, stream << "TileController::computeTileCoverageRect newSize=" << newSize << " mode " << m_tileCoverage << " expanded to " << coverageSize << " bounds with margin " << coverageBounds << " coverage " << coverage);
</span><del>-    coverageRect.unite(coverage);
</del><ins>+    return unionRect(coverageRect, coverage);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaTileControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.h (245793 => 245794)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/TileController.h       2019-05-27 16:00:42 UTC (rev 245793)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.h  2019-05-27 16:06:06 UTC (rev 245794)
</span><span class="lines">@@ -87,8 +87,8 @@
</span><span class="cx">     WEBCORE_EXPORT void setTileDebugBorderWidth(float);
</span><span class="cx">     WEBCORE_EXPORT void setTileDebugBorderColor(Color);
</span><span class="cx"> 
</span><del>-    FloatRect visibleRect() const override { return m_visibleRect; }
-    FloatRect coverageRect() const override { return m_coverageRect; }
</del><ins>+    FloatRect visibleRect() const final { return m_visibleRect; }
+    FloatRect coverageRect() const final { return m_coverageRect; }
</ins><span class="cx">     Optional<FloatRect> layoutViewportRect() const { return m_layoutViewportRect; }
</span><span class="cx"> 
</span><span class="cx">     void setTileSizeUpdateDelayDisabledForTesting(bool) final;
</span><span class="lines">@@ -107,23 +107,26 @@
</span><span class="cx">     float tileDebugBorderWidth() const { return m_tileDebugBorderWidth; }
</span><span class="cx">     ScrollingModeIndication indicatorMode() const { return m_indicatorMode; }
</span><span class="cx"> 
</span><del>-    void willStartLiveResize() override;
-    void didEndLiveResize() override;
</del><ins>+    void willStartLiveResize() final;
+    void didEndLiveResize() final;
</ins><span class="cx"> 
</span><del>-    IntSize tileSize() const override;
-    IntRect bounds() const override;
-    IntRect boundsWithoutMargin() const override;
-    bool hasMargins() const override;
-    bool hasHorizontalMargins() const override;
-    bool hasVerticalMargins() const override;
-    int topMarginHeight() const override;
-    int bottomMarginHeight() const override;
-    int leftMarginWidth() const override;
-    int rightMarginWidth() const override;
-    TileCoverage tileCoverage() const override { return m_tileCoverage; }
-    void adjustTileCoverageRect(FloatRect& coverageRect, const FloatSize& newSize, const FloatRect& previousVisibleRect, const FloatRect& currentVisibleRect, float contentsScale) const override;
-    bool scrollingPerformanceLoggingEnabled() const override { return m_scrollingPerformanceLoggingEnabled; }
</del><ins>+    IntSize tileSize() const final;
+    IntRect bounds() const final;
+    IntRect boundsWithoutMargin() const final;
+    bool hasMargins() const final;
+    bool hasHorizontalMargins() const final;
+    bool hasVerticalMargins() const final;
+    int topMarginHeight() const final;
+    int bottomMarginHeight() const final;
+    int leftMarginWidth() const final;
+    int rightMarginWidth() const final;
+    TileCoverage tileCoverage() const final { return m_tileCoverage; }
</ins><span class="cx"> 
</span><ins>+    FloatRect adjustTileCoverageRect(const FloatRect& coverageRect, const FloatRect& previousVisibleRect, const FloatRect& currentVisibleRect, bool sizeChanged) const final;
+    FloatRect adjustTileCoverageRectForScrolling(const FloatRect& coverageRect, const FloatSize& newSize, const FloatRect& previousVisibleRect, const FloatRect& currentVisibleRect, float contentsScale) const final;
+
+    bool scrollingPerformanceLoggingEnabled() const final { return m_scrollingPerformanceLoggingEnabled; }
+
</ins><span class="cx">     IntSize computeTileSize();
</span><span class="cx"> 
</span><span class="cx">     IntRect boundsAtLastRevalidate() const { return m_boundsAtLastRevalidate; }
</span><span class="lines">@@ -151,32 +154,32 @@
</span><span class="cx">     float topContentInset() const { return m_topContentInset; }
</span><span class="cx"> 
</span><span class="cx">     // TiledBacking member functions.
</span><del>-    void setVisibleRect(const FloatRect&) override;
-    void setLayoutViewportRect(Optional<FloatRect>) override;
-    void setCoverageRect(const FloatRect&) override;
-    bool tilesWouldChangeForCoverageRect(const FloatRect&) const override;
-    void setTiledScrollingIndicatorPosition(const FloatPoint&) override;
-    void setTopContentInset(float) override;
-    void setVelocity(const VelocityData&) override;
-    void setScrollability(Scrollability) override;
-    void prepopulateRect(const FloatRect&) override;
-    void setIsInWindow(bool) override;
-    bool isInWindow() const override { return m_isInWindow; }
-    void setTileCoverage(TileCoverage) override;
-    void revalidateTiles() override;
-    void forceRepaint() override;
-    IntRect tileGridExtent() const override;
-    void setScrollingPerformanceLoggingEnabled(bool flag) override { m_scrollingPerformanceLoggingEnabled = flag; }
-    double retainedTileBackingStoreMemory() const override;
-    IntRect tileCoverageRect() const override;
</del><ins>+    void setVisibleRect(const FloatRect&) final;
+    void setLayoutViewportRect(Optional<FloatRect>) final;
+    void setCoverageRect(const FloatRect&) final;
+    bool tilesWouldChangeForCoverageRect(const FloatRect&) const final;
+    void setTiledScrollingIndicatorPosition(const FloatPoint&) final;
+    void setTopContentInset(float) final;
+    void setVelocity(const VelocityData&) final;
+    void setScrollability(Scrollability) final;
+    void prepopulateRect(const FloatRect&) final;
+    void setIsInWindow(bool) final;
+    bool isInWindow() const final { return m_isInWindow; }
+    void setTileCoverage(TileCoverage) final;
+    void revalidateTiles() final;
+    void forceRepaint() final;
+    IntRect tileGridExtent() const final;
+    void setScrollingPerformanceLoggingEnabled(bool flag) final { m_scrollingPerformanceLoggingEnabled = flag; }
+    double retainedTileBackingStoreMemory() const final;
+    IntRect tileCoverageRect() const final;
</ins><span class="cx"> #if USE(CA)
</span><del>-    PlatformCALayer* tiledScrollingIndicatorLayer() override;
</del><ins>+    PlatformCALayer* tiledScrollingIndicatorLayer() final;
</ins><span class="cx"> #endif
</span><del>-    void setScrollingModeIndication(ScrollingModeIndication) override;
-    void setHasMargins(bool marginTop, bool marginBottom, bool marginLeft, bool marginRight) override;
-    void setMarginSize(int) override;
-    void setZoomedOutContentsScale(float) override;
-    float zoomedOutContentsScale() const override;
</del><ins>+    void setScrollingModeIndication(ScrollingModeIndication) final;
+    void setHasMargins(bool marginTop, bool marginBottom, bool marginLeft, bool marginRight) final;
+    void setMarginSize(int) final;
+    void setZoomedOutContentsScale(float) final;
+    float zoomedOutContentsScale() const final;
</ins><span class="cx"> 
</span><span class="cx">     void updateMargins();
</span><span class="cx">     void clearZoomedOutTileGrid();
</span></span></pre>
</div>
</div>

</body>
</html>