<!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>[198271] releases/WebKitGTK/webkit-2.12/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/198271">198271</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2016-03-16 08:13:20 -0700 (Wed, 16 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/198266">r198266</a> - Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/196803">r196803</a>.
https://bugs.webkit.org/show_bug.cgi?id=155534

Introduced several rendering issues in popular websites
(Requested by KaL on #webkit).

Reverted changeset:

&quot;[GTK] Limit the number of tiles according to the visible
area&quot;
https://bugs.webkit.org/show_bug.cgi?id=126122
http://trac.webkit.org/changeset/196803</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCoreplatformgraphicstexmapGraphicsLayerTextureMappercpp">releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCoreplatformgraphicstexmapGraphicsLayerTextureMapperh">releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCoreplatformgraphicstexmapTextureMapperTiledBackingStorecpp">releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebCoreplatformgraphicstexmapTextureMapperTiledBackingStoreh">releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.h</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebKit2ChangeLog">releases/WebKitGTK/webkit-2.12/Source/WebKit2/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit212SourceWebKit2WebProcessWebPagegtkLayerTreeHostGtkcpp">releases/WebKitGTK/webkit-2.12/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit212SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog (198270 => 198271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog        2016-03-16 13:59:43 UTC (rev 198270)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog        2016-03-16 15:13:20 UTC (rev 198271)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-03-16  Commit Queue  &lt;commit-queue@webkit.org&gt;
+
+        Unreviewed, rolling out r196803.
+        https://bugs.webkit.org/show_bug.cgi?id=155534
+
+        Introduced several rendering issues in popular websites
+        (Requested by KaL on #webkit).
+
+        Reverted changeset:
+
+        &quot;[GTK] Limit the number of tiles according to the visible
+        area&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=126122
+        http://trac.webkit.org/changeset/196803
+
</ins><span class="cx"> 2016-03-15  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r197724): [GTK] Web Inspector: Images being blocked by CSP 2.0
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebCoreplatformgraphicstexmapGraphicsLayerTextureMappercpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp (198270 => 198271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp        2016-03-16 13:59:43 UTC (rev 198270)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp        2016-03-16 15:13:20 UTC (rev 198271)
</span><span class="lines">@@ -48,8 +48,6 @@
</span><span class="cx">     , m_contentsLayer(0)
</span><span class="cx">     , m_animationStartTime(0)
</span><span class="cx">     , m_isScrollable(false)
</span><del>-    , m_isNonCompositingLayer(false)
-    , m_isVisibleRectDirty(true)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -169,7 +167,6 @@
</span><span class="cx">         return;
</span><span class="cx">     GraphicsLayer::setPosition(value);
</span><span class="cx">     notifyChange(PositionChange);
</span><del>-    markVisibleRectAsDirty();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void GraphicsLayerTextureMapper::setAnchorPoint(const FloatPoint3D&amp; value)
</span><span class="lines">@@ -178,7 +175,6 @@
</span><span class="cx">         return;
</span><span class="cx">     GraphicsLayer::setAnchorPoint(value);
</span><span class="cx">     notifyChange(AnchorPointChange);
</span><del>-    markVisibleRectAsDirty();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void GraphicsLayerTextureMapper::setSize(const FloatSize&amp; value)
</span><span class="lines">@@ -190,7 +186,6 @@
</span><span class="cx">     if (maskLayer())
</span><span class="cx">         maskLayer()-&gt;setSize(value);
</span><span class="cx">     notifyChange(SizeChange);
</span><del>-    markVisibleRectAsDirty();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void GraphicsLayerTextureMapper::setTransform(const TransformationMatrix&amp; value)
</span><span class="lines">@@ -200,7 +195,6 @@
</span><span class="cx"> 
</span><span class="cx">     GraphicsLayer::setTransform(value);
</span><span class="cx">     notifyChange(TransformChange);
</span><del>-    markVisibleRectAsDirty();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void GraphicsLayerTextureMapper::setChildrenTransform(const TransformationMatrix&amp; value)
</span><span class="lines">@@ -209,7 +203,6 @@
</span><span class="cx">         return;
</span><span class="cx">     GraphicsLayer::setChildrenTransform(value);
</span><span class="cx">     notifyChange(ChildrenTransformChange);
</span><del>-    markVisibleRectAsDirty();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void GraphicsLayerTextureMapper::setPreserves3D(bool value)
</span><span class="lines">@@ -218,7 +211,6 @@
</span><span class="cx">         return;
</span><span class="cx">     GraphicsLayer::setPreserves3D(value);
</span><span class="cx">     notifyChange(Preserves3DChange);
</span><del>-    markVisibleRectAsDirty();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void GraphicsLayerTextureMapper::setMasksToBounds(bool value)
</span><span class="lines">@@ -227,7 +219,6 @@
</span><span class="cx">         return;
</span><span class="cx">     GraphicsLayer::setMasksToBounds(value);
</span><span class="cx">     notifyChange(MasksToBoundsChange);
</span><del>-    markVisibleRectAsDirty();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void GraphicsLayerTextureMapper::setDrawsContent(bool value)
</span><span class="lines">@@ -310,7 +301,6 @@
</span><span class="cx">             m_compositedImage = TextureMapperTiledBackingStore::create();
</span><span class="cx">         m_compositedImage-&gt;setContentsToImage(image);
</span><span class="cx">         m_compositedImage-&gt;updateContentsScale(pageScaleFactor() * deviceScaleFactor());
</span><del>-        m_compositedImage-&gt;updateContentsSize(image-&gt;size());
</del><span class="cx">     } else {
</span><span class="cx">         m_compositedNativeImagePtr = nullptr;
</span><span class="cx">         m_compositedImage = nullptr;
</span><span class="lines">@@ -379,8 +369,6 @@
</span><span class="cx">     prepareBackingStoreIfNeeded();
</span><span class="cx">     commitLayerChanges();
</span><span class="cx">     m_layer.syncAnimations();
</span><del>-    if (!m_isNonCompositingLayer)
-        computeTransformedVisibleRect();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void GraphicsLayerTextureMapper::prepareBackingStoreIfNeeded()
</span><span class="lines">@@ -524,22 +512,22 @@
</span><span class="cx">         child-&gt;flushCompositingState(rect, viewportIsStable);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers(const FloatRect&amp; visibleContentRect)
</del><ins>+void GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers()
</ins><span class="cx"> {
</span><span class="cx">     if (!m_layer.textureMapper())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    updateBackingStoreIfNeeded(visibleContentRect);
</del><ins>+    updateBackingStoreIfNeeded();
</ins><span class="cx"> 
</span><span class="cx">     if (maskLayer())
</span><del>-        downcast&lt;GraphicsLayerTextureMapper&gt;(*maskLayer()).updateBackingStoreIfNeeded(visibleContentRect);
</del><ins>+        downcast&lt;GraphicsLayerTextureMapper&gt;(*maskLayer()).updateBackingStoreIfNeeded();
</ins><span class="cx">     if (replicaLayer())
</span><del>-        downcast&lt;GraphicsLayerTextureMapper&gt;(*replicaLayer()).updateBackingStoreIfNeeded(visibleContentRect);
</del><ins>+        downcast&lt;GraphicsLayerTextureMapper&gt;(*replicaLayer()).updateBackingStoreIfNeeded();
</ins><span class="cx">     for (auto* child : children())
</span><del>-        downcast&lt;GraphicsLayerTextureMapper&gt;(*child).updateBackingStoreIncludingSubLayers(visibleContentRect);
</del><ins>+        downcast&lt;GraphicsLayerTextureMapper&gt;(*child).updateBackingStoreIncludingSubLayers();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void GraphicsLayerTextureMapper::updateBackingStoreIfNeeded(const FloatRect&amp; visibleContentRect)
</del><ins>+void GraphicsLayerTextureMapper::updateBackingStoreIfNeeded()
</ins><span class="cx"> {
</span><span class="cx">     TextureMapper* textureMapper = m_layer.textureMapper();
</span><span class="cx">     if (!textureMapper)
</span><span class="lines">@@ -559,10 +547,9 @@
</span><span class="cx"> 
</span><span class="cx">     TextureMapperTiledBackingStore* backingStore = static_cast&lt;TextureMapperTiledBackingStore*&gt;(m_backingStore.get());
</span><span class="cx">     backingStore-&gt;updateContentsScale(pageScaleFactor() * deviceScaleFactor());
</span><del>-    backingStore-&gt;updateContentsSize(m_size);
</del><span class="cx"> 
</span><span class="cx">     dirtyRect.scale(pageScaleFactor() * deviceScaleFactor());
</span><del>-    backingStore-&gt;updateContents(*textureMapper, this, transformedVisibleRect(visibleContentRect), dirtyRect, BitmapTexture::UpdateCanModifyOriginalImageData);
</del><ins>+    backingStore-&gt;updateContents(*textureMapper, this, m_size, dirtyRect, BitmapTexture::UpdateCanModifyOriginalImageData);
</ins><span class="cx"> 
</span><span class="cx">     m_needsDisplay = false;
</span><span class="cx">     m_needsDisplayRect = IntRect();
</span><span class="lines">@@ -639,81 +626,5 @@
</span><span class="cx">     notifyChange(RepaintCountChange);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void GraphicsLayerTextureMapper::markVisibleRectAsDirty()
-{
-    m_isVisibleRectDirty = true;
-
-    if (maskLayer())
-        downcast&lt;GraphicsLayerTextureMapper&gt;(*maskLayer()).markVisibleRectAsDirty();
-    if (replicaLayer())
-        downcast&lt;GraphicsLayerTextureMapper&gt;(*replicaLayer()).markVisibleRectAsDirty();
-    for (auto* child : children())
-        downcast&lt;GraphicsLayerTextureMapper&gt;(*child).markVisibleRectAsDirty();
</del><span class="cx"> }
</span><del>-
-bool GraphicsLayerTextureMapper::selfOrAncestorHasActiveTransformAnimation() const
-{
-    if (m_animations.hasActiveAnimationsOfType(AnimatedPropertyTransform))
-        return true;
-
-    if (!parent())
-        return false;
-
-    return downcast&lt;GraphicsLayerTextureMapper&gt;(*parent()).selfOrAncestorHasActiveTransformAnimation();
-}
-
-void GraphicsLayerTextureMapper::computeTransformedVisibleRect()
-{
-    if (!m_isVisibleRectDirty &amp;&amp; !selfOrAncestorHasActiveTransformAnimation())
-        return;
-
-    m_isVisibleRectDirty = false;
-    TransformationMatrix currentTransform = transform();
-    if (selfOrAncestorHasActiveTransformAnimation())
-        client().getCurrentTransform(this, currentTransform);
-    m_layerTransform.setLocalTransform(currentTransform);
-
-    m_layerTransform.setAnchorPoint(m_anchorPoint);
-    m_layerTransform.setPosition(m_position);
-    m_layerTransform.setSize(m_size);
-
-    m_layerTransform.setFlattening(!preserves3D());
-    m_layerTransform.setChildrenTransform(childrenTransform());
-    m_layerTransform.combineTransforms(parent() ? downcast&lt;GraphicsLayerTextureMapper&gt;(*parent()).m_layerTransform.combinedForChildren() : TransformationMatrix());
-
-    m_cachedInverseTransform = m_layerTransform.combined().inverse().valueOr(TransformationMatrix());
-}
-
-static void clampToContentsRectIfRectIsInfinite(FloatRect&amp; rect, const FloatSize&amp; contentsSize)
-{
-    if (rect.width() &gt;= LayoutUnit::nearlyMax() || rect.width() &lt;= LayoutUnit::nearlyMin()) {
-        rect.setX(0);
-        rect.setWidth(contentsSize.width());
-    }
-
-    if (rect.height() &gt;= LayoutUnit::nearlyMax() || rect.height() &lt;= LayoutUnit::nearlyMin()) {
-        rect.setY(0);
-        rect.setHeight(contentsSize.height());
-    }
-}
-
-FloatRect GraphicsLayerTextureMapper::transformedVisibleRect(const FloatRect&amp; visibleContentRect)
-{
-    if (m_isNonCompositingLayer)
-        return FloatRect(FloatPoint::zero(), m_size);
-
-    // Non-invertible layers are not visible.
-    if (!m_layerTransform.combined().isInvertible())
-        return IntRect();
-
-    // Return a projection of the visible rect (surface coordinates) onto the layer's plane (layer coordinates).
-    // The resulting quad might be squewed and the visible rect is the bounding box of this quad,
-    // so it might spread further than the real visible area (and then even more amplified by the cover rect multiplier).
-    ASSERT(m_cachedInverseTransform == m_layerTransform.combined().inverse().valueOr(TransformationMatrix()));
-    FloatRect rect = m_cachedInverseTransform.clampedBoundsOfProjectedQuad(FloatQuad(visibleContentRect));
-    clampToContentsRectIfRectIsInfinite(rect, size());
-    return rect;
-}
-
-}
</del><span class="cx"> #endif
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebCoreplatformgraphicstexmapGraphicsLayerTextureMapperh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h (198270 => 198271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h        2016-03-16 13:59:43 UTC (rev 198270)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h        2016-03-16 15:13:20 UTC (rev 198271)
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx">     virtual void flushCompositingState(const FloatRect&amp;, bool) override;
</span><span class="cx">     virtual void flushCompositingStateForThisLayerOnly(bool) override;
</span><span class="cx"> 
</span><del>-    void updateBackingStoreIncludingSubLayers(const FloatRect&amp;);
</del><ins>+    void updateBackingStoreIncludingSubLayers();
</ins><span class="cx"> 
</span><span class="cx">     TextureMapperLayer&amp; layer() { return m_layer; }
</span><span class="cx"> 
</span><span class="lines">@@ -102,7 +102,6 @@
</span><span class="cx">     void setRepaintCount(int);
</span><span class="cx"> 
</span><span class="cx">     void setAnimations(const TextureMapperAnimations&amp;);
</span><del>-    void setAsNonCompositingLayer() { m_isNonCompositingLayer = true; }
</del><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     // GraphicsLayer
</span><span class="lines">@@ -114,15 +113,10 @@
</span><span class="cx"> 
</span><span class="cx">     void commitLayerChanges();
</span><span class="cx">     void updateDebugBorderAndRepaintCount();
</span><del>-    void updateBackingStoreIfNeeded(const FloatRect&amp;);
</del><ins>+    void updateBackingStoreIfNeeded();
</ins><span class="cx">     void prepareBackingStoreIfNeeded();
</span><span class="cx">     bool shouldHaveBackingStore() const;
</span><span class="cx"> 
</span><del>-    bool selfOrAncestorHasActiveTransformAnimation() const;
-    void computeTransformedVisibleRect();
-    void markVisibleRectAsDirty();
-    FloatRect transformedVisibleRect(const FloatRect&amp;);
-
</del><span class="cx">     // This set of flags help us defer which properties of the layer have been
</span><span class="cx">     // modified by the compositor, so we can know what to look for in the next flush.
</span><span class="cx">     enum ChangeMask {
</span><span class="lines">@@ -188,11 +182,6 @@
</span><span class="cx"> 
</span><span class="cx">     IntSize m_committedScrollOffset;
</span><span class="cx">     bool m_isScrollable;
</span><del>-
-    bool m_isNonCompositingLayer;
-    bool m_isVisibleRectDirty;
-    GraphicsLayerTransform m_layerTransform;
-    TransformationMatrix m_cachedInverseTransform;
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebCoreplatformgraphicstexmapTextureMapperTiledBackingStorecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp (198270 => 198271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp        2016-03-16 13:59:43 UTC (rev 198270)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp        2016-03-16 15:13:20 UTC (rev 198271)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx">     if (!m_image)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    updateContents(textureMapper, m_image.get(), m_image-&gt;rect(), enclosingIntRect(m_image-&gt;rect()), BitmapTexture::UpdateCannotModifyOriginalImageData);
</del><ins>+    updateContents(textureMapper, m_image.get(), m_image-&gt;size(), enclosingIntRect(m_image-&gt;rect()), BitmapTexture::UpdateCannotModifyOriginalImageData);
</ins><span class="cx"> 
</span><span class="cx">     if (m_image-&gt;imageObserver())
</span><span class="cx">         m_image-&gt;imageObserver()-&gt;didDraw(m_image.get());
</span><span class="lines">@@ -44,23 +44,15 @@
</span><span class="cx"> 
</span><span class="cx"> TransformationMatrix TextureMapperTiledBackingStore::adjustedTransformForRect(const FloatRect&amp; targetRect)
</span><span class="cx"> {
</span><del>-    FloatRect scaledContentsRect(FloatPoint::zero(), m_contentsSize);
-    scaledContentsRect.scale(m_contentsScale);
-    return TransformationMatrix::rectToRect(scaledContentsRect, targetRect);
</del><ins>+    return TransformationMatrix::rectToRect(rect(), targetRect);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TextureMapperTiledBackingStore::paintToTextureMapper(TextureMapper&amp; textureMapper, const FloatRect&amp; targetRect, const TransformationMatrix&amp; transform, float opacity)
</span><span class="cx"> {
</span><del>-    FloatRect scaledTargetRect(targetRect);
-    if (m_image)
-        scaledTargetRect.scale(m_contentsScale);
-
</del><span class="cx">     updateContentsFromImageIfNeeded(textureMapper);
</span><del>-    TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(scaledTargetRect);
-    FloatRect scaledContentsRect(FloatPoint::zero(), m_contentsSize);
-    scaledContentsRect.scale(m_contentsScale);
</del><ins>+    TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect);
</ins><span class="cx">     for (auto&amp; tile : m_tiles)
</span><del>-        tile.paint(textureMapper, adjustedTransform, opacity, calculateExposedTileEdges(scaledContentsRect, tile.rect()));
</del><ins>+        tile.paint(textureMapper, adjustedTransform, opacity, calculateExposedTileEdges(rect(), tile.rect()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TextureMapperTiledBackingStore::drawBorder(TextureMapper&amp; textureMapper, const Color&amp; borderColor, float borderWidth, const FloatRect&amp; targetRect, const TransformationMatrix&amp; transform)
</span><span class="lines">@@ -86,50 +78,29 @@
</span><span class="cx">     m_contentsScale = scale;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TextureMapperTiledBackingStore::updateContentsSize(const FloatSize&amp; size)
</del><ins>+void TextureMapperTiledBackingStore::createOrDestroyTilesIfNeeded(const FloatSize&amp; size, const IntSize&amp; tileSize, bool hasAlpha)
</ins><span class="cx"> {
</span><del>-    if (m_contentsSize == size)
</del><ins>+    if (size == m_size &amp;&amp; !m_isScaleDirty)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_isSizeDirty = true;
-    m_contentsSize = size;
-}
-
-void TextureMapperTiledBackingStore::createOrDestroyTilesIfNeeded(const FloatRect&amp; visibleRect, const IntSize&amp; tileSize, bool hasAlpha)
-{
-    if (visibleRect == m_visibleRect &amp;&amp; !m_isScaleDirty &amp;&amp; !m_isSizeDirty)
-        return;
-
-    m_visibleRect = visibleRect;
</del><ins>+    m_size = size;
</ins><span class="cx">     m_isScaleDirty = false;
</span><del>-    m_isSizeDirty = false;
</del><span class="cx"> 
</span><del>-    FloatRect scaledContentsRect(FloatRect(FloatPoint::zero(), m_contentsSize));
-    FloatRect scaledVisibleRect(m_visibleRect);
</del><ins>+    FloatSize scaledSize(m_size);
+    if (!m_image)
+        scaledSize.scale(m_contentsScale);
</ins><span class="cx"> 
</span><del>-    static const float coverRectMultiplier = 1.2;
-    FloatPoint delta(scaledVisibleRect.center());
-    delta.scale(1 - coverRectMultiplier, 1 - coverRectMultiplier);
-
-    scaledVisibleRect.scale(coverRectMultiplier);
-    scaledVisibleRect.moveBy(delta);
-    if (!m_image) {
-        scaledContentsRect.scale(m_contentsScale);
-        scaledVisibleRect.scale(m_contentsScale);
-    }
-
</del><span class="cx">     Vector&lt;FloatRect&gt; tileRectsToAdd;
</span><span class="cx">     Vector&lt;int&gt; tileIndicesToRemove;
</span><span class="cx">     static const size_t TileEraseThreshold = 6;
</span><span class="cx"> 
</span><span class="cx">     // This method recycles tiles. We check which tiles we need to add, which to remove, and use as many
</span><span class="cx">     // removable tiles as replacement for new tiles when possible.
</span><del>-    for (float y = 0; y &lt; scaledContentsRect.height(); y += tileSize.height()) {
-        for (float x = 0; x &lt; scaledContentsRect.width(); x += tileSize.width()) {
</del><ins>+    for (float y = 0; y &lt; scaledSize.height(); y += tileSize.height()) {
+        for (float x = 0; x &lt; scaledSize.width(); x += tileSize.width()) {
</ins><span class="cx">             FloatRect tileRect(x, y, tileSize.width(), tileSize.height());
</span><del>-            tileRect.intersect(scaledContentsRect);
-            if (tileRect.intersects(scaledVisibleRect))
-                tileRectsToAdd.append(tileRect);
</del><ins>+            tileRect.intersect(rect());
+            tileRectsToAdd.append(tileRect);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -179,16 +150,16 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TextureMapperTiledBackingStore::updateContents(TextureMapper&amp; textureMapper, Image* image, const FloatRect&amp; visibleRect, const IntRect&amp; dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
</del><ins>+void TextureMapperTiledBackingStore::updateContents(TextureMapper&amp; textureMapper, Image* image, const FloatSize&amp; totalSize, const IntRect&amp; dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
</ins><span class="cx"> {
</span><del>-    createOrDestroyTilesIfNeeded(visibleRect, textureMapper.maxTextureSize(), !image-&gt;currentFrameKnownToBeOpaque());
</del><ins>+    createOrDestroyTilesIfNeeded(totalSize, textureMapper.maxTextureSize(), !image-&gt;currentFrameKnownToBeOpaque());
</ins><span class="cx">     for (auto&amp; tile : m_tiles)
</span><span class="cx">         tile.updateContents(textureMapper, image, dirtyRect, updateContentsFlag);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TextureMapperTiledBackingStore::updateContents(TextureMapper&amp; textureMapper, GraphicsLayer* sourceLayer, const FloatRect&amp; visibleRect, const IntRect&amp; dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
</del><ins>+void TextureMapperTiledBackingStore::updateContents(TextureMapper&amp; textureMapper, GraphicsLayer* sourceLayer, const FloatSize&amp; totalSize, const IntRect&amp; dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
</ins><span class="cx"> {
</span><del>-    createOrDestroyTilesIfNeeded(visibleRect, textureMapper.maxTextureSize(), true);
</del><ins>+    createOrDestroyTilesIfNeeded(totalSize, textureMapper.maxTextureSize(), true);
</ins><span class="cx">     for (auto&amp; tile : m_tiles)
</span><span class="cx">         tile.updateContents(textureMapper, sourceLayer, dirtyRect, updateContentsFlag, m_contentsScale);
</span><span class="cx"> }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebCoreplatformgraphicstexmapTextureMapperTiledBackingStoreh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.h (198270 => 198271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.h        2016-03-16 13:59:43 UTC (rev 198270)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.h        2016-03-16 15:13:20 UTC (rev 198271)
</span><span class="lines">@@ -43,28 +43,29 @@
</span><span class="cx">     virtual void drawRepaintCounter(TextureMapper&amp;, int repaintCount, const Color&amp;, const FloatRect&amp;, const TransformationMatrix&amp;) override;
</span><span class="cx"> 
</span><span class="cx">     void updateContentsScale(float);
</span><del>-    void updateContentsSize(const FloatSize&amp;);
</del><ins>+    void updateContents(TextureMapper&amp;, Image*, const FloatSize&amp;, const IntRect&amp;, BitmapTexture::UpdateContentsFlag);
+    void updateContents(TextureMapper&amp;, GraphicsLayer*, const FloatSize&amp;, const IntRect&amp;, BitmapTexture::UpdateContentsFlag);
</ins><span class="cx"> 
</span><del>-    void updateContents(TextureMapper&amp;, Image*, const FloatRect&amp; visibleRect, const IntRect&amp; dirtyRect, BitmapTexture::UpdateContentsFlag);
-    void updateContents(TextureMapper&amp;, GraphicsLayer*, const FloatRect&amp; visibleRect, const IntRect&amp; dirtyRect, BitmapTexture::UpdateContentsFlag);
-
</del><span class="cx">     void setContentsToImage(Image* image) { m_image = image; }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     TextureMapperTiledBackingStore() { }
</span><span class="cx"> 
</span><del>-    void createOrDestroyTilesIfNeeded(const FloatRect&amp; visibleRect, const IntSize&amp; tileSize, bool hasAlpha);
</del><ins>+    void createOrDestroyTilesIfNeeded(const FloatSize&amp; backingStoreSize, const IntSize&amp; tileSize, bool hasAlpha);
</ins><span class="cx">     void updateContentsFromImageIfNeeded(TextureMapper&amp;);
</span><span class="cx">     TransformationMatrix adjustedTransformForRect(const FloatRect&amp;);
</span><ins>+    inline FloatRect rect() const
+    {
+        FloatRect rect(FloatPoint::zero(), m_size);
+        rect.scale(m_contentsScale);
+        return rect;
+    }
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;TextureMapperTile&gt; m_tiles;
</span><del>-    FloatSize m_contentsSize;
-    FloatRect m_visibleRect;
-    FloatRect m_scaledvisibleRect;
</del><ins>+    FloatSize m_size;
</ins><span class="cx">     RefPtr&lt;Image&gt; m_image;
</span><span class="cx">     float m_contentsScale { 1 };
</span><span class="cx">     bool m_isScaleDirty { false };
</span><del>-    bool m_isSizeDirty { false };
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebKit2/ChangeLog (198270 => 198271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebKit2/ChangeLog        2016-03-16 13:59:43 UTC (rev 198270)
+++ releases/WebKitGTK/webkit-2.12/Source/WebKit2/ChangeLog        2016-03-16 15:13:20 UTC (rev 198271)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-03-16  Commit Queue  &lt;commit-queue@webkit.org&gt;
+
+        Unreviewed, rolling out r196803.
+        https://bugs.webkit.org/show_bug.cgi?id=155534
+
+        Introduced several rendering issues in popular websites
+        (Requested by KaL on #webkit).
+
+        Reverted changeset:
+
+        &quot;[GTK] Limit the number of tiles according to the visible
+        area&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=126122
+        http://trac.webkit.org/changeset/196803
+
</ins><span class="cx"> 2016-03-14  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Reimplement webkit_web_context_clear_cache functionality.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit212SourceWebKit2WebProcessWebPagegtkLayerTreeHostGtkcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.12/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp (198270 => 198271)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.12/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp        2016-03-16 13:59:43 UTC (rev 198270)
+++ releases/WebKitGTK/webkit-2.12/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp        2016-03-16 15:13:20 UTC (rev 198271)
</span><span class="lines">@@ -172,7 +172,6 @@
</span><span class="cx"> 
</span><span class="cx">     // The non-composited contents are a child of the root layer.
</span><span class="cx">     m_nonCompositedContentLayer = GraphicsLayer::create(graphicsLayerFactory(), *this);
</span><del>-    downcast&lt;GraphicsLayerTextureMapper&gt;(*m_nonCompositedContentLayer).setAsNonCompositingLayer();
</del><span class="cx">     m_nonCompositedContentLayer-&gt;setDrawsContent(true);
</span><span class="cx">     m_nonCompositedContentLayer-&gt;setContentsOpaque(m_webPage-&gt;drawsBackground());
</span><span class="cx">     m_nonCompositedContentLayer-&gt;setSize(m_webPage-&gt;size());
</span><span class="lines">@@ -323,8 +322,7 @@
</span><span class="cx">     if (m_viewOverlayRootLayer)
</span><span class="cx">         m_viewOverlayRootLayer-&gt;flushCompositingState(FloatRect(FloatPoint(), m_rootLayer-&gt;size()), viewportIsStable);
</span><span class="cx"> 
</span><del>-    FloatRect visibleRect(m_webPage-&gt;mainFrame()-&gt;view()-&gt;scrollPosition(), m_webPage-&gt;size());
-    downcast&lt;GraphicsLayerTextureMapper&gt;(*m_rootLayer).updateBackingStoreIncludingSubLayers(visibleRect);
</del><ins>+    downcast&lt;GraphicsLayerTextureMapper&gt;(*m_rootLayer).updateBackingStoreIncludingSubLayers();
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>