Unreviewed, rolling out r165540.
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Mar 2014 01:05:29 +0000 (01:05 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Mar 2014 01:05:29 +0000 (01:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=130199

caused 1 hidpi test fail (Requested by zalan on #webkit).

Reverted changeset:

"Subpixel rendering: Nested layers with subpixel accumulation
paint to wrong position."
https://bugs.webkit.org/show_bug.cgi?id=130153
http://trac.webkit.org/changeset/165540

Source/WebCore:

Patch by Commit Queue <commit-queue@webkit.org> on 2014-03-13

LayoutTests:

Patch by Commit Queue <commit-queue@webkit.org> on 2014-03-13

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165581 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/compositing/hidpi-nested-compositing-layers-with-subpixel-accumulation-expected.html [deleted file]
LayoutTests/compositing/hidpi-nested-compositing-layers-with-subpixel-accumulation.html [deleted file]
LayoutTests/fast/layers/hidpi-nested-layers-with-subpixel-accumulation-expected.html [deleted file]
LayoutTests/fast/layers/hidpi-nested-layers-with-subpixel-accumulation.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h

index 9ecb71f..4b622a5 100644 (file)
@@ -1,3 +1,17 @@
+2014-03-13  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r165540.
+        https://bugs.webkit.org/show_bug.cgi?id=130199
+
+        caused 1 hidpi test fail (Requested by zalan on #webkit).
+
+        Reverted changeset:
+
+        "Subpixel rendering: Nested layers with subpixel accumulation
+        paint to wrong position."
+        https://bugs.webkit.org/show_bug.cgi?id=130153
+        http://trac.webkit.org/changeset/165540
+
 2014-03-13  Andres Gomez  <agomez@igalia.com>
 
         Unreviewed, rolling out r165536.
diff --git a/LayoutTests/compositing/hidpi-nested-compositing-layers-with-subpixel-accumulation-expected.html b/LayoutTests/compositing/hidpi-nested-compositing-layers-with-subpixel-accumulation-expected.html
deleted file mode 100644 (file)
index 0583b59..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>This tests that nested compositing layers with subpixel accumulation paint to the same position as regular, non-compositing content.</title>
-<style>
-  div {
-    width: 5px;
-    height: 2px;
-    left: 0px;
-    position: absolute;
-  }
-</style>
-</head>
-<body>
-<p id="container"></p>
-<script>
-  left = 0;
-  for (i = 0; i < 10; ++i, left+=6.3) {
-    var container = document.getElementById("container");
-    for (j = 0; j < 50; ++j) {
-      var e = document.createElement("div");
-      e.style.top = "1.3px";
-      if (j == 0)
-        e.style.left = left + "px";
-      e.style.backgroundColor = "rgb(0, 0, " + (j * 4) + ")";
-      container.appendChild(e);
-      container = e;
-    }
-  }
-</script>
-</body>
-</html>
diff --git a/LayoutTests/compositing/hidpi-nested-compositing-layers-with-subpixel-accumulation.html b/LayoutTests/compositing/hidpi-nested-compositing-layers-with-subpixel-accumulation.html
deleted file mode 100644 (file)
index 0e30d8f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>This tests that nested compositing layers with subpixel accumulation paint to the same position as regular, non-compositing content.</title>
-<style>
-  div {
-    width: 5px;
-    height: 2px;
-    left: 0px;
-    position: absolute;
-    -webkit-transform: translateZ(0);
-  }
-</style>
-</head>
-<body>
-<p id="container"></p>
-<script>
-  left = 0;
-  for (i = 0; i < 10; ++i, left+=6.3) {
-    var container = document.getElementById("container");
-    for (j = 0; j < 50; ++j) {
-      var e = document.createElement("div");
-      e.style.top = "1.3px";
-      if (j == 0)
-        e.style.left = left + "px";
-      e.style.backgroundColor = "rgb(0, 0, " + (j * 4) + ")";
-      container.appendChild(e);
-      container = e;
-    }
-  }
-</script>
-</body>
-</html>
diff --git a/LayoutTests/fast/layers/hidpi-nested-layers-with-subpixel-accumulation-expected.html b/LayoutTests/fast/layers/hidpi-nested-layers-with-subpixel-accumulation-expected.html
deleted file mode 100644 (file)
index 0f891e5..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>This tests that nested non-compositing layers with subpixel accumulation paint to the same position as regular content.</title>
-<style>
-  div {
-    width: 5px;
-    height: 2px;
-    left: 0px;
-    position: absolute;
-  }
-</style>
-</head>
-<body>
-<p id="container"></p>
-<script>
-  left = 0;
-  for (i = 0; i < 10; ++i, left+=6.3) {
-    var container = document.getElementById("container");
-    for (j = 0; j < 50; ++j) {
-      var e = document.createElement("div");
-      e.style.top = "1.3px";
-      if (j == 0)
-        e.style.left = left + "px";
-      e.style.backgroundColor = "rgb(0, 0, " + (j * 4) + ")";
-      container.appendChild(e);
-      container = e;
-    }
-  }
-</script>
-</body>
-</html>
diff --git a/LayoutTests/fast/layers/hidpi-nested-layers-with-subpixel-accumulation.html b/LayoutTests/fast/layers/hidpi-nested-layers-with-subpixel-accumulation.html
deleted file mode 100644 (file)
index 93210b1..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>This tests that nested non-compositing layers with subpixel accumulation paint to the same position as regular content.</title>
-<style>
-  div {
-    width: 5px;
-    height: 2px;
-    left: 0px;
-    position: absolute;
-    -webkit-transform: rotate(0deg);
-  }
-</style>
-</head>
-<body>
-<p id="container"></p>
-<script>
-  left = 0;
-  for (i = 0; i < 10; ++i, left+=6.3) {
-    var container = document.getElementById("container");
-    for (j = 0; j < 50; ++j) {
-      var e = document.createElement("div");
-      e.style.top = "1.3px";
-      if (j == 0)
-        e.style.left = left + "px";
-      e.style.backgroundColor = "rgb(0, 0, " + (j * 4) + ")";
-      container.appendChild(e);
-      container = e;
-    }
-  }
-</script>
-</body>
-</html>
index 4884e66..7dbc3e3 100644 (file)
@@ -1,3 +1,17 @@
+2014-03-13  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r165540.
+        https://bugs.webkit.org/show_bug.cgi?id=130199
+
+        caused 1 hidpi test fail (Requested by zalan on #webkit).
+
+        Reverted changeset:
+
+        "Subpixel rendering: Nested layers with subpixel accumulation
+        paint to wrong position."
+        https://bugs.webkit.org/show_bug.cgi?id=130153
+        http://trac.webkit.org/changeset/165540
+
 2014-03-13  Benjamin Poulain  <bpoulain@apple.com>
 
         Fix a bunch of mistakes in the parsing of ::cue( and ::cue
index d6bcc4b..6771117 100644 (file)
@@ -4167,15 +4167,14 @@ void RenderLayer::paintLayerByApplyingTransform(GraphicsContext* context, const
     // This involves subtracting out the position of the layer in our current coordinate space, but preserving
     // the accumulated error for sub-pixel layout.
     float deviceScaleFactor = renderer().document().deviceScaleFactor();
-    LayoutPoint offsetFromParent;
-    convertToLayerCoords(paintingInfo.rootLayer, offsetFromParent);
-    offsetFromParent.moveBy(translationOffset);
+    LayoutPoint delta;
+    convertToLayerCoords(paintingInfo.rootLayer, delta);
+    delta.moveBy(translationOffset);
     TransformationMatrix transform(renderableTransform(paintingInfo.paintBehavior));
-    FloatPoint devicePixelFlooredOffsetFromParent = flooredForPainting(offsetFromParent, deviceScaleFactor);
-    transform.translateRight(devicePixelFlooredOffsetFromParent.x(), devicePixelFlooredOffsetFromParent.y());
-    // We handle accumulated subpixels through nested layers here. Since the context gets translated with floored device pixel value,
-    // all we need to do is add the difference to the accumulated pixels coming from ancestor layers.
-    LayoutSize adjustedSubPixelAccumulation = paintingInfo.subPixelAccumulation + (offsetFromParent - LayoutPoint(devicePixelFlooredOffsetFromParent));
+    FloatPoint roundedDelta = roundedForPainting(delta, deviceScaleFactor);
+    transform.translateRight(roundedDelta.x(), roundedDelta.y());
+    LayoutSize adjustedSubPixelAccumulation = paintingInfo.subPixelAccumulation + (delta - LayoutPoint(roundedDelta));
+
     // Apply the transform.
     GraphicsContextStateSaver stateSaver(*context);
     context->concatCTM(transform.toAffineTransform());
index 97893cd..e973d8d 100644 (file)
@@ -739,8 +739,6 @@ void RenderLayerBacking::updateGraphicsLayerGeometry()
 
     LayoutPoint offsetFromParent;
     m_owningLayer.convertToLayerCoords(compAncestor, offsetFromParent, RenderLayer::AdjustForColumns);
-    // Device pixel fractions get accumulated through ancestor layers. Our painting offset is layout offset + parent's painting offset.
-    offsetFromParent = offsetFromParent + (compAncestor ? compAncestor->backing()->devicePixelFractionFromRenderer() : LayoutSize());
     relativeCompositingBounds.moveBy(offsetFromParent);
 
     LayoutRect enclosingRelativeCompositingBounds = LayoutRect(enclosingRectForPainting(relativeCompositingBounds, deviceScaleFactor));
index c7bd1f2..89f6c11 100644 (file)
@@ -213,8 +213,6 @@ public:
     void setBlendMode(BlendMode);
 #endif
 
-    LayoutSize devicePixelFractionFromRenderer() const { return m_devicePixelFractionFromRenderer; }
-
 private:
     FloatRect backgroundBoxForPainting() const;