<!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>[198266] 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/198266">198266</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-03-16 00:05:24 -0700 (Wed, 16 Mar 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>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:
"[GTK] Limit the number of tiles according to the visible
area"
https://bugs.webkit.org/show_bug.cgi?id=126122
http://trac.webkit.org/changeset/196803</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstexmapGraphicsLayerTextureMappercpp">trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstexmapGraphicsLayerTextureMapperh">trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstexmapTextureMapperTiledBackingStorecpp">trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstexmapTextureMapperTiledBackingStoreh">trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagegtkLayerTreeHostGtkcpp">trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (198265 => 198266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-03-16 07:02:28 UTC (rev 198265)
+++ trunk/Source/WebCore/ChangeLog        2016-03-16 07:05:24 UTC (rev 198266)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-03-16 Commit Queue <commit-queue@webkit.org>
+
+ 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:
+
+ "[GTK] Limit the number of tiles according to the visible
+ area"
+ https://bugs.webkit.org/show_bug.cgi?id=126122
+ http://trac.webkit.org/changeset/196803
+
</ins><span class="cx"> 2016-03-15 Zalan Bujtas <zalan@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove overflow: -webkit-marquee
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicstexmapGraphicsLayerTextureMappercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp (198265 => 198266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp        2016-03-16 07:02:28 UTC (rev 198265)
+++ trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp        2016-03-16 07:05:24 UTC (rev 198266)
</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& 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& value)
</span><span class="lines">@@ -190,7 +186,6 @@
</span><span class="cx"> if (maskLayer())
</span><span class="cx"> maskLayer()->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& 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& 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->setContentsToImage(image);
</span><span class="cx"> m_compositedImage->updateContentsScale(pageScaleFactor() * deviceScaleFactor());
</span><del>- m_compositedImage->updateContentsSize(image->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->flushCompositingState(rect, viewportIsStable);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers(const FloatRect& 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<GraphicsLayerTextureMapper>(*maskLayer()).updateBackingStoreIfNeeded(visibleContentRect);
</del><ins>+ downcast<GraphicsLayerTextureMapper>(*maskLayer()).updateBackingStoreIfNeeded();
</ins><span class="cx"> if (replicaLayer())
</span><del>- downcast<GraphicsLayerTextureMapper>(*replicaLayer()).updateBackingStoreIfNeeded(visibleContentRect);
</del><ins>+ downcast<GraphicsLayerTextureMapper>(*replicaLayer()).updateBackingStoreIfNeeded();
</ins><span class="cx"> for (auto* child : children())
</span><del>- downcast<GraphicsLayerTextureMapper>(*child).updateBackingStoreIncludingSubLayers(visibleContentRect);
</del><ins>+ downcast<GraphicsLayerTextureMapper>(*child).updateBackingStoreIncludingSubLayers();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsLayerTextureMapper::updateBackingStoreIfNeeded(const FloatRect& 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<TextureMapperTiledBackingStore*>(m_backingStore.get());
</span><span class="cx"> backingStore->updateContentsScale(pageScaleFactor() * deviceScaleFactor());
</span><del>- backingStore->updateContentsSize(m_size);
</del><span class="cx">
</span><span class="cx"> dirtyRect.scale(pageScaleFactor() * deviceScaleFactor());
</span><del>- backingStore->updateContents(*textureMapper, this, transformedVisibleRect(visibleContentRect), dirtyRect, BitmapTexture::UpdateCanModifyOriginalImageData);
</del><ins>+ backingStore->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<GraphicsLayerTextureMapper>(*maskLayer()).markVisibleRectAsDirty();
- if (replicaLayer())
- downcast<GraphicsLayerTextureMapper>(*replicaLayer()).markVisibleRectAsDirty();
- for (auto* child : children())
- downcast<GraphicsLayerTextureMapper>(*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<GraphicsLayerTextureMapper>(*parent()).selfOrAncestorHasActiveTransformAnimation();
-}
-
-void GraphicsLayerTextureMapper::computeTransformedVisibleRect()
-{
- if (!m_isVisibleRectDirty && !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<GraphicsLayerTextureMapper>(*parent()).m_layerTransform.combinedForChildren() : TransformationMatrix());
-
- m_cachedInverseTransform = m_layerTransform.combined().inverse().valueOr(TransformationMatrix());
-}
-
-static void clampToContentsRectIfRectIsInfinite(FloatRect& rect, const FloatSize& contentsSize)
-{
- if (rect.width() >= LayoutUnit::nearlyMax() || rect.width() <= LayoutUnit::nearlyMin()) {
- rect.setX(0);
- rect.setWidth(contentsSize.width());
- }
-
- if (rect.height() >= LayoutUnit::nearlyMax() || rect.height() <= LayoutUnit::nearlyMin()) {
- rect.setY(0);
- rect.setHeight(contentsSize.height());
- }
-}
-
-FloatRect GraphicsLayerTextureMapper::transformedVisibleRect(const FloatRect& 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="trunkSourceWebCoreplatformgraphicstexmapGraphicsLayerTextureMapperh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h (198265 => 198266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h        2016-03-16 07:02:28 UTC (rev 198265)
+++ trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h        2016-03-16 07:05:24 UTC (rev 198266)
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx"> void flushCompositingState(const FloatRect&, bool) override;
</span><span class="cx"> void flushCompositingStateForThisLayerOnly(bool) override;
</span><span class="cx">
</span><del>- void updateBackingStoreIncludingSubLayers(const FloatRect&);
</del><ins>+ void updateBackingStoreIncludingSubLayers();
</ins><span class="cx">
</span><span class="cx"> TextureMapperLayer& 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&);
</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&);
</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&);
-
</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="trunkSourceWebCoreplatformgraphicstexmapTextureMapperTiledBackingStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp (198265 => 198266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp        2016-03-16 07:02:28 UTC (rev 198265)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp        2016-03-16 07:05:24 UTC (rev 198266)
</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->rect(), enclosingIntRect(m_image->rect()), BitmapTexture::UpdateCannotModifyOriginalImageData);
</del><ins>+ updateContents(textureMapper, m_image.get(), m_image->size(), enclosingIntRect(m_image->rect()), BitmapTexture::UpdateCannotModifyOriginalImageData);
</ins><span class="cx">
</span><span class="cx"> if (m_image->imageObserver())
</span><span class="cx"> m_image->imageObserver()->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& 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& textureMapper, const FloatRect& targetRect, const TransformationMatrix& 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& 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& textureMapper, const Color& borderColor, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& 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& size)
</del><ins>+void TextureMapperTiledBackingStore::createOrDestroyTilesIfNeeded(const FloatSize& size, const IntSize& tileSize, bool hasAlpha)
</ins><span class="cx"> {
</span><del>- if (m_contentsSize == size)
</del><ins>+ if (size == m_size && !m_isScaleDirty)
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- m_isSizeDirty = true;
- m_contentsSize = size;
-}
-
-void TextureMapperTiledBackingStore::createOrDestroyTilesIfNeeded(const FloatRect& visibleRect, const IntSize& tileSize, bool hasAlpha)
-{
- if (visibleRect == m_visibleRect && !m_isScaleDirty && !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<FloatRect> tileRectsToAdd;
</span><span class="cx"> Vector<int> 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 < scaledContentsRect.height(); y += tileSize.height()) {
- for (float x = 0; x < scaledContentsRect.width(); x += tileSize.width()) {
</del><ins>+ for (float y = 0; y < scaledSize.height(); y += tileSize.height()) {
+ for (float x = 0; x < 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& textureMapper, Image* image, const FloatRect& visibleRect, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
</del><ins>+void TextureMapperTiledBackingStore::updateContents(TextureMapper& textureMapper, Image* image, const FloatSize& totalSize, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
</ins><span class="cx"> {
</span><del>- createOrDestroyTilesIfNeeded(visibleRect, textureMapper.maxTextureSize(), !image->currentFrameKnownToBeOpaque());
</del><ins>+ createOrDestroyTilesIfNeeded(totalSize, textureMapper.maxTextureSize(), !image->currentFrameKnownToBeOpaque());
</ins><span class="cx"> for (auto& 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& textureMapper, GraphicsLayer* sourceLayer, const FloatRect& visibleRect, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
</del><ins>+void TextureMapperTiledBackingStore::updateContents(TextureMapper& textureMapper, GraphicsLayer* sourceLayer, const FloatSize& totalSize, const IntRect& 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& 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="trunkSourceWebCoreplatformgraphicstexmapTextureMapperTiledBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.h (198265 => 198266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.h        2016-03-16 07:02:28 UTC (rev 198265)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.h        2016-03-16 07:05:24 UTC (rev 198266)
</span><span class="lines">@@ -43,28 +43,29 @@
</span><span class="cx"> void drawRepaintCounter(TextureMapper&, int repaintCount, const Color&, const FloatRect&, const TransformationMatrix&) override;
</span><span class="cx">
</span><span class="cx"> void updateContentsScale(float);
</span><del>- void updateContentsSize(const FloatSize&);
</del><ins>+ void updateContents(TextureMapper&, Image*, const FloatSize&, const IntRect&, BitmapTexture::UpdateContentsFlag);
+ void updateContents(TextureMapper&, GraphicsLayer*, const FloatSize&, const IntRect&, BitmapTexture::UpdateContentsFlag);
</ins><span class="cx">
</span><del>- void updateContents(TextureMapper&, Image*, const FloatRect& visibleRect, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag);
- void updateContents(TextureMapper&, GraphicsLayer*, const FloatRect& visibleRect, const IntRect& 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& visibleRect, const IntSize& tileSize, bool hasAlpha);
</del><ins>+ void createOrDestroyTilesIfNeeded(const FloatSize& backingStoreSize, const IntSize& tileSize, bool hasAlpha);
</ins><span class="cx"> void updateContentsFromImageIfNeeded(TextureMapper&);
</span><span class="cx"> TransformationMatrix adjustedTransformForRect(const FloatRect&);
</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<TextureMapperTile> m_tiles;
</span><del>- FloatSize m_contentsSize;
- FloatRect m_visibleRect;
- FloatRect m_scaledvisibleRect;
</del><ins>+ FloatSize m_size;
</ins><span class="cx"> RefPtr<Image> 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="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (198265 => 198266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-03-16 07:02:28 UTC (rev 198265)
+++ trunk/Source/WebKit2/ChangeLog        2016-03-16 07:05:24 UTC (rev 198266)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-03-16 Commit Queue <commit-queue@webkit.org>
+
+ 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:
+
+ "[GTK] Limit the number of tiles according to the visible
+ area"
+ https://bugs.webkit.org/show_bug.cgi?id=126122
+ http://trac.webkit.org/changeset/196803
+
</ins><span class="cx"> 2016-03-15 Enrica Casucci <enrica@apple.com>
</span><span class="cx">
</span><span class="cx"> Follow up to r195769.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagegtkLayerTreeHostGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp (198265 => 198266)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp        2016-03-16 07:02:28 UTC (rev 198265)
+++ trunk/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp        2016-03-16 07:05:24 UTC (rev 198266)
</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<GraphicsLayerTextureMapper>(*m_nonCompositedContentLayer).setAsNonCompositingLayer();
</del><span class="cx"> m_nonCompositedContentLayer->setDrawsContent(true);
</span><span class="cx"> m_nonCompositedContentLayer->setContentsOpaque(m_webPage->drawsBackground());
</span><span class="cx"> m_nonCompositedContentLayer->setSize(m_webPage->size());
</span><span class="lines">@@ -323,8 +322,7 @@
</span><span class="cx"> if (m_viewOverlayRootLayer)
</span><span class="cx"> m_viewOverlayRootLayer->flushCompositingState(FloatRect(FloatPoint(), m_rootLayer->size()), viewportIsStable);
</span><span class="cx">
</span><del>- FloatRect visibleRect(m_webPage->mainFrame()->view()->scrollPosition(), m_webPage->size());
- downcast<GraphicsLayerTextureMapper>(*m_rootLayer).updateBackingStoreIncludingSubLayers(visibleRect);
</del><ins>+ downcast<GraphicsLayerTextureMapper>(*m_rootLayer).updateBackingStoreIncludingSubLayers();
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>