Title: [206662] trunk

Diff

Modified: trunk/LayoutTests/ChangeLog (206661 => 206662)


--- trunk/LayoutTests/ChangeLog	2016-09-30 20:52:02 UTC (rev 206661)
+++ trunk/LayoutTests/ChangeLog	2016-09-30 20:58:29 UTC (rev 206662)
@@ -1,3 +1,15 @@
+2016-09-30  Zalan Bujtas  <[email protected]>
+
+        Unreviewed, rolling out r206611.
+
+        Scroll perf did not recover.
+
+        Reverted changeset:
+
+        "Unreviewed, rolling out r206483."
+        https://bugs.webkit.org/show_bug.cgi?id=162750
+        http://trac.webkit.org/changeset/206611
+
 2016-09-30  Ryan Haddad  <[email protected]>
 
         Rebaseline js/dom/stack-trace.html after r206654.

Added: trunk/LayoutTests/compositing/hidpi-composited-container-and-graphics-layer-gap-changes-expected.html (0 => 206662)


--- trunk/LayoutTests/compositing/hidpi-composited-container-and-graphics-layer-gap-changes-expected.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/hidpi-composited-container-and-graphics-layer-gap-changes-expected.html	2016-09-30 20:58:29 UTC (rev 206662)
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests when the gap between the graphics layer and its associated renderer changes dynamically.</title>
+<style>
+div {
+  width: 20px;
+  height: 20px;
+  background-color: green;
+  position: absolute;
+}
+</style>
+</head>
+<body>
+<p id="container"></p>
+<script>
+  var subpixel = 0;
+  var container = document.getElementById("container");
+  for (i = 0; i < 20; ++i) {
+    for (j = 0; j < 20; ++j) {
+      var outer = document.createElement("div");
+      outer.style.top = 25 * i + subpixel + "px";
+      outer.style.left = 25 * j + subpixel + "px";
+      container.appendChild(outer);
+      subpixel += 0.1;
+    }
+  }
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/compositing/hidpi-composited-container-and-graphics-layer-gap-changes.html (0 => 206662)


--- trunk/LayoutTests/compositing/hidpi-composited-container-and-graphics-layer-gap-changes.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/hidpi-composited-container-and-graphics-layer-gap-changes.html	2016-09-30 20:58:29 UTC (rev 206662)
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests when the gap between the graphics layer and its associated renderer changes dynamically.</title>
+<style>
+div {
+  transform: translateZ(0);
+  width: 20px;
+  height: 20px;
+  background-color: green;
+  position: absolute;
+}
+
+.boxShadow {
+  background-color: yellow;
+}
+</style>
+<script>
+  if (window.testRunner)
+    testRunner.waitUntilDone();
+
+  function runTest() {
+  	setTimeout(function() {
+  	  var elements = document.getElementsByClassName("boxShadow")
+  	  for (var i = 0; i < elements.length; ++i)
+        elements[i].style.boxShadow = "0px 0px 10px transparent"; 
+      if (window.testRunner)
+        testRunner.notifyDone();
+      }, 0);
+  }
+</script>
+</head>
+<body _onload_="runTest()">
+<p id="container"></p>
+<script>
+  var subpixel = 0;
+  var container = document.getElementById("container");
+  for (i = 0; i < 20; ++i) {
+    for (j = 0; j < 20; ++j) {
+      var outer = document.createElement("div");
+      outer.style.top = 25 * i + subpixel + "px";
+      outer.style.left = 25 * j + subpixel + "px";
+      outer.className = "boxShadow";
+      outer.appendChild(document.createElement("div"));
+      container.appendChild(outer);
+      subpixel += 0.1;
+    }
+  }
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/compositing/hidpi-negative-composited-bounds-on-device-pixel-expected.html (0 => 206662)


--- trunk/LayoutTests/compositing/hidpi-negative-composited-bounds-on-device-pixel-expected.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/hidpi-negative-composited-bounds-on-device-pixel-expected.html	2016-09-30 20:58:29 UTC (rev 206662)
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests when the composited bounds lands on device pixel.</title>
+<style>
+.container {
+  position: absolute;
+  background-color: green; 
+  width: 50px; 
+  height: 50px;
+  left: 10.1px;
+  top: 10.1px;
+}
+
+.offset { 
+  background-color: blue;
+  width: 10px;
+  height: 10px;
+  left: -0.6px;
+  top: -0.7px;
+  position: relative;
+  } 
+
+.jiggle {
+  height: 30px;
+  width: 30px; 
+  background-color: red;
+}
+</style>
+</head>
+<body>
+<div class=container>
+  <div class=offset></div>
+  <div class=jiggle></div>
+</div>
+</body>
+</html>

Added: trunk/LayoutTests/compositing/hidpi-negative-composited-bounds-on-device-pixel.html (0 => 206662)


--- trunk/LayoutTests/compositing/hidpi-negative-composited-bounds-on-device-pixel.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/hidpi-negative-composited-bounds-on-device-pixel.html	2016-09-30 20:58:29 UTC (rev 206662)
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests when the composited bounds lands on device pixel.</title>
+<style>
+.container {
+  position: absolute;
+  background-color: green; 
+  transform: translateZ(0); 
+  width: 50px; 
+  height: 50px;
+  left: 10.1px;
+  top: 10.1px;
+}
+
+.offset { 
+  background-color: blue;
+  width: 10px;
+  height: 10px;
+  left: -0.6px;
+  top: -0.7px;
+  position: relative;
+  } 
+
+.jiggle {
+  height: 30px;
+  width: 30px; 
+  background-color: red;
+  transform: translateZ(0);
+}
+</style>
+</head>
+<body>
+<div class=container>
+  <div class=offset></div>
+  <div class=jiggle></div>
+</div>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (206661 => 206662)


--- trunk/Source/WebCore/ChangeLog	2016-09-30 20:52:02 UTC (rev 206661)
+++ trunk/Source/WebCore/ChangeLog	2016-09-30 20:58:29 UTC (rev 206662)
@@ -1,5 +1,17 @@
 2016-09-30  Zalan Bujtas  <[email protected]>
 
+        Unreviewed, rolling out r206611.
+
+        Scroll perf did not recover.
+
+        Reverted changeset:
+
+        "Unreviewed, rolling out r206483."
+        https://bugs.webkit.org/show_bug.cgi?id=162750
+        http://trac.webkit.org/changeset/206611
+
+2016-09-30  Zalan Bujtas  <[email protected]>
+
         Remove ClipRects's custom refcounting.
         https://bugs.webkit.org/show_bug.cgi?id=162798
 

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (206661 => 206662)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2016-09-30 20:52:02 UTC (rev 206661)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2016-09-30 20:58:29 UTC (rev 206662)
@@ -740,14 +740,18 @@
     return snappedGraphicsLayer;
 }
 
-static LayoutSize computeOffsetFromAncestorGraphicsLayer(RenderLayer* compositedAncestor, const LayoutPoint& location)
+static LayoutSize computeOffsetFromAncestorGraphicsLayer(RenderLayer* compositedAncestor, const LayoutPoint& location, float deviceScaleFactor)
 {
     if (!compositedAncestor)
         return toLayoutSize(location);
 
-    LayoutSize ancestorRenderLayerOffsetFromAncestorGraphicsLayer = -(LayoutSize(compositedAncestor->backing()->graphicsLayer()->offsetFromRenderer())
-        + compositedAncestor->backing()->subpixelOffsetFromRenderer());
-    return ancestorRenderLayerOffsetFromAncestorGraphicsLayer + toLayoutSize(location);
+    // FIXME: This is a workaround until after webkit.org/162634 gets fixed. ancestorSubpixelOffsetFromRenderer
+    // could be stale when a dynamic composited state change triggers a pre-order updateGeometry() traversal.
+    LayoutSize ancestorSubpixelOffsetFromRenderer = compositedAncestor->backing()->subpixelOffsetFromRenderer();
+    LayoutRect ancestorCompositedBounds = compositedAncestor->backing()->compositedBounds();
+    LayoutSize floored = toLayoutSize(LayoutPoint(floorPointToDevicePixels(ancestorCompositedBounds.location() - ancestorSubpixelOffsetFromRenderer, deviceScaleFactor)));
+    LayoutSize ancestorRendererOffsetFromAncestorGraphicsLayer = -(floored + ancestorSubpixelOffsetFromRenderer);
+    return ancestorRendererOffsetFromAncestorGraphicsLayer + toLayoutSize(location);
 }
 
 class ComputedOffsets {
@@ -757,6 +761,7 @@
         , m_location(localRect.location())
         , m_parentGraphicsLayerOffset(toLayoutSize(parentGraphicsLayerRect.location()))
         , m_primaryGraphicsLayerOffset(toLayoutSize(primaryGraphicsLayerRect.location()))
+        , m_deviceScaleFactor(renderLayer.renderer().document().deviceScaleFactor())
     {
     }
 
@@ -780,7 +785,7 @@
         if (!m_fromAncestorGraphicsLayer) {
             RenderLayer* compositedAncestor = m_renderLayer.ancestorCompositingLayer();
             LayoutPoint localPointInAncestorRenderLayerCoords = m_renderLayer.convertToLayerCoords(compositedAncestor, m_location, RenderLayer::AdjustForColumns);
-            m_fromAncestorGraphicsLayer = computeOffsetFromAncestorGraphicsLayer(compositedAncestor, localPointInAncestorRenderLayerCoords);
+            m_fromAncestorGraphicsLayer = computeOffsetFromAncestorGraphicsLayer(compositedAncestor, localPointInAncestorRenderLayerCoords, m_deviceScaleFactor);
         }
         return m_fromAncestorGraphicsLayer.value();
     }
@@ -794,6 +799,7 @@
     const LayoutPoint m_location;
     const LayoutSize m_parentGraphicsLayerOffset;
     const LayoutSize m_primaryGraphicsLayerOffset;
+    float m_deviceScaleFactor;
 };
 
 LayoutRect RenderLayerBacking::computePrimaryGraphicsLayerRect(const LayoutRect& parentGraphicsLayerRect) const
@@ -821,7 +827,7 @@
     if (ancestorBackingLayer->hasClippingLayer()) {
         // If the compositing ancestor has a layer to clip children, we parent in that, and therefore position relative to it.
         LayoutRect clippingBox = clipBox(downcast<RenderBox>(compositedAncestor->renderer()));
-        LayoutSize clippingBoxOffset = computeOffsetFromAncestorGraphicsLayer(compositedAncestor, clippingBox.location());
+        LayoutSize clippingBoxOffset = computeOffsetFromAncestorGraphicsLayer(compositedAncestor, clippingBox.location(), deviceScaleFactor());
         parentGraphicsLayerRect = snappedGraphicsLayer(clippingBoxOffset, clippingBox.size(), deviceScaleFactor()).m_snappedRect;
     }
 
@@ -850,7 +856,7 @@
         RenderLayer::ClipRectsContext clipRectsContext(compositedAncestor, TemporaryClipRects, IgnoreOverlayScrollbarSize, shouldRespectOverflowClip);
         LayoutRect parentClipRect = m_owningLayer.backgroundClipRect(clipRectsContext).rect(); // FIXME: Incorrect for CSS regions.
         ASSERT(!parentClipRect.isInfinite());
-        LayoutSize clippingOffset = computeOffsetFromAncestorGraphicsLayer(compositedAncestor, parentClipRect.location());
+        LayoutSize clippingOffset = computeOffsetFromAncestorGraphicsLayer(compositedAncestor, parentClipRect.location(), deviceScaleFactor());
         LayoutRect snappedClippingLayerRect = snappedGraphicsLayer(clippingOffset, parentClipRect.size(), deviceScaleFactor()).m_snappedRect;
         // The primary layer is then parented in, and positioned relative to this clipping layer.
         ancestorClippingLayerOffset = snappedClippingLayerRect.location() - parentGraphicsLayerRect.location();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to